diff --git a/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/AnaliseAcidenteTrabalho.java b/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/AnaliseAcidenteTrabalho.java index 9c929897..7f2ebfb1 100644 --- a/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/AnaliseAcidenteTrabalho.java +++ b/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/AnaliseAcidenteTrabalho.java @@ -65,11 +65,11 @@ import javax.faces.component.html.HtmlPanelGrid; import javax.faces.el.MethodBinding; import javax.faces.event.ActionEvent; import javax.faces.event.ValueChangeEvent; +import javax.mail.*; import javax.mail.internet.InternetAddress; import javax.mail.internet.MimeBodyPart; import javax.mail.internet.MimeMessage; import javax.mail.internet.MimeMultipart; -import javax.mail.*; import javax.mail.util.ByteArrayDataSource; import javax.servlet.ServletContext; import javax.servlet.http.HttpServletRequest; @@ -85,331 +85,363 @@ import utils.Utils; * lifecycle methods and event handlers where you may add behavior * to respond to incoming events.

*/ -public class AnaliseAcidenteTrabalho 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 gridMsg = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridMsg() { - return gridMsg; - } - - public void setGridMsg(HtmlPanelGrid hpg) { - this.gridMsg = hpg; - } - - private StaticText txtMsg = new StaticText(); - - public StaticText getTxtMsg() { - return txtMsg; - } - - public void setTxtMsg(StaticText st) { - this.txtMsg = st; - } - - private HtmlPanelGrid gridCabecalho = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridCabecalho() { - return gridCabecalho; - } - - public void setGridCabecalho(HtmlPanelGrid hpg) { - this.gridCabecalho = hpg; - } - - private HtmlPanelGrid gridPanel2 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel2() { - return gridPanel2; - } - - public void setGridPanel2(HtmlPanelGrid hpg) { - this.gridPanel2 = hpg; - } - - private StaticText lblEmpresa1 = new StaticText(); +public class AnaliseAcidenteTrabalho 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 StaticText getLblEmpresa1() { - return lblEmpresa1; - } + public Link getLink1() + { + return link1; + } - public void setLblEmpresa1(StaticText st) { - this.lblEmpresa1 = st; - } + public void setLink1( Link l ) + { + this.link1 = l; + } + private Body body1 = new Body(); - private StaticText txtEmpresa = new StaticText(); + public Body getBody1() + { + return body1; + } - public StaticText getTxtEmpresa() { - return txtEmpresa; - } + public void setBody1( Body b ) + { + this.body1 = b; + } + private Form form1 = new Form(); - public void setTxtEmpresa(StaticText st) { - this.txtEmpresa = st; - } + public Form getForm1() + { + return form1; + } - private StaticText staticText4 = new StaticText(); + public void setForm1( Form f ) + { + this.form1 = f; + } + private HtmlPanelGrid gridBase1 = new HtmlPanelGrid(); - public StaticText getStaticText4() { - return staticText4; - } + public HtmlPanelGrid getGridBase1() + { + return gridBase1; + } - public void setStaticText4(StaticText st) { - this.staticText4 = st; - } + public void setGridBase1( HtmlPanelGrid hpg ) + { + this.gridBase1 = hpg; + } + private HtmlPanelGrid gridLayout1 = new HtmlPanelGrid(); - private StaticText txtEstabelecimento = new StaticText(); + public HtmlPanelGrid getGridLayout1() + { + return gridLayout1; + } - public StaticText getTxtEstabelecimento() { - return txtEstabelecimento; - } + public void setGridLayout1( HtmlPanelGrid hpg ) + { + this.gridLayout1 = hpg; + } + private HtmlPanelGrid gridMsg = new HtmlPanelGrid(); - public void setTxtEstabelecimento(StaticText st) { - this.txtEstabelecimento = st; - } + public HtmlPanelGrid getGridMsg() + { + return gridMsg; + } - private StaticText txtTrabalhador = new StaticText(); + public void setGridMsg( HtmlPanelGrid hpg ) + { + this.gridMsg = hpg; + } + private StaticText txtMsg = new StaticText(); - public StaticText getTxtTrabalhador() { - return txtTrabalhador; - } + public StaticText getTxtMsg() + { + return txtMsg; + } - public void setTxtTrabalhador(StaticText st) { - this.txtTrabalhador = st; - } + public void setTxtMsg( StaticText st ) + { + this.txtMsg = st; + } + private HtmlPanelGrid gridCabecalho = new HtmlPanelGrid(); - private HtmlPanelGrid gridTrabalhadores = new HtmlPanelGrid(); + public HtmlPanelGrid getGridCabecalho() + { + return gridCabecalho; + } - public HtmlPanelGrid getGridTrabalhadores() { - return gridTrabalhadores; - } + public void setGridCabecalho( HtmlPanelGrid hpg ) + { + this.gridCabecalho = hpg; + } + private HtmlPanelGrid gridPanel2 = new HtmlPanelGrid(); - public void setGridTrabalhadores(HtmlPanelGrid hpg) { - this.gridTrabalhadores = hpg; - } + public HtmlPanelGrid getGridPanel2() + { + return gridPanel2; + } - private HtmlPanelGrid gridPanel3 = new HtmlPanelGrid(); + public void setGridPanel2( HtmlPanelGrid hpg ) + { + this.gridPanel2 = hpg; + } + private StaticText lblEmpresa1 = new StaticText(); - public HtmlPanelGrid getGridPanel3() { - return gridPanel3; - } + public StaticText getLblEmpresa1() + { + return lblEmpresa1; + } - public void setGridPanel3(HtmlPanelGrid hpg) { - this.gridPanel3 = hpg; - } + public void setLblEmpresa1( StaticText st ) + { + this.lblEmpresa1 = st; + } + private StaticText txtEmpresa = new StaticText(); - private StaticText staticText5 = new StaticText(); + public StaticText getTxtEmpresa() + { + return txtEmpresa; + } - public StaticText getStaticText5() { - return staticText5; - } + public void setTxtEmpresa( StaticText st ) + { + this.txtEmpresa = st; + } + private StaticText staticText4 = new StaticText(); - public void setStaticText5(StaticText st) { - this.staticText5 = st; - } + public StaticText getStaticText4() + { + return staticText4; + } - private HtmlPanelGrid gridPanel4 = new HtmlPanelGrid(); + public void setStaticText4( StaticText st ) + { + this.staticText4 = st; + } + private StaticText txtEstabelecimento = new StaticText(); - public HtmlPanelGrid getGridPanel4() { - return gridPanel4; - } + public StaticText getTxtEstabelecimento() + { + return txtEstabelecimento; + } - public void setGridPanel4(HtmlPanelGrid hpg) { - this.gridPanel4 = hpg; - } + public void setTxtEstabelecimento( StaticText st ) + { + this.txtEstabelecimento = st; + } + private StaticText txtTrabalhador = new StaticText(); - private StaticText txtSearchMsg = new StaticText(); + public StaticText getTxtTrabalhador() + { + return txtTrabalhador; + } - public StaticText getTxtSearchMsg() { - return txtSearchMsg; - } + public void setTxtTrabalhador( StaticText st ) + { + this.txtTrabalhador = st; + } + private HtmlPanelGrid gridTrabalhadores = new HtmlPanelGrid(); - public void setTxtSearchMsg(StaticText st) { - this.txtSearchMsg = st; - } + public HtmlPanelGrid getGridTrabalhadores() + { + return gridTrabalhadores; + } - private HtmlPanelGrid gridSiprp = new HtmlPanelGrid(); + public void setGridTrabalhadores( HtmlPanelGrid hpg ) + { + this.gridTrabalhadores = hpg; + } + private HtmlPanelGrid gridPanel3 = new HtmlPanelGrid(); - public HtmlPanelGrid getGridSiprp() { - return gridSiprp; - } + public HtmlPanelGrid getGridPanel3() + { + return gridPanel3; + } - public void setGridSiprp(HtmlPanelGrid hpg) { - this.gridSiprp = hpg; - } + public void setGridPanel3( HtmlPanelGrid hpg ) + { + this.gridPanel3 = hpg; + } + private StaticText staticText5 = new StaticText(); - private HtmlPanelGrid gridPanel5 = new HtmlPanelGrid(); + public StaticText getStaticText5() + { + return staticText5; + } - public HtmlPanelGrid getGridPanel5() { - return gridPanel5; - } + public void setStaticText5( StaticText st ) + { + this.staticText5 = st; + } + private HtmlPanelGrid gridPanel4 = new HtmlPanelGrid(); - public void setGridPanel5(HtmlPanelGrid hpg) { - this.gridPanel5 = hpg; - } + public HtmlPanelGrid getGridPanel4() + { + return gridPanel4; + } - private StaticText staticText6 = new StaticText(); + public void setGridPanel4( HtmlPanelGrid hpg ) + { + this.gridPanel4 = hpg; + } + private StaticText txtSearchMsg = new StaticText(); - public StaticText getStaticText6() { - return staticText6; - } + public StaticText getTxtSearchMsg() + { + return txtSearchMsg; + } - public void setStaticText6(StaticText st) { - this.staticText6 = st; - } + public void setTxtSearchMsg( StaticText st ) + { + this.txtSearchMsg = st; + } + private HtmlPanelGrid gridSiprp = new HtmlPanelGrid(); - private HtmlPanelGrid gridPanel6 = new HtmlPanelGrid(); + public HtmlPanelGrid getGridSiprp() + { + return gridSiprp; + } - public HtmlPanelGrid getGridPanel6() { - return gridPanel6; - } + public void setGridSiprp( HtmlPanelGrid hpg ) + { + this.gridSiprp = hpg; + } + private HtmlPanelGrid gridPanel5 = new HtmlPanelGrid(); - public void setGridPanel6(HtmlPanelGrid hpg) { - this.gridPanel6 = hpg; - } + public HtmlPanelGrid getGridPanel5() + { + return gridPanel5; + } - private HtmlPanelGrid gridPanel7 = new HtmlPanelGrid(); + public void setGridPanel5( HtmlPanelGrid hpg ) + { + this.gridPanel5 = hpg; + } + private StaticText staticText6 = new StaticText(); - public HtmlPanelGrid getGridPanel7() { - return gridPanel7; - } + public StaticText getStaticText6() + { + return staticText6; + } - public void setGridPanel7(HtmlPanelGrid hpg) { - this.gridPanel7 = hpg; - } + public void setStaticText6( StaticText st ) + { + this.staticText6 = st; + } + private HtmlPanelGrid gridPanel6 = new HtmlPanelGrid(); - private StaticText staticText9 = new StaticText(); + public HtmlPanelGrid getGridPanel6() + { + return gridPanel6; + } - public StaticText getStaticText9() { - return staticText9; - } + public void setGridPanel6( HtmlPanelGrid hpg ) + { + this.gridPanel6 = hpg; + } + private HtmlPanelGrid gridPanel7 = new HtmlPanelGrid(); - public void setStaticText9(StaticText st) { - this.staticText9 = st; - } + public HtmlPanelGrid getGridPanel7() + { + return gridPanel7; + } - private PanelGroup groupPanel3 = new PanelGroup(); + public void setGridPanel7( HtmlPanelGrid hpg ) + { + this.gridPanel7 = hpg; + } + private StaticText staticText9 = new StaticText(); - public PanelGroup getGroupPanel3() { - return groupPanel3; - } + public StaticText getStaticText9() + { + return staticText9; + } - public void setGroupPanel3(PanelGroup pg) { - this.groupPanel3 = pg; - } + public void setStaticText9( StaticText st ) + { + this.staticText9 = st; + } + private PanelGroup groupPanel3 = new PanelGroup(); - private StaticText staticText10 = new StaticText(); + public PanelGroup getGroupPanel3() + { + return groupPanel3; + } - public StaticText getStaticText10() { - return staticText10; - } + public void setGroupPanel3( PanelGroup pg ) + { + this.groupPanel3 = pg; + } + private StaticText staticText10 = new StaticText(); - public void setStaticText10(StaticText st) { - this.staticText10 = st; - } + public StaticText getStaticText10() + { + return staticText10; + } - private StaticText txtCap = new StaticText(); + public void setStaticText10( StaticText st ) + { + this.staticText10 = st; + } + private StaticText txtCap = new StaticText(); - public StaticText getTxtCap() { - return txtCap; - } + public StaticText getTxtCap() + { + return txtCap; + } - public void setTxtCap(StaticText st) { - this.txtCap = st; - } - - //
- //private String IMAGE_URL = "/resources/images"; - + public void setTxtCap( StaticText st ) + { + this.txtCap = 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; @@ -419,9063 +451,9704 @@ public class AnaliseAcidenteTrabalho extends AbstractPageBean { // 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_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 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(); - private Hyperlink lnkLblTrabalhador = new Hyperlink(); + public Hyperlink getLnkLblTrabalhador() + { + return lnkLblTrabalhador; + } - public Hyperlink getLnkLblTrabalhador() { - return lnkLblTrabalhador; - } + public void setLnkLblTrabalhador( Hyperlink h ) + { + this.lnkLblTrabalhador = h; + } + private HtmlPanelGrid gridAcidentado = new HtmlPanelGrid(); - public void setLnkLblTrabalhador(Hyperlink h) { - this.lnkLblTrabalhador = h; - } + public HtmlPanelGrid getGridAcidentado() + { + return gridAcidentado; + } - private HtmlPanelGrid gridAcidentado = new HtmlPanelGrid(); + public void setGridAcidentado( HtmlPanelGrid hpg ) + { + this.gridAcidentado = hpg; + } + private HtmlPanelGrid gridPanel23 = new HtmlPanelGrid(); - public HtmlPanelGrid getGridAcidentado() { - return gridAcidentado; - } + public HtmlPanelGrid getGridPanel23() + { + return gridPanel23; + } - public void setGridAcidentado(HtmlPanelGrid hpg) { - this.gridAcidentado = hpg; - } + public void setGridPanel23( HtmlPanelGrid hpg ) + { + this.gridPanel23 = hpg; + } + private StaticText staticText29 = new StaticText(); - private HtmlPanelGrid gridPanel23 = new HtmlPanelGrid(); + public StaticText getStaticText29() + { + return staticText29; + } - public HtmlPanelGrid getGridPanel23() { - return gridPanel23; - } + public void setStaticText29( StaticText st ) + { + this.staticText29 = st; + } + private HtmlPanelGrid gridPanel24 = new HtmlPanelGrid(); - public void setGridPanel23(HtmlPanelGrid hpg) { - this.gridPanel23 = hpg; - } + public HtmlPanelGrid getGridPanel24() + { + return gridPanel24; + } - private StaticText staticText29 = new StaticText(); + public void setGridPanel24( HtmlPanelGrid hpg ) + { + this.gridPanel24 = hpg; + } + private HtmlPanelGrid gridPanel25 = new HtmlPanelGrid(); - public StaticText getStaticText29() { - return staticText29; - } + public HtmlPanelGrid getGridPanel25() + { + return gridPanel25; + } - public void setStaticText29(StaticText st) { - this.staticText29 = st; - } + public void setGridPanel25( HtmlPanelGrid hpg ) + { + this.gridPanel25 = hpg; + } + private StaticText staticText30 = new StaticText(); - private HtmlPanelGrid gridPanel24 = new HtmlPanelGrid(); + public StaticText getStaticText30() + { + return staticText30; + } - public HtmlPanelGrid getGridPanel24() { - return gridPanel24; - } + public void setStaticText30( StaticText st ) + { + this.staticText30 = st; + } + private StaticText txtNomeAcidentado = new StaticText(); - public void setGridPanel24(HtmlPanelGrid hpg) { - this.gridPanel24 = hpg; - } + public StaticText getTxtNomeAcidentado() + { + return txtNomeAcidentado; + } - private HtmlPanelGrid gridPanel25 = new HtmlPanelGrid(); + public void setTxtNomeAcidentado( StaticText st ) + { + this.txtNomeAcidentado = st; + } + private StaticText staticText31 = new StaticText(); - public HtmlPanelGrid getGridPanel25() { - return gridPanel25; - } + public StaticText getStaticText31() + { + return staticText31; + } - public void setGridPanel25(HtmlPanelGrid hpg) { - this.gridPanel25 = hpg; - } + public void setStaticText31( StaticText st ) + { + this.staticText31 = st; + } + private StaticText txtDataNascimento = new StaticText(); - private StaticText staticText30 = new StaticText(); + public StaticText getTxtDataNascimento() + { + return txtDataNascimento; + } - public StaticText getStaticText30() { - return staticText30; - } + public void setTxtDataNascimento( StaticText st ) + { + this.txtDataNascimento = st; + } + private StaticText staticText32 = new StaticText(); - public void setStaticText30(StaticText st) { - this.staticText30 = st; - } + public StaticText getStaticText32() + { + return staticText32; + } - private StaticText txtNomeAcidentado = new StaticText(); + public void setStaticText32( StaticText st ) + { + this.staticText32 = st; + } + private TextField txtBI = new TextField(); - public StaticText getTxtNomeAcidentado() { - return txtNomeAcidentado; - } + public TextField getTxtBI() + { + return txtBI; + } - public void setTxtNomeAcidentado(StaticText st) { - this.txtNomeAcidentado = st; - } + public void setTxtBI( TextField tf ) + { + this.txtBI = tf; + } + private StaticText staticText33 = new StaticText(); - private StaticText staticText31 = new StaticText(); + public StaticText getStaticText33() + { + return staticText33; + } - public StaticText getStaticText31() { - return staticText31; - } + public void setStaticText33( StaticText st ) + { + this.staticText33 = st; + } + private TextField txtMorada = new TextField(); - public void setStaticText31(StaticText st) { - this.staticText31 = st; - } + public TextField getTxtMorada() + { + return txtMorada; + } - private StaticText txtDataNascimento = new StaticText(); + public void setTxtMorada( TextField tf ) + { + this.txtMorada = tf; + } + private StaticText staticText34 = new StaticText(); - public StaticText getTxtDataNascimento() { - return txtDataNascimento; - } + public StaticText getStaticText34() + { + return staticText34; + } - public void setTxtDataNascimento(StaticText st) { - this.txtDataNascimento = st; - } + public void setStaticText34( StaticText st ) + { + this.staticText34 = st; + } + private PanelGroup groupPanel6 = new PanelGroup(); - private StaticText staticText32 = new StaticText(); + public PanelGroup getGroupPanel6() + { + return groupPanel6; + } - public StaticText getStaticText32() { - return staticText32; - } + public void setGroupPanel6( PanelGroup pg ) + { + this.groupPanel6 = pg; + } + private TextField txtCodPostal1 = new TextField(); - public void setStaticText32(StaticText st) { - this.staticText32 = st; - } + public TextField getTxtCodPostal1() + { + return txtCodPostal1; + } - private TextField txtBI = new TextField(); + public void setTxtCodPostal1( TextField tf ) + { + this.txtCodPostal1 = tf; + } + private StaticText staticText35 = new StaticText(); - public TextField getTxtBI() { - return txtBI; - } + public StaticText getStaticText35() + { + return staticText35; + } - public void setTxtBI(TextField tf) { - this.txtBI = tf; - } + public void setStaticText35( StaticText st ) + { + this.staticText35 = st; + } + private TextField txtCodPostal2 = new TextField(); - private StaticText staticText33 = new StaticText(); + public TextField getTxtCodPostal2() + { + return txtCodPostal2; + } - public StaticText getStaticText33() { - return staticText33; - } + public void setTxtCodPostal2( TextField tf ) + { + this.txtCodPostal2 = tf; + } + private StaticText staticText36 = new StaticText(); - public void setStaticText33(StaticText st) { - this.staticText33 = st; - } + public StaticText getStaticText36() + { + return staticText36; + } - private TextField txtMorada = new TextField(); + public void setStaticText36( StaticText st ) + { + this.staticText36 = st; + } + private TextField txtLocalidade = new TextField(); - public TextField getTxtMorada() { - return txtMorada; - } + public TextField getTxtLocalidade() + { + return txtLocalidade; + } - public void setTxtMorada(TextField tf) { - this.txtMorada = tf; - } + public void setTxtLocalidade( TextField tf ) + { + this.txtLocalidade = tf; + } + private StaticText staticText37 = new StaticText(); - private StaticText staticText34 = new StaticText(); + public StaticText getStaticText37() + { + return staticText37; + } - public StaticText getStaticText34() { - return staticText34; - } + public void setStaticText37( StaticText st ) + { + this.staticText37 = st; + } + private TextField txtContactoTelefonico = new TextField(); - public void setStaticText34(StaticText st) { - this.staticText34 = st; - } + public TextField getTxtContactoTelefonico() + { + return txtContactoTelefonico; + } - private PanelGroup groupPanel6 = new PanelGroup(); + public void setTxtContactoTelefonico( TextField tf ) + { + this.txtContactoTelefonico = tf; + } + private StaticText staticText38 = new StaticText(); - public PanelGroup getGroupPanel6() { - return groupPanel6; - } + public StaticText getStaticText38() + { + return staticText38; + } - public void setGroupPanel6(PanelGroup pg) { - this.groupPanel6 = pg; - } + public void setStaticText38( StaticText st ) + { + this.staticText38 = st; + } + private StaticText stDataAdmissao = new StaticText(); - private TextField txtCodPostal1 = new TextField(); + public StaticText getStDataAdmissao() + { + return stDataAdmissao; + } - public TextField getTxtCodPostal1() { - return txtCodPostal1; - } + public void setStDataAdmissao( StaticText st ) + { + this.stDataAdmissao = st; + } + private StaticText staticText39 = new StaticText(); - public void setTxtCodPostal1(TextField tf) { - this.txtCodPostal1 = tf; - } + public StaticText getStaticText39() + { + return staticText39; + } - private StaticText staticText35 = new StaticText(); + public void setStaticText39( StaticText st ) + { + this.staticText39 = st; + } + private StaticText stFuncao = new StaticText(); - public StaticText getStaticText35() { - return staticText35; - } + public StaticText getStFuncao() + { + return stFuncao; + } - public void setStaticText35(StaticText st) { - this.staticText35 = st; - } + public void setStFuncao( StaticText st ) + { + this.stFuncao = st; + } + private StaticText staticText40 = new StaticText(); - private TextField txtCodPostal2 = new TextField(); + public StaticText getStaticText40() + { + return staticText40; + } - public TextField getTxtCodPostal2() { - return txtCodPostal2; - } + public void setStaticText40( StaticText st ) + { + this.staticText40 = st; + } + private HtmlPanelGrid gridDadosAcidenteSeg = new HtmlPanelGrid(); - public void setTxtCodPostal2(TextField tf) { - this.txtCodPostal2 = tf; - } + public HtmlPanelGrid getGridDadosAcidenteSeg() + { + return gridDadosAcidenteSeg; + } - private StaticText staticText36 = new StaticText(); + public void setGridDadosAcidenteSeg( HtmlPanelGrid hpg ) + { + this.gridDadosAcidenteSeg = hpg; + } + private HtmlPanelGrid gridPanel8 = new HtmlPanelGrid(); - public StaticText getStaticText36() { - return staticText36; - } + public HtmlPanelGrid getGridPanel8() + { + return gridPanel8; + } - public void setStaticText36(StaticText st) { - this.staticText36 = st; - } + public void setGridPanel8( HtmlPanelGrid hpg ) + { + this.gridPanel8 = hpg; + } + private StaticText staticText13 = new StaticText(); - private TextField txtLocalidade = new TextField(); + public StaticText getStaticText13() + { + return staticText13; + } - public TextField getTxtLocalidade() { - return txtLocalidade; - } + public void setStaticText13( StaticText st ) + { + this.staticText13 = st; + } + private HtmlPanelGrid gridPanel9 = new HtmlPanelGrid(); - public void setTxtLocalidade(TextField tf) { - this.txtLocalidade = tf; - } + public HtmlPanelGrid getGridPanel9() + { + return gridPanel9; + } - private StaticText staticText37 = new StaticText(); + public void setGridPanel9( HtmlPanelGrid hpg ) + { + this.gridPanel9 = hpg; + } + private HtmlPanelGrid gridPanel11 = new HtmlPanelGrid(); - public StaticText getStaticText37() { - return staticText37; - } + public HtmlPanelGrid getGridPanel11() + { + return gridPanel11; + } - public void setStaticText37(StaticText st) { - this.staticText37 = st; - } + public void setGridPanel11( HtmlPanelGrid hpg ) + { + this.gridPanel11 = hpg; + } + private PanelGroup groupPanel10 = new PanelGroup(); - private TextField txtContactoTelefonico = new TextField(); + public PanelGroup getGroupPanel10() + { + return groupPanel10; + } - public TextField getTxtContactoTelefonico() { - return txtContactoTelefonico; - } + public void setGroupPanel10( PanelGroup pg ) + { + this.groupPanel10 = pg; + } + private StaticText staticText17 = new StaticText(); - public void setTxtContactoTelefonico(TextField tf) { - this.txtContactoTelefonico = tf; - } + public StaticText getStaticText17() + { + return staticText17; + } - private StaticText staticText38 = new StaticText(); + public void setStaticText17( StaticText st ) + { + this.staticText17 = st; + } + private PanelGroup groupPanel11 = new PanelGroup(); - public StaticText getStaticText38() { - return staticText38; - } + public PanelGroup getGroupPanel11() + { + return groupPanel11; + } - public void setStaticText38(StaticText st) { - this.staticText38 = st; - } + public void setGroupPanel11( PanelGroup pg ) + { + this.groupPanel11 = pg; + } + private StaticText staticText18 = new StaticText(); - private StaticText stDataAdmissao = new StaticText(); + public StaticText getStaticText18() + { + return staticText18; + } - public StaticText getStDataAdmissao() { - return stDataAdmissao; - } + public void setStaticText18( StaticText st ) + { + this.staticText18 = st; + } + private TextField txtLocal = new TextField(); - public void setStDataAdmissao(StaticText st) { - this.stDataAdmissao = st; - } + public TextField getTxtLocal() + { + return txtLocal; + } - private StaticText staticText39 = new StaticText(); + public void setTxtLocal( TextField tf ) + { + this.txtLocal = tf; + } + private HtmlPanelGrid gridPanel12 = new HtmlPanelGrid(); - public StaticText getStaticText39() { - return staticText39; - } + public HtmlPanelGrid getGridPanel12() + { + return gridPanel12; + } - public void setStaticText39(StaticText st) { - this.staticText39 = st; - } + public void setGridPanel12( HtmlPanelGrid hpg ) + { + this.gridPanel12 = hpg; + } + private StaticText staticText19 = new StaticText(); - private StaticText stFuncao = new StaticText(); + public StaticText getStaticText19() + { + return staticText19; + } - public StaticText getStFuncao() { - return stFuncao; - } + public void setStaticText19( StaticText st ) + { + this.staticText19 = st; + } + private TextField txtTarefa = new TextField(); - public void setStFuncao(StaticText st) { - this.stFuncao = st; - } + public TextField getTxtTarefa() + { + return txtTarefa; + } - private StaticText staticText40 = new StaticText(); + public void setTxtTarefa( TextField tf ) + { + this.txtTarefa = tf; + } + private HtmlPanelGrid gridPanel13 = new HtmlPanelGrid(); - public StaticText getStaticText40() { - return staticText40; - } + public HtmlPanelGrid getGridPanel13() + { + return gridPanel13; + } - public void setStaticText40(StaticText st) { - this.staticText40 = st; - } + public void setGridPanel13( HtmlPanelGrid hpg ) + { + this.gridPanel13 = hpg; + } + private StaticText staticText20 = new StaticText(); - private HtmlPanelGrid gridDadosAcidenteSeg = new HtmlPanelGrid(); + public StaticText getStaticText20() + { + return staticText20; + } - public HtmlPanelGrid getGridDadosAcidenteSeg() { - return gridDadosAcidenteSeg; - } + public void setStaticText20( StaticText st ) + { + this.staticText20 = st; + } + private TextField txtSubstancias = new TextField(); - public void setGridDadosAcidenteSeg(HtmlPanelGrid hpg) { - this.gridDadosAcidenteSeg = hpg; - } + public TextField getTxtSubstancias() + { + return txtSubstancias; + } - private HtmlPanelGrid gridPanel8 = new HtmlPanelGrid(); + public void setTxtSubstancias( TextField tf ) + { + this.txtSubstancias = tf; + } + private HtmlPanelGrid gridPanel15 = new HtmlPanelGrid(); - public HtmlPanelGrid getGridPanel8() { - return gridPanel8; - } + public HtmlPanelGrid getGridPanel15() + { + return gridPanel15; + } - public void setGridPanel8(HtmlPanelGrid hpg) { - this.gridPanel8 = hpg; - } + public void setGridPanel15( HtmlPanelGrid hpg ) + { + this.gridPanel15 = hpg; + } + private StaticText staticText22 = new StaticText(); - private StaticText staticText13 = new StaticText(); + public StaticText getStaticText22() + { + return staticText22; + } - public StaticText getStaticText13() { - return staticText13; - } + public void setStaticText22( StaticText st ) + { + this.staticText22 = st; + } + private TextField txtCondicoes = new TextField(); - public void setStaticText13(StaticText st) { - this.staticText13 = st; - } + public TextField getTxtCondicoes() + { + return txtCondicoes; + } - private HtmlPanelGrid gridPanel9 = new HtmlPanelGrid(); + public void setTxtCondicoes( TextField tf ) + { + this.txtCondicoes = tf; + } + private HtmlPanelGrid gridPanel16 = new HtmlPanelGrid(); - public HtmlPanelGrid getGridPanel9() { - return gridPanel9; - } + public HtmlPanelGrid getGridPanel16() + { + return gridPanel16; + } - public void setGridPanel9(HtmlPanelGrid hpg) { - this.gridPanel9 = hpg; - } + public void setGridPanel16( HtmlPanelGrid hpg ) + { + this.gridPanel16 = hpg; + } + private StaticText staticText23 = new StaticText(); - private HtmlPanelGrid gridPanel11 = new HtmlPanelGrid(); + public StaticText getStaticText23() + { + return staticText23; + } - public HtmlPanelGrid getGridPanel11() { - return gridPanel11; - } + public void setStaticText23( StaticText st ) + { + this.staticText23 = st; + } + private TextField txtTestemunhas = new TextField(); - public void setGridPanel11(HtmlPanelGrid hpg) { - this.gridPanel11 = hpg; - } + public TextField getTxtTestemunhas() + { + return txtTestemunhas; + } - private PanelGroup groupPanel10 = new PanelGroup(); + public void setTxtTestemunhas( TextField tf ) + { + this.txtTestemunhas = tf; + } + private HtmlPanelGrid gridPanel17 = new HtmlPanelGrid(); - public PanelGroup getGroupPanel10() { - return groupPanel10; - } + public HtmlPanelGrid getGridPanel17() + { + return gridPanel17; + } - public void setGroupPanel10(PanelGroup pg) { - this.groupPanel10 = pg; - } + public void setGridPanel17( HtmlPanelGrid hpg ) + { + this.gridPanel17 = hpg; + } + private StaticText staticText24 = new StaticText(); - private StaticText staticText17 = new StaticText(); + public StaticText getStaticText24() + { + return staticText24; + } - public StaticText getStaticText17() { - return staticText17; - } + public void setStaticText24( StaticText st ) + { + this.staticText24 = st; + } + private HtmlPanelGrid gridPanel18 = new HtmlPanelGrid(); - public void setStaticText17(StaticText st) { - this.staticText17 = st; - } + public HtmlPanelGrid getGridPanel18() + { + return gridPanel18; + } - private PanelGroup groupPanel11 = new PanelGroup(); + public void setGridPanel18( HtmlPanelGrid hpg ) + { + this.gridPanel18 = hpg; + } + private StaticText staticText25 = new StaticText(); - public PanelGroup getGroupPanel11() { - return groupPanel11; - } + public StaticText getStaticText25() + { + return staticText25; + } - public void setGroupPanel11(PanelGroup pg) { - this.groupPanel11 = pg; - } + public void setStaticText25( StaticText st ) + { + this.staticText25 = st; + } + private TextField txtDescricao = new TextField(); - private StaticText staticText18 = new StaticText(); + public TextField getTxtDescricao() + { + return txtDescricao; + } - public StaticText getStaticText18() { - return staticText18; - } + public void setTxtDescricao( TextField tf ) + { + this.txtDescricao = tf; + } + private HtmlPanelGrid gridPanel19 = new HtmlPanelGrid(); - public void setStaticText18(StaticText st) { - this.staticText18 = st; - } + public HtmlPanelGrid getGridPanel19() + { + return gridPanel19; + } - private TextField txtLocal = new TextField(); + public void setGridPanel19( HtmlPanelGrid hpg ) + { + this.gridPanel19 = hpg; + } + private HtmlPanelGrid gridPanel20 = new HtmlPanelGrid(); - public TextField getTxtLocal() { - return txtLocal; - } + public HtmlPanelGrid getGridPanel20() + { + return gridPanel20; + } - public void setTxtLocal(TextField tf) { - this.txtLocal = tf; - } + public void setGridPanel20( HtmlPanelGrid hpg ) + { + this.gridPanel20 = hpg; + } + private StaticText staticText26 = new StaticText(); - private HtmlPanelGrid gridPanel12 = new HtmlPanelGrid(); + public StaticText getStaticText26() + { + return staticText26; + } - public HtmlPanelGrid getGridPanel12() { - return gridPanel12; - } + public void setStaticText26( StaticText st ) + { + this.staticText26 = st; + } + private Button butImagem = new Button(); - public void setGridPanel12(HtmlPanelGrid hpg) { - this.gridPanel12 = hpg; - } + public Button getButImagem() + { + return butImagem; + } - private StaticText staticText19 = new StaticText(); + public void setButImagem( Button b ) + { + this.butImagem = b; + } + private HtmlPanelGrid gridImages = new HtmlPanelGrid(); - public StaticText getStaticText19() { - return staticText19; - } + public HtmlPanelGrid getGridImages() + { + return gridImages; + } - public void setStaticText19(StaticText st) { - this.staticText19 = st; - } + public void setGridImages( HtmlPanelGrid hpg ) + { + this.gridImages = hpg; + } + private HtmlPanelGrid gridPanel21 = new HtmlPanelGrid(); - private TextField txtTarefa = new TextField(); + public HtmlPanelGrid getGridPanel21() + { + return gridPanel21; + } - public TextField getTxtTarefa() { - return txtTarefa; - } + public void setGridPanel21( HtmlPanelGrid hpg ) + { + this.gridPanel21 = hpg; + } + private StaticText staticText27 = new StaticText(); - public void setTxtTarefa(TextField tf) { - this.txtTarefa = tf; - } + public StaticText getStaticText27() + { + return staticText27; + } - private HtmlPanelGrid gridPanel13 = new HtmlPanelGrid(); + public void setStaticText27( StaticText st ) + { + this.staticText27 = st; + } + private TextArea txtConclusoes = new TextArea(); - public HtmlPanelGrid getGridPanel13() { - return gridPanel13; - } + public TextArea getTxtConclusoes() + { + return txtConclusoes; + } - public void setGridPanel13(HtmlPanelGrid hpg) { - this.gridPanel13 = hpg; - } + public void setTxtConclusoes( TextArea ta ) + { + this.txtConclusoes = ta; + } + private HtmlPanelGrid gridPanel26 = new HtmlPanelGrid(); - private StaticText staticText20 = new StaticText(); + public HtmlPanelGrid getGridPanel26() + { + return gridPanel26; + } - public StaticText getStaticText20() { - return staticText20; - } + public void setGridPanel26( HtmlPanelGrid hpg ) + { + this.gridPanel26 = hpg; + } + private StaticText staticText28 = new StaticText(); - public void setStaticText20(StaticText st) { - this.staticText20 = st; - } + public StaticText getStaticText28() + { + return staticText28; + } - private TextField txtSubstancias = new TextField(); + public void setStaticText28( StaticText st ) + { + this.staticText28 = st; + } + private TextArea txtAccoes = new TextArea(); - public TextField getTxtSubstancias() { - return txtSubstancias; - } + public TextArea getTxtAccoes() + { + return txtAccoes; + } - public void setTxtSubstancias(TextField tf) { - this.txtSubstancias = tf; - } + public void setTxtAccoes( TextArea ta ) + { + this.txtAccoes = ta; + } + private HtmlPanelGrid gridDadosAcidenteRh = new HtmlPanelGrid(); - private HtmlPanelGrid gridPanel15 = new HtmlPanelGrid(); + public HtmlPanelGrid getGridDadosAcidenteRh() + { + return gridDadosAcidenteRh; + } - public HtmlPanelGrid getGridPanel15() { - return gridPanel15; - } + public void setGridDadosAcidenteRh( HtmlPanelGrid hpg ) + { + this.gridDadosAcidenteRh = hpg; + } + private HtmlPanelGrid gridPanel27 = new HtmlPanelGrid(); - public void setGridPanel15(HtmlPanelGrid hpg) { - this.gridPanel15 = hpg; - } + public HtmlPanelGrid getGridPanel27() + { + return gridPanel27; + } - private StaticText staticText22 = new StaticText(); + public void setGridPanel27( HtmlPanelGrid hpg ) + { + this.gridPanel27 = hpg; + } + private StaticText staticText46 = new StaticText(); - public StaticText getStaticText22() { - return staticText22; - } + public StaticText getStaticText46() + { + return staticText46; + } - public void setStaticText22(StaticText st) { - this.staticText22 = st; - } + public void setStaticText46( StaticText st ) + { + this.staticText46 = st; + } + private HtmlPanelGrid gridPanel28 = new HtmlPanelGrid(); - private TextField txtCondicoes = new TextField(); + public HtmlPanelGrid getGridPanel28() + { + return gridPanel28; + } - public TextField getTxtCondicoes() { - return txtCondicoes; - } + public void setGridPanel28( HtmlPanelGrid hpg ) + { + this.gridPanel28 = hpg; + } + private HtmlPanelGrid gridPanel29 = new HtmlPanelGrid(); - public void setTxtCondicoes(TextField tf) { - this.txtCondicoes = tf; - } + public HtmlPanelGrid getGridPanel29() + { + return gridPanel29; + } - private HtmlPanelGrid gridPanel16 = new HtmlPanelGrid(); + public void setGridPanel29( HtmlPanelGrid hpg ) + { + this.gridPanel29 = hpg; + } + private StaticText staticText47 = new StaticText(); - public HtmlPanelGrid getGridPanel16() { - return gridPanel16; - } + public StaticText getStaticText47() + { + return staticText47; + } - public void setGridPanel16(HtmlPanelGrid hpg) { - this.gridPanel16 = hpg; - } + public void setStaticText47( StaticText st ) + { + this.staticText47 = st; + } + private HtmlPanelGrid gridPanel30 = new HtmlPanelGrid(); - private StaticText staticText23 = new StaticText(); + public HtmlPanelGrid getGridPanel30() + { + return gridPanel30; + } - public StaticText getStaticText23() { - return staticText23; - } + public void setGridPanel30( HtmlPanelGrid hpg ) + { + this.gridPanel30 = hpg; + } + private StaticText staticText48 = new StaticText(); - public void setStaticText23(StaticText st) { - this.staticText23 = st; - } + public StaticText getStaticText48() + { + return staticText48; + } - private TextField txtTestemunhas = new TextField(); + public void setStaticText48( StaticText st ) + { + this.staticText48 = st; + } + private HtmlPanelGrid gridPanel31 = new HtmlPanelGrid(); - public TextField getTxtTestemunhas() { - return txtTestemunhas; - } + public HtmlPanelGrid getGridPanel31() + { + return gridPanel31; + } - public void setTxtTestemunhas(TextField tf) { - this.txtTestemunhas = tf; - } + public void setGridPanel31( HtmlPanelGrid hpg ) + { + this.gridPanel31 = hpg; + } + private RadioButton rbFormacaoSHSTY = new RadioButton(); - private HtmlPanelGrid gridPanel17 = new HtmlPanelGrid(); + public RadioButton getRbFormacaoSHSTY() + { + return rbFormacaoSHSTY; + } - public HtmlPanelGrid getGridPanel17() { - return gridPanel17; - } + public void setRbFormacaoSHSTY( RadioButton rb ) + { + this.rbFormacaoSHSTY = rb; + } + private StaticText staticText49 = new StaticText(); - public void setGridPanel17(HtmlPanelGrid hpg) { - this.gridPanel17 = hpg; - } + public StaticText getStaticText49() + { + return staticText49; + } - private StaticText staticText24 = new StaticText(); + public void setStaticText49( StaticText st ) + { + this.staticText49 = st; + } + private HtmlPanelGrid gridPanel32 = new HtmlPanelGrid(); - public StaticText getStaticText24() { - return staticText24; - } + public HtmlPanelGrid getGridPanel32() + { + return gridPanel32; + } - public void setStaticText24(StaticText st) { - this.staticText24 = st; - } + public void setGridPanel32( HtmlPanelGrid hpg ) + { + this.gridPanel32 = hpg; + } + private StaticText staticText50 = new StaticText(); - private HtmlPanelGrid gridPanel18 = new HtmlPanelGrid(); + public StaticText getStaticText50() + { + return staticText50; + } - public HtmlPanelGrid getGridPanel18() { - return gridPanel18; - } + public void setStaticText50( StaticText st ) + { + this.staticText50 = st; + } + private HtmlPanelGrid gridPanel33 = new HtmlPanelGrid(); - public void setGridPanel18(HtmlPanelGrid hpg) { - this.gridPanel18 = hpg; - } + public HtmlPanelGrid getGridPanel33() + { + return gridPanel33; + } - private StaticText staticText25 = new StaticText(); + public void setGridPanel33( HtmlPanelGrid hpg ) + { + this.gridPanel33 = hpg; + } + private RadioButton rbFormacaoSHSTN = new RadioButton(); - public StaticText getStaticText25() { - return staticText25; - } + public RadioButton getRbFormacaoSHSTN() + { + return rbFormacaoSHSTN; + } - public void setStaticText25(StaticText st) { - this.staticText25 = st; - } + public void setRbFormacaoSHSTN( RadioButton rb ) + { + this.rbFormacaoSHSTN = rb; + } + private StaticText stFormacaoDummy = new StaticText(); - private TextField txtDescricao = new TextField(); + public StaticText getStFormacaoDummy() + { + return stFormacaoDummy; + } - public TextField getTxtDescricao() { - return txtDescricao; - } + public void setStFormacaoDummy( StaticText st ) + { + this.stFormacaoDummy = st; + } + private PanelGroup groupPanel12 = new PanelGroup(); - public void setTxtDescricao(TextField tf) { - this.txtDescricao = tf; - } + public PanelGroup getGroupPanel12() + { + return groupPanel12; + } - private HtmlPanelGrid gridPanel19 = new HtmlPanelGrid(); + public void setGroupPanel12( PanelGroup pg ) + { + this.groupPanel12 = pg; + } + private StaticText lblFormacaoSHSTNWhy = new StaticText(); - public HtmlPanelGrid getGridPanel19() { - return gridPanel19; - } + public StaticText getLblFormacaoSHSTNWhy() + { + return lblFormacaoSHSTNWhy; + } - public void setGridPanel19(HtmlPanelGrid hpg) { - this.gridPanel19 = hpg; - } + public void setLblFormacaoSHSTNWhy( StaticText st ) + { + this.lblFormacaoSHSTNWhy = st; + } + private TextField txtFormacaoSHSTNWhy = new TextField(); - private HtmlPanelGrid gridPanel20 = new HtmlPanelGrid(); + public TextField getTxtFormacaoSHSTNWhy() + { + return txtFormacaoSHSTNWhy; + } - public HtmlPanelGrid getGridPanel20() { - return gridPanel20; - } + public void setTxtFormacaoSHSTNWhy( TextField tf ) + { + this.txtFormacaoSHSTNWhy = tf; + } + private HtmlPanelGrid gridPanel34 = new HtmlPanelGrid(); - public void setGridPanel20(HtmlPanelGrid hpg) { - this.gridPanel20 = hpg; - } + public HtmlPanelGrid getGridPanel34() + { + return gridPanel34; + } - private StaticText staticText26 = new StaticText(); + public void setGridPanel34( HtmlPanelGrid hpg ) + { + this.gridPanel34 = hpg; + } + private StaticText staticText53 = new StaticText(); - public StaticText getStaticText26() { - return staticText26; - } + public StaticText getStaticText53() + { + return staticText53; + } - public void setStaticText26(StaticText st) { - this.staticText26 = st; - } + public void setStaticText53( StaticText st ) + { + this.staticText53 = st; + } + private HtmlPanelGrid gridPanel35 = new HtmlPanelGrid(); - private Button butImagem = new Button(); + public HtmlPanelGrid getGridPanel35() + { + return gridPanel35; + } - public Button getButImagem() { - return butImagem; - } + public void setGridPanel35( HtmlPanelGrid hpg ) + { + this.gridPanel35 = hpg; + } + private StaticText staticText54 = new StaticText(); - public void setButImagem(Button b) { - this.butImagem = b; - } + public StaticText getStaticText54() + { + return staticText54; + } - private HtmlPanelGrid gridImages = new HtmlPanelGrid(); + public void setStaticText54( StaticText st ) + { + this.staticText54 = st; + } + private HtmlPanelGrid gridPanel36 = new HtmlPanelGrid(); - public HtmlPanelGrid getGridImages() { - return gridImages; - } + public HtmlPanelGrid getGridPanel36() + { + return gridPanel36; + } - public void setGridImages(HtmlPanelGrid hpg) { - this.gridImages = hpg; - } + public void setGridPanel36( HtmlPanelGrid hpg ) + { + this.gridPanel36 = hpg; + } + private RadioButton rbAcidentesColaboradorY = new RadioButton(); - private HtmlPanelGrid gridPanel21 = new HtmlPanelGrid(); + public RadioButton getRbAcidentesColaboradorY() + { + return rbAcidentesColaboradorY; + } - public HtmlPanelGrid getGridPanel21() { - return gridPanel21; - } + public void setRbAcidentesColaboradorY( RadioButton rb ) + { + this.rbAcidentesColaboradorY = rb; + } + private StaticText staticText55 = new StaticText(); - public void setGridPanel21(HtmlPanelGrid hpg) { - this.gridPanel21 = hpg; - } + public StaticText getStaticText55() + { + return staticText55; + } - private StaticText staticText27 = new StaticText(); + public void setStaticText55( StaticText st ) + { + this.staticText55 = st; + } + private PanelGroup groupPanel13 = new PanelGroup(); - public StaticText getStaticText27() { - return staticText27; - } + public PanelGroup getGroupPanel13() + { + return groupPanel13; + } - public void setStaticText27(StaticText st) { - this.staticText27 = st; - } + public void setGroupPanel13( PanelGroup pg ) + { + this.groupPanel13 = pg; + } + private StaticText staticText56 = new StaticText(); - private TextArea txtConclusoes = new TextArea(); + public StaticText getStaticText56() + { + return staticText56; + } - public TextArea getTxtConclusoes() { - return txtConclusoes; - } + public void setStaticText56( StaticText st ) + { + this.staticText56 = st; + } + private TextField txtNrAcidentesColaborador = new TextField(); - public void setTxtConclusoes(TextArea ta) { - this.txtConclusoes = ta; - } + public TextField getTxtNrAcidentesColaborador() + { + return txtNrAcidentesColaborador; + } - private HtmlPanelGrid gridPanel26 = new HtmlPanelGrid(); + public void setTxtNrAcidentesColaborador( TextField tf ) + { + this.txtNrAcidentesColaborador = tf; + } + private HtmlPanelGrid gridPanel37 = new HtmlPanelGrid(); - public HtmlPanelGrid getGridPanel26() { - return gridPanel26; - } + public HtmlPanelGrid getGridPanel37() + { + return gridPanel37; + } - public void setGridPanel26(HtmlPanelGrid hpg) { - this.gridPanel26 = hpg; - } + public void setGridPanel37( HtmlPanelGrid hpg ) + { + this.gridPanel37 = hpg; + } + private StaticText staticText57 = new StaticText(); - private StaticText staticText28 = new StaticText(); + public StaticText getStaticText57() + { + return staticText57; + } - public StaticText getStaticText28() { - return staticText28; - } + public void setStaticText57( StaticText st ) + { + this.staticText57 = st; + } + private TextField txtNrRelatorioAcidentesColaborador1 = new TextField(); - public void setStaticText28(StaticText st) { - this.staticText28 = st; - } + public TextField getTxtNrRelatorioAcidentesColaborador1() + { + return txtNrRelatorioAcidentesColaborador1; + } - private TextArea txtAccoes = new TextArea(); + public void setTxtNrRelatorioAcidentesColaborador1( TextField tf ) + { + this.txtNrRelatorioAcidentesColaborador1 = tf; + } + private TextField txtNrRelatorioAcidentesColaborador2 = new TextField(); - public TextArea getTxtAccoes() { - return txtAccoes; - } + public TextField getTxtNrRelatorioAcidentesColaborador2() + { + return txtNrRelatorioAcidentesColaborador2; + } - public void setTxtAccoes(TextArea ta) { - this.txtAccoes = ta; - } + public void setTxtNrRelatorioAcidentesColaborador2( TextField tf ) + { + this.txtNrRelatorioAcidentesColaborador2 = tf; + } + private TextField txtNrRelatorioAcidentesColaborador3 = new TextField(); - private HtmlPanelGrid gridDadosAcidenteRh = new HtmlPanelGrid(); + public TextField getTxtNrRelatorioAcidentesColaborador3() + { + return txtNrRelatorioAcidentesColaborador3; + } - public HtmlPanelGrid getGridDadosAcidenteRh() { - return gridDadosAcidenteRh; - } + public void setTxtNrRelatorioAcidentesColaborador3( TextField tf ) + { + this.txtNrRelatorioAcidentesColaborador3 = tf; + } + private TextField txtNrRelatorioAcidentesColaborador4 = new TextField(); - public void setGridDadosAcidenteRh(HtmlPanelGrid hpg) { - this.gridDadosAcidenteRh = hpg; - } + public TextField getTxtNrRelatorioAcidentesColaborador4() + { + return txtNrRelatorioAcidentesColaborador4; + } - private HtmlPanelGrid gridPanel27 = new HtmlPanelGrid(); + public void setTxtNrRelatorioAcidentesColaborador4( TextField tf ) + { + this.txtNrRelatorioAcidentesColaborador4 = tf; + } + private HtmlPanelGrid gridPanel38 = new HtmlPanelGrid(); - public HtmlPanelGrid getGridPanel27() { - return gridPanel27; - } + public HtmlPanelGrid getGridPanel38() + { + return gridPanel38; + } - public void setGridPanel27(HtmlPanelGrid hpg) { - this.gridPanel27 = hpg; - } + public void setGridPanel38( HtmlPanelGrid hpg ) + { + this.gridPanel38 = hpg; + } + private StaticText staticText58 = new StaticText(); - private StaticText staticText46 = new StaticText(); + public StaticText getStaticText58() + { + return staticText58; + } - public StaticText getStaticText46() { - return staticText46; - } + public void setStaticText58( StaticText st ) + { + this.staticText58 = st; + } + private HtmlPanelGrid gridPanel39 = new HtmlPanelGrid(); - public void setStaticText46(StaticText st) { - this.staticText46 = st; - } + public HtmlPanelGrid getGridPanel39() + { + return gridPanel39; + } - private HtmlPanelGrid gridPanel28 = new HtmlPanelGrid(); + public void setGridPanel39( HtmlPanelGrid hpg ) + { + this.gridPanel39 = hpg; + } + private RadioButton rbAcidentesColaboradorN = new RadioButton(); - public HtmlPanelGrid getGridPanel28() { - return gridPanel28; - } + public RadioButton getRbAcidentesColaboradorN() + { + return rbAcidentesColaboradorN; + } - public void setGridPanel28(HtmlPanelGrid hpg) { - this.gridPanel28 = hpg; - } + public void setRbAcidentesColaboradorN( RadioButton rb ) + { + this.rbAcidentesColaboradorN = rb; + } + private StaticText staticText59 = new StaticText(); - private HtmlPanelGrid gridPanel29 = new HtmlPanelGrid(); + public StaticText getStaticText59() + { + return staticText59; + } - public HtmlPanelGrid getGridPanel29() { - return gridPanel29; - } + public void setStaticText59( StaticText st ) + { + this.staticText59 = st; + } + private HtmlPanelGrid gridPanel40 = new HtmlPanelGrid(); - public void setGridPanel29(HtmlPanelGrid hpg) { - this.gridPanel29 = hpg; - } + public HtmlPanelGrid getGridPanel40() + { + return gridPanel40; + } - private StaticText staticText47 = new StaticText(); + public void setGridPanel40( HtmlPanelGrid hpg ) + { + this.gridPanel40 = hpg; + } + private StaticText staticText60 = new StaticText(); - public StaticText getStaticText47() { - return staticText47; - } + public StaticText getStaticText60() + { + return staticText60; + } - public void setStaticText47(StaticText st) { - this.staticText47 = st; - } + public void setStaticText60( StaticText st ) + { + this.staticText60 = st; + } + private HtmlPanelGrid gridPanel41 = new HtmlPanelGrid(); - private HtmlPanelGrid gridPanel30 = new HtmlPanelGrid(); + public HtmlPanelGrid getGridPanel41() + { + return gridPanel41; + } - public HtmlPanelGrid getGridPanel30() { - return gridPanel30; - } + public void setGridPanel41( HtmlPanelGrid hpg ) + { + this.gridPanel41 = hpg; + } + private StaticText staticText61 = new StaticText(); - public void setGridPanel30(HtmlPanelGrid hpg) { - this.gridPanel30 = hpg; - } + public StaticText getStaticText61() + { + return staticText61; + } - private StaticText staticText48 = new StaticText(); + public void setStaticText61( StaticText st ) + { + this.staticText61 = st; + } + private HtmlPanelGrid gridPanel42 = new HtmlPanelGrid(); - public StaticText getStaticText48() { - return staticText48; - } + public HtmlPanelGrid getGridPanel42() + { + return gridPanel42; + } - public void setStaticText48(StaticText st) { - this.staticText48 = st; - } + public void setGridPanel42( HtmlPanelGrid hpg ) + { + this.gridPanel42 = hpg; + } + private RadioButton rbAcidentesColaboradoresY = new RadioButton(); - private HtmlPanelGrid gridPanel31 = new HtmlPanelGrid(); + public RadioButton getRbAcidentesColaboradoresY() + { + return rbAcidentesColaboradoresY; + } - public HtmlPanelGrid getGridPanel31() { - return gridPanel31; - } + public void setRbAcidentesColaboradoresY( RadioButton rb ) + { + this.rbAcidentesColaboradoresY = rb; + } + private StaticText staticText62 = new StaticText(); - public void setGridPanel31(HtmlPanelGrid hpg) { - this.gridPanel31 = hpg; - } + public StaticText getStaticText62() + { + return staticText62; + } - private RadioButton rbFormacaoSHSTY = new RadioButton(); + public void setStaticText62( StaticText st ) + { + this.staticText62 = st; + } + private PanelGroup groupPanel14 = new PanelGroup(); - public RadioButton getRbFormacaoSHSTY() { - return rbFormacaoSHSTY; - } + public PanelGroup getGroupPanel14() + { + return groupPanel14; + } - public void setRbFormacaoSHSTY(RadioButton rb) { - this.rbFormacaoSHSTY = rb; - } + public void setGroupPanel14( PanelGroup pg ) + { + this.groupPanel14 = pg; + } + private StaticText staticText63 = new StaticText(); - private StaticText staticText49 = new StaticText(); + public StaticText getStaticText63() + { + return staticText63; + } - public StaticText getStaticText49() { - return staticText49; - } + public void setStaticText63( StaticText st ) + { + this.staticText63 = st; + } + private TextField txtNrAcidentesColaboradores = new TextField(); - public void setStaticText49(StaticText st) { - this.staticText49 = st; - } + public TextField getTxtNrAcidentesColaboradores() + { + return txtNrAcidentesColaboradores; + } - private HtmlPanelGrid gridPanel32 = new HtmlPanelGrid(); + public void setTxtNrAcidentesColaboradores( TextField tf ) + { + this.txtNrAcidentesColaboradores = tf; + } + private HtmlPanelGrid gridPanel43 = new HtmlPanelGrid(); - public HtmlPanelGrid getGridPanel32() { - return gridPanel32; - } + public HtmlPanelGrid getGridPanel43() + { + return gridPanel43; + } - public void setGridPanel32(HtmlPanelGrid hpg) { - this.gridPanel32 = hpg; - } + public void setGridPanel43( HtmlPanelGrid hpg ) + { + this.gridPanel43 = hpg; + } + private StaticText staticText64 = new StaticText(); - private StaticText staticText50 = new StaticText(); + public StaticText getStaticText64() + { + return staticText64; + } - public StaticText getStaticText50() { - return staticText50; - } + public void setStaticText64( StaticText st ) + { + this.staticText64 = st; + } + private TextField txtNrRelatorioAcidentesColaboradores1 = new TextField(); - public void setStaticText50(StaticText st) { - this.staticText50 = st; - } + public TextField getTxtNrRelatorioAcidentesColaboradores1() + { + return txtNrRelatorioAcidentesColaboradores1; + } - private HtmlPanelGrid gridPanel33 = new HtmlPanelGrid(); + public void setTxtNrRelatorioAcidentesColaboradores1( TextField tf ) + { + this.txtNrRelatorioAcidentesColaboradores1 = tf; + } + private TextField txtNrRelatorioAcidentesColaboradores2 = new TextField(); - public HtmlPanelGrid getGridPanel33() { - return gridPanel33; - } + public TextField getTxtNrRelatorioAcidentesColaboradores2() + { + return txtNrRelatorioAcidentesColaboradores2; + } - public void setGridPanel33(HtmlPanelGrid hpg) { - this.gridPanel33 = hpg; - } + public void setTxtNrRelatorioAcidentesColaboradores2( TextField tf ) + { + this.txtNrRelatorioAcidentesColaboradores2 = tf; + } + private TextField txtNrRelatorioAcidentesColaboradores3 = new TextField(); - private RadioButton rbFormacaoSHSTN = new RadioButton(); + public TextField getTxtNrRelatorioAcidentesColaboradores3() + { + return txtNrRelatorioAcidentesColaboradores3; + } - public RadioButton getRbFormacaoSHSTN() { - return rbFormacaoSHSTN; - } + public void setTxtNrRelatorioAcidentesColaboradores3( TextField tf ) + { + this.txtNrRelatorioAcidentesColaboradores3 = tf; + } + private TextField txtNrRelatorioAcidentesColaboradores4 = new TextField(); - public void setRbFormacaoSHSTN(RadioButton rb) { - this.rbFormacaoSHSTN = rb; - } + public TextField getTxtNrRelatorioAcidentesColaboradores4() + { + return txtNrRelatorioAcidentesColaboradores4; + } - private StaticText stFormacaoDummy = new StaticText(); + public void setTxtNrRelatorioAcidentesColaboradores4( TextField tf ) + { + this.txtNrRelatorioAcidentesColaboradores4 = tf; + } + private HtmlPanelGrid gridPanel44 = new HtmlPanelGrid(); - public StaticText getStFormacaoDummy() { - return stFormacaoDummy; - } + public HtmlPanelGrid getGridPanel44() + { + return gridPanel44; + } - public void setStFormacaoDummy(StaticText st) { - this.stFormacaoDummy = st; - } + public void setGridPanel44( HtmlPanelGrid hpg ) + { + this.gridPanel44 = hpg; + } + private StaticText staticText65 = new StaticText(); - private PanelGroup groupPanel12 = new PanelGroup(); + public StaticText getStaticText65() + { + return staticText65; + } - public PanelGroup getGroupPanel12() { - return groupPanel12; - } + public void setStaticText65( StaticText st ) + { + this.staticText65 = st; + } + private HtmlPanelGrid gridPanel45 = new HtmlPanelGrid(); - public void setGroupPanel12(PanelGroup pg) { - this.groupPanel12 = pg; - } + public HtmlPanelGrid getGridPanel45() + { + return gridPanel45; + } - private StaticText lblFormacaoSHSTNWhy = new StaticText(); + public void setGridPanel45( HtmlPanelGrid hpg ) + { + this.gridPanel45 = hpg; + } + private RadioButton rbAcidentesColaboradoresN = new RadioButton(); - public StaticText getLblFormacaoSHSTNWhy() { - return lblFormacaoSHSTNWhy; - } + public RadioButton getRbAcidentesColaboradoresN() + { + return rbAcidentesColaboradoresN; + } - public void setLblFormacaoSHSTNWhy(StaticText st) { - this.lblFormacaoSHSTNWhy = st; - } + public void setRbAcidentesColaboradoresN( RadioButton rb ) + { + this.rbAcidentesColaboradoresN = rb; + } + private StaticText staticText66 = new StaticText(); - private TextField txtFormacaoSHSTNWhy = new TextField(); + public StaticText getStaticText66() + { + return staticText66; + } - public TextField getTxtFormacaoSHSTNWhy() { - return txtFormacaoSHSTNWhy; - } + public void setStaticText66( StaticText st ) + { + this.staticText66 = st; + } + private HtmlPanelGrid gridRecomendacoesHS = new HtmlPanelGrid(); - public void setTxtFormacaoSHSTNWhy(TextField tf) { - this.txtFormacaoSHSTNWhy = tf; - } + public HtmlPanelGrid getGridRecomendacoesHS() + { + return gridRecomendacoesHS; + } - private HtmlPanelGrid gridPanel34 = new HtmlPanelGrid(); + public void setGridRecomendacoesHS( HtmlPanelGrid hpg ) + { + this.gridRecomendacoesHS = hpg; + } + private HtmlPanelGrid gridPanel46 = new HtmlPanelGrid(); - public HtmlPanelGrid getGridPanel34() { - return gridPanel34; - } + public HtmlPanelGrid getGridPanel46() + { + return gridPanel46; + } - public void setGridPanel34(HtmlPanelGrid hpg) { - this.gridPanel34 = hpg; - } + public void setGridPanel46( HtmlPanelGrid hpg ) + { + this.gridPanel46 = hpg; + } + private StaticText staticText67 = new StaticText(); - private StaticText staticText53 = new StaticText(); + public StaticText getStaticText67() + { + return staticText67; + } - public StaticText getStaticText53() { - return staticText53; - } + public void setStaticText67( StaticText st ) + { + this.staticText67 = st; + } + private HtmlPanelGrid gridRecomendacoes = new HtmlPanelGrid(); - public void setStaticText53(StaticText st) { - this.staticText53 = st; - } + public HtmlPanelGrid getGridRecomendacoes() + { + return gridRecomendacoes; + } - private HtmlPanelGrid gridPanel35 = new HtmlPanelGrid(); + public void setGridRecomendacoes( HtmlPanelGrid hpg ) + { + this.gridRecomendacoes = hpg; + } + private HtmlPanelGrid gridPanel48 = new HtmlPanelGrid(); - public HtmlPanelGrid getGridPanel35() { - return gridPanel35; - } + public HtmlPanelGrid getGridPanel48() + { + return gridPanel48; + } - public void setGridPanel35(HtmlPanelGrid hpg) { - this.gridPanel35 = hpg; - } + public void setGridPanel48( HtmlPanelGrid hpg ) + { + this.gridPanel48 = hpg; + } + private StaticText stNrRecomendacao1 = new StaticText(); - private StaticText staticText54 = new StaticText(); + public StaticText getStNrRecomendacao1() + { + return stNrRecomendacao1; + } - public StaticText getStaticText54() { - return staticText54; - } + public void setStNrRecomendacao1( StaticText st ) + { + this.stNrRecomendacao1 = st; + } + private ImageHyperlink lnkMoreRec1 = new ImageHyperlink(); - public void setStaticText54(StaticText st) { - this.staticText54 = st; - } + public ImageHyperlink getLnkMoreRec1() + { + return lnkMoreRec1; + } - private HtmlPanelGrid gridPanel36 = new HtmlPanelGrid(); + public void setLnkMoreRec1( ImageHyperlink ih ) + { + this.lnkMoreRec1 = ih; + } + private Hyperlink lnkDelImageTmp = new Hyperlink(); - public HtmlPanelGrid getGridPanel36() { - return gridPanel36; - } + public Hyperlink getLnkDelImageTmp() + { + return lnkDelImageTmp; + } - public void setGridPanel36(HtmlPanelGrid hpg) { - this.gridPanel36 = hpg; - } + public void setLnkDelImageTmp( Hyperlink lnkDelImageTmp ) + { + this.lnkDelImageTmp = lnkDelImageTmp; + } + private HtmlPanelGrid gridSiprpView = new HtmlPanelGrid(); - private RadioButton rbAcidentesColaboradorY = new RadioButton(); + public HtmlPanelGrid getGridSiprpView() + { + return gridSiprpView; + } - public RadioButton getRbAcidentesColaboradorY() { - return rbAcidentesColaboradorY; - } + public void setGridSiprpView( HtmlPanelGrid hpg ) + { + this.gridSiprpView = hpg; + } + private HtmlPanelGrid gridPanel49 = new HtmlPanelGrid(); - public void setRbAcidentesColaboradorY(RadioButton rb) { - this.rbAcidentesColaboradorY = rb; - } + public HtmlPanelGrid getGridPanel49() + { + return gridPanel49; + } - private StaticText staticText55 = new StaticText(); + public void setGridPanel49( HtmlPanelGrid hpg ) + { + this.gridPanel49 = hpg; + } + private StaticText staticText69 = new StaticText(); - public StaticText getStaticText55() { - return staticText55; - } + public StaticText getStaticText69() + { + return staticText69; + } - public void setStaticText55(StaticText st) { - this.staticText55 = st; - } + public void setStaticText69( StaticText st ) + { + this.staticText69 = st; + } + private HtmlPanelGrid gridPanel50 = new HtmlPanelGrid(); - private PanelGroup groupPanel13 = new PanelGroup(); + public HtmlPanelGrid getGridPanel50() + { + return gridPanel50; + } - public PanelGroup getGroupPanel13() { - return groupPanel13; - } + public void setGridPanel50( HtmlPanelGrid hpg ) + { + this.gridPanel50 = hpg; + } + private HtmlPanelGrid gridPanel51 = new HtmlPanelGrid(); - public void setGroupPanel13(PanelGroup pg) { - this.groupPanel13 = pg; - } + public HtmlPanelGrid getGridPanel51() + { + return gridPanel51; + } - private StaticText staticText56 = new StaticText(); + public void setGridPanel51( HtmlPanelGrid hpg ) + { + this.gridPanel51 = hpg; + } + private HtmlPanelGrid gridAcidentadoView = new HtmlPanelGrid(); - public StaticText getStaticText56() { - return staticText56; - } + public HtmlPanelGrid getGridAcidentadoView() + { + return gridAcidentadoView; + } - public void setStaticText56(StaticText st) { - this.staticText56 = st; - } + public void setGridAcidentadoView( HtmlPanelGrid hpg ) + { + this.gridAcidentadoView = hpg; + } + private HtmlPanelGrid gridPanel52 = new HtmlPanelGrid(); - private TextField txtNrAcidentesColaborador = new TextField(); + public HtmlPanelGrid getGridPanel52() + { + return gridPanel52; + } - public TextField getTxtNrAcidentesColaborador() { - return txtNrAcidentesColaborador; - } + public void setGridPanel52( HtmlPanelGrid hpg ) + { + this.gridPanel52 = hpg; + } + private StaticText staticText78 = new StaticText(); - public void setTxtNrAcidentesColaborador(TextField tf) { - this.txtNrAcidentesColaborador = tf; - } + public StaticText getStaticText78() + { + return staticText78; + } - private HtmlPanelGrid gridPanel37 = new HtmlPanelGrid(); + public void setStaticText78( StaticText st ) + { + this.staticText78 = st; + } + private HtmlPanelGrid gridPanel53 = new HtmlPanelGrid(); - public HtmlPanelGrid getGridPanel37() { - return gridPanel37; - } + public HtmlPanelGrid getGridPanel53() + { + return gridPanel53; + } - public void setGridPanel37(HtmlPanelGrid hpg) { - this.gridPanel37 = hpg; - } + public void setGridPanel53( HtmlPanelGrid hpg ) + { + this.gridPanel53 = hpg; + } + private HtmlPanelGrid gridPanel54 = new HtmlPanelGrid(); - private StaticText staticText57 = new StaticText(); + public HtmlPanelGrid getGridPanel54() + { + return gridPanel54; + } - public StaticText getStaticText57() { - return staticText57; - } + public void setGridPanel54( HtmlPanelGrid hpg ) + { + this.gridPanel54 = hpg; + } + private HtmlPanelGrid gridDadosAcidenteRhView = new HtmlPanelGrid(); - public void setStaticText57(StaticText st) { - this.staticText57 = st; - } + public HtmlPanelGrid getGridDadosAcidenteRhView() + { + return gridDadosAcidenteRhView; + } - private TextField txtNrRelatorioAcidentesColaborador1 = new TextField(); + public void setGridDadosAcidenteRhView( HtmlPanelGrid hpg ) + { + this.gridDadosAcidenteRhView = hpg; + } + private HtmlPanelGrid gridPanel55 = new HtmlPanelGrid(); - public TextField getTxtNrRelatorioAcidentesColaborador1() { - return txtNrRelatorioAcidentesColaborador1; - } + public HtmlPanelGrid getGridPanel55() + { + return gridPanel55; + } - public void setTxtNrRelatorioAcidentesColaborador1(TextField tf) { - this.txtNrRelatorioAcidentesColaborador1 = tf; - } + public void setGridPanel55( HtmlPanelGrid hpg ) + { + this.gridPanel55 = hpg; + } + private StaticText staticText88 = new StaticText(); - private TextField txtNrRelatorioAcidentesColaborador2 = new TextField(); + public StaticText getStaticText88() + { + return staticText88; + } - public TextField getTxtNrRelatorioAcidentesColaborador2() { - return txtNrRelatorioAcidentesColaborador2; - } + public void setStaticText88( StaticText st ) + { + this.staticText88 = st; + } + private HtmlPanelGrid gridPanel56 = new HtmlPanelGrid(); - public void setTxtNrRelatorioAcidentesColaborador2(TextField tf) { - this.txtNrRelatorioAcidentesColaborador2 = tf; - } + public HtmlPanelGrid getGridPanel56() + { + return gridPanel56; + } - private TextField txtNrRelatorioAcidentesColaborador3 = new TextField(); + public void setGridPanel56( HtmlPanelGrid hpg ) + { + this.gridPanel56 = hpg; + } + private HtmlPanelGrid gridSHST = new HtmlPanelGrid(); - public TextField getTxtNrRelatorioAcidentesColaborador3() { - return txtNrRelatorioAcidentesColaborador3; - } + public HtmlPanelGrid getGridSHST() + { + return gridSHST; + } - public void setTxtNrRelatorioAcidentesColaborador3(TextField tf) { - this.txtNrRelatorioAcidentesColaborador3 = tf; - } + public void setGridSHST( HtmlPanelGrid hpg ) + { + this.gridSHST = hpg; + } + private HtmlPanelGrid gridColaborador = new HtmlPanelGrid(); - private TextField txtNrRelatorioAcidentesColaborador4 = new TextField(); + public HtmlPanelGrid getGridColaborador() + { + return gridColaborador; + } - public TextField getTxtNrRelatorioAcidentesColaborador4() { - return txtNrRelatorioAcidentesColaborador4; - } + public void setGridColaborador( HtmlPanelGrid hpg ) + { + this.gridColaborador = hpg; + } + private HtmlPanelGrid gridColaboradores = new HtmlPanelGrid(); - public void setTxtNrRelatorioAcidentesColaborador4(TextField tf) { - this.txtNrRelatorioAcidentesColaborador4 = tf; - } + public HtmlPanelGrid getGridColaboradores() + { + return gridColaboradores; + } - private HtmlPanelGrid gridPanel38 = new HtmlPanelGrid(); + public void setGridColaboradores( HtmlPanelGrid hpg ) + { + this.gridColaboradores = hpg; + } + private SingleSelectOptionsList drpHoursDefaultOptions = new SingleSelectOptionsList(); - public HtmlPanelGrid getGridPanel38() { - return gridPanel38; - } + public SingleSelectOptionsList getDrpHoursDefaultOptions() + { + return drpHoursDefaultOptions; + } - public void setGridPanel38(HtmlPanelGrid hpg) { - this.gridPanel38 = hpg; - } + public void setDrpHoursDefaultOptions( SingleSelectOptionsList ssol ) + { + this.drpHoursDefaultOptions = ssol; + } + private SingleSelectOptionsList drpMinutesDefaultOptions = new SingleSelectOptionsList(); - private StaticText staticText58 = new StaticText(); + public SingleSelectOptionsList getDrpMinutesDefaultOptions() + { + return drpMinutesDefaultOptions; + } - public StaticText getStaticText58() { - return staticText58; - } + public void setDrpMinutesDefaultOptions( SingleSelectOptionsList ssol ) + { + this.drpMinutesDefaultOptions = ssol; + } + private TextArea txtRecomendacao1 = new TextArea(); - public void setStaticText58(StaticText st) { - this.staticText58 = st; - } + public TextArea getTxtRecomendacao1() + { + return txtRecomendacao1; + } - private HtmlPanelGrid gridPanel39 = new HtmlPanelGrid(); + public void setTxtRecomendacao1( TextArea ta ) + { + this.txtRecomendacao1 = ta; + } + private HtmlPanelGrid gridRecomendacoesViewHS = new HtmlPanelGrid(); - public HtmlPanelGrid getGridPanel39() { - return gridPanel39; - } + public HtmlPanelGrid getGridRecomendacoesViewHS() + { + return gridRecomendacoesViewHS; + } - public void setGridPanel39(HtmlPanelGrid hpg) { - this.gridPanel39 = hpg; - } + public void setGridRecomendacoesViewHS( HtmlPanelGrid hpg ) + { + this.gridRecomendacoesViewHS = hpg; + } + private HtmlPanelGrid gridPanel47 = new HtmlPanelGrid(); - private RadioButton rbAcidentesColaboradorN = new RadioButton(); + public HtmlPanelGrid getGridPanel47() + { + return gridPanel47; + } - public RadioButton getRbAcidentesColaboradorN() { - return rbAcidentesColaboradorN; - } + public void setGridPanel47( HtmlPanelGrid hpg ) + { + this.gridPanel47 = hpg; + } + private StaticText staticText51 = new StaticText(); - public void setRbAcidentesColaboradorN(RadioButton rb) { - this.rbAcidentesColaboradorN = rb; - } + public StaticText getStaticText51() + { + return staticText51; + } - private StaticText staticText59 = new StaticText(); + public void setStaticText51( StaticText st ) + { + this.staticText51 = st; + } + private HtmlPanelGrid gridRecomendacoesView = new HtmlPanelGrid(); - public StaticText getStaticText59() { - return staticText59; - } + public HtmlPanelGrid getGridRecomendacoesView() + { + return gridRecomendacoesView; + } - public void setStaticText59(StaticText st) { - this.staticText59 = st; - } + public void setGridRecomendacoesView( HtmlPanelGrid hpg ) + { + this.gridRecomendacoesView = hpg; + } + private HtmlPanelGrid gridMedidasRH = new HtmlPanelGrid(); - private HtmlPanelGrid gridPanel40 = new HtmlPanelGrid(); + public HtmlPanelGrid getGridMedidasRH() + { + return gridMedidasRH; + } - public HtmlPanelGrid getGridPanel40() { - return gridPanel40; - } + public void setGridMedidasRH( HtmlPanelGrid hpg ) + { + this.gridMedidasRH = hpg; + } + private HtmlPanelGrid gridPanel57 = new HtmlPanelGrid(); - public void setGridPanel40(HtmlPanelGrid hpg) { - this.gridPanel40 = hpg; - } + public HtmlPanelGrid getGridPanel57() + { + return gridPanel57; + } - private StaticText staticText60 = new StaticText(); + public void setGridPanel57( HtmlPanelGrid hpg ) + { + this.gridPanel57 = hpg; + } + private StaticText staticText68 = new StaticText(); - public StaticText getStaticText60() { - return staticText60; - } + public StaticText getStaticText68() + { + return staticText68; + } - public void setStaticText60(StaticText st) { - this.staticText60 = st; - } + public void setStaticText68( StaticText st ) + { + this.staticText68 = st; + } + private HtmlPanelGrid gridMedidas = new HtmlPanelGrid(); - private HtmlPanelGrid gridPanel41 = new HtmlPanelGrid(); + public HtmlPanelGrid getGridMedidas() + { + return gridMedidas; + } - public HtmlPanelGrid getGridPanel41() { - return gridPanel41; - } + public void setGridMedidas( HtmlPanelGrid hpg ) + { + this.gridMedidas = hpg; + } + private HtmlPanelGrid gridPanel58 = new HtmlPanelGrid(); - public void setGridPanel41(HtmlPanelGrid hpg) { - this.gridPanel41 = hpg; - } + public HtmlPanelGrid getGridPanel58() + { + return gridPanel58; + } - private StaticText staticText61 = new StaticText(); + public void setGridPanel58( HtmlPanelGrid hpg ) + { + this.gridPanel58 = hpg; + } + private StaticText stNrMedida1 = new StaticText(); - public StaticText getStaticText61() { - return staticText61; - } + public StaticText getStNrMedida1() + { + return stNrMedida1; + } - public void setStaticText61(StaticText st) { - this.staticText61 = st; - } + public void setStNrMedida1( StaticText st ) + { + this.stNrMedida1 = st; + } + private TextArea txtMedida1 = new TextArea(); - private HtmlPanelGrid gridPanel42 = new HtmlPanelGrid(); + public TextArea getTxtMedida1() + { + return txtMedida1; + } - public HtmlPanelGrid getGridPanel42() { - return gridPanel42; - } + public void setTxtMedida1( TextArea ta ) + { + this.txtMedida1 = ta; + } + private ImageHyperlink lnkMoreMed1 = new ImageHyperlink(); - public void setGridPanel42(HtmlPanelGrid hpg) { - this.gridPanel42 = hpg; - } + public ImageHyperlink getLnkMoreMed1() + { + return lnkMoreMed1; + } - private RadioButton rbAcidentesColaboradoresY = new RadioButton(); + public void setLnkMoreMed1( ImageHyperlink ih ) + { + this.lnkMoreMed1 = ih; + } + private HtmlPanelGrid gridMedidasViewRH = new HtmlPanelGrid(); - public RadioButton getRbAcidentesColaboradoresY() { - return rbAcidentesColaboradoresY; - } + public HtmlPanelGrid getGridMedidasViewRH() + { + return gridMedidasViewRH; + } - public void setRbAcidentesColaboradoresY(RadioButton rb) { - this.rbAcidentesColaboradoresY = rb; - } + public void setGridMedidasViewRH( HtmlPanelGrid hpg ) + { + this.gridMedidasViewRH = hpg; + } + private HtmlPanelGrid gridPanel59 = new HtmlPanelGrid(); - private StaticText staticText62 = new StaticText(); + public HtmlPanelGrid getGridPanel59() + { + return gridPanel59; + } - public StaticText getStaticText62() { - return staticText62; - } + public void setGridPanel59( HtmlPanelGrid hpg ) + { + this.gridPanel59 = hpg; + } + private StaticText staticText89 = new StaticText(); - public void setStaticText62(StaticText st) { - this.staticText62 = st; - } + public StaticText getStaticText89() + { + return staticText89; + } - private PanelGroup groupPanel14 = new PanelGroup(); + public void setStaticText89( StaticText st ) + { + this.staticText89 = st; + } + private HtmlPanelGrid gridMedidasView = new HtmlPanelGrid(); - public PanelGroup getGroupPanel14() { - return groupPanel14; - } + public HtmlPanelGrid getGridMedidasView() + { + return gridMedidasView; + } - public void setGroupPanel14(PanelGroup pg) { - this.groupPanel14 = pg; - } + public void setGridMedidasView( HtmlPanelGrid hpg ) + { + this.gridMedidasView = hpg; + } + private HtmlPanelGrid gridMedico = new HtmlPanelGrid(); - private StaticText staticText63 = new StaticText(); + public HtmlPanelGrid getGridMedico() + { + return gridMedico; + } - public StaticText getStaticText63() { - return staticText63; - } + public void setGridMedico( HtmlPanelGrid hpg ) + { + this.gridMedico = hpg; + } + private HtmlPanelGrid gridPanel60 = new HtmlPanelGrid(); - public void setStaticText63(StaticText st) { - this.staticText63 = st; - } + public HtmlPanelGrid getGridPanel60() + { + return gridPanel60; + } - private TextField txtNrAcidentesColaboradores = new TextField(); + public void setGridPanel60( HtmlPanelGrid hpg ) + { + this.gridPanel60 = hpg; + } + private StaticText staticText90 = new StaticText(); - public TextField getTxtNrAcidentesColaboradores() { - return txtNrAcidentesColaboradores; - } + public StaticText getStaticText90() + { + return staticText90; + } - public void setTxtNrAcidentesColaboradores(TextField tf) { - this.txtNrAcidentesColaboradores = tf; - } + public void setStaticText90( StaticText st ) + { + this.staticText90 = st; + } + private HtmlPanelGrid gridLesao1 = new HtmlPanelGrid(); - private HtmlPanelGrid gridPanel43 = new HtmlPanelGrid(); + public HtmlPanelGrid getGridLesao1() + { + return gridLesao1; + } - public HtmlPanelGrid getGridPanel43() { - return gridPanel43; - } + public void setGridLesao1( HtmlPanelGrid hpg ) + { + this.gridLesao1 = hpg; + } + private StaticText staticText91 = new StaticText(); - public void setGridPanel43(HtmlPanelGrid hpg) { - this.gridPanel43 = hpg; - } + public StaticText getStaticText91() + { + return staticText91; + } - private StaticText staticText64 = new StaticText(); + public void setStaticText91( StaticText st ) + { + this.staticText91 = st; + } + private HtmlPanelGrid gridPanel61 = new HtmlPanelGrid(); - public StaticText getStaticText64() { - return staticText64; - } + public HtmlPanelGrid getGridPanel61() + { + return gridPanel61; + } - public void setStaticText64(StaticText st) { - this.staticText64 = st; - } + public void setGridPanel61( HtmlPanelGrid hpg ) + { + this.gridPanel61 = hpg; + } + private PanelGroup groupPanel17 = new PanelGroup(); - private TextField txtNrRelatorioAcidentesColaboradores1 = new TextField(); + public PanelGroup getGroupPanel17() + { + return groupPanel17; + } - public TextField getTxtNrRelatorioAcidentesColaboradores1() { - return txtNrRelatorioAcidentesColaboradores1; - } + public void setGroupPanel17( PanelGroup pg ) + { + this.groupPanel17 = pg; + } + private Checkbox chkCabeca = new Checkbox(); - public void setTxtNrRelatorioAcidentesColaboradores1(TextField tf) { - this.txtNrRelatorioAcidentesColaboradores1 = tf; - } + public Checkbox getChkCabeca() + { + return chkCabeca; + } - private TextField txtNrRelatorioAcidentesColaboradores2 = new TextField(); + public void setChkCabeca( Checkbox c ) + { + this.chkCabeca = c; + } + private StaticText staticText93 = new StaticText(); - public TextField getTxtNrRelatorioAcidentesColaboradores2() { - return txtNrRelatorioAcidentesColaboradores2; - } + public StaticText getStaticText93() + { + return staticText93; + } - public void setTxtNrRelatorioAcidentesColaboradores2(TextField tf) { - this.txtNrRelatorioAcidentesColaboradores2 = tf; - } + public void setStaticText93( StaticText st ) + { + this.staticText93 = st; + } + private PanelGroup groupPanel18 = new PanelGroup(); - private TextField txtNrRelatorioAcidentesColaboradores3 = new TextField(); + public PanelGroup getGroupPanel18() + { + return groupPanel18; + } - public TextField getTxtNrRelatorioAcidentesColaboradores3() { - return txtNrRelatorioAcidentesColaboradores3; - } + public void setGroupPanel18( PanelGroup pg ) + { + this.groupPanel18 = pg; + } + private Checkbox chkMembroSupDir = new Checkbox(); - public void setTxtNrRelatorioAcidentesColaboradores3(TextField tf) { - this.txtNrRelatorioAcidentesColaboradores3 = tf; - } + public Checkbox getChkMembroSupDir() + { + return chkMembroSupDir; + } - private TextField txtNrRelatorioAcidentesColaboradores4 = new TextField(); + public void setChkMembroSupDir( Checkbox c ) + { + this.chkMembroSupDir = c; + } + private StaticText staticText94 = new StaticText(); - public TextField getTxtNrRelatorioAcidentesColaboradores4() { - return txtNrRelatorioAcidentesColaboradores4; - } + public StaticText getStaticText94() + { + return staticText94; + } - public void setTxtNrRelatorioAcidentesColaboradores4(TextField tf) { - this.txtNrRelatorioAcidentesColaboradores4 = tf; - } + public void setStaticText94( StaticText st ) + { + this.staticText94 = st; + } + private HtmlPanelGrid gridPanel62 = new HtmlPanelGrid(); - private HtmlPanelGrid gridPanel44 = new HtmlPanelGrid(); + public HtmlPanelGrid getGridPanel62() + { + return gridPanel62; + } - public HtmlPanelGrid getGridPanel44() { - return gridPanel44; - } + public void setGridPanel62( HtmlPanelGrid hpg ) + { + this.gridPanel62 = hpg; + } + private StaticText lblEspecif1 = new StaticText(); - public void setGridPanel44(HtmlPanelGrid hpg) { - this.gridPanel44 = hpg; - } + public StaticText getLblEspecif1() + { + return lblEspecif1; + } - private StaticText staticText65 = new StaticText(); + public void setLblEspecif1( StaticText st ) + { + this.lblEspecif1 = st; + } + private TextField txtEspecif1 = new TextField(); - public StaticText getStaticText65() { - return staticText65; - } + public TextField getTxtEspecif1() + { + return txtEspecif1; + } - public void setStaticText65(StaticText st) { - this.staticText65 = st; - } + public void setTxtEspecif1( TextField tf ) + { + this.txtEspecif1 = tf; + } + private PanelGroup groupPanel19 = new PanelGroup(); - private HtmlPanelGrid gridPanel45 = new HtmlPanelGrid(); + public PanelGroup getGroupPanel19() + { + return groupPanel19; + } - public HtmlPanelGrid getGridPanel45() { - return gridPanel45; - } + public void setGroupPanel19( PanelGroup pg ) + { + this.groupPanel19 = pg; + } + private Checkbox chkPescoco = new Checkbox(); - public void setGridPanel45(HtmlPanelGrid hpg) { - this.gridPanel45 = hpg; - } + public Checkbox getChkPescoco() + { + return chkPescoco; + } - private RadioButton rbAcidentesColaboradoresN = new RadioButton(); + public void setChkPescoco( Checkbox c ) + { + this.chkPescoco = c; + } + private StaticText staticText96 = new StaticText(); - public RadioButton getRbAcidentesColaboradoresN() { - return rbAcidentesColaboradoresN; - } + public StaticText getStaticText96() + { + return staticText96; + } - public void setRbAcidentesColaboradoresN(RadioButton rb) { - this.rbAcidentesColaboradoresN = rb; - } + public void setStaticText96( StaticText st ) + { + this.staticText96 = st; + } + private PanelGroup groupPanel20 = new PanelGroup(); - private StaticText staticText66 = new StaticText(); + public PanelGroup getGroupPanel20() + { + return groupPanel20; + } - public StaticText getStaticText66() { - return staticText66; - } + public void setGroupPanel20( PanelGroup pg ) + { + this.groupPanel20 = pg; + } + private Checkbox chkMembroSupEsq = new Checkbox(); - public void setStaticText66(StaticText st) { - this.staticText66 = st; - } + public Checkbox getChkMembroSupEsq() + { + return chkMembroSupEsq; + } - private HtmlPanelGrid gridRecomendacoesHS = new HtmlPanelGrid(); + public void setChkMembroSupEsq( Checkbox c ) + { + this.chkMembroSupEsq = c; + } + private StaticText staticText97 = new StaticText(); - public HtmlPanelGrid getGridRecomendacoesHS() { - return gridRecomendacoesHS; - } + public StaticText getStaticText97() + { + return staticText97; + } - public void setGridRecomendacoesHS(HtmlPanelGrid hpg) { - this.gridRecomendacoesHS = hpg; - } + public void setStaticText97( StaticText st ) + { + this.staticText97 = st; + } + private HtmlPanelGrid gridPanel63 = new HtmlPanelGrid(); - private HtmlPanelGrid gridPanel46 = new HtmlPanelGrid(); + public HtmlPanelGrid getGridPanel63() + { + return gridPanel63; + } - public HtmlPanelGrid getGridPanel46() { - return gridPanel46; - } + public void setGridPanel63( HtmlPanelGrid hpg ) + { + this.gridPanel63 = hpg; + } + private StaticText lblEspecif2 = new StaticText(); - public void setGridPanel46(HtmlPanelGrid hpg) { - this.gridPanel46 = hpg; - } + public StaticText getLblEspecif2() + { + return lblEspecif2; + } - private StaticText staticText67 = new StaticText(); + public void setLblEspecif2( StaticText st ) + { + this.lblEspecif2 = st; + } + private TextField txtEspecif2 = new TextField(); - public StaticText getStaticText67() { - return staticText67; - } + public TextField getTxtEspecif2() + { + return txtEspecif2; + } - public void setStaticText67(StaticText st) { - this.staticText67 = st; - } + public void setTxtEspecif2( TextField tf ) + { + this.txtEspecif2 = tf; + } + private PanelGroup groupPanel21 = new PanelGroup(); - private HtmlPanelGrid gridRecomendacoes = new HtmlPanelGrid(); + public PanelGroup getGroupPanel21() + { + return groupPanel21; + } - public HtmlPanelGrid getGridRecomendacoes() { - return gridRecomendacoes; - } + public void setGroupPanel21( PanelGroup pg ) + { + this.groupPanel21 = pg; + } + private Checkbox chkTronco = new Checkbox(); - public void setGridRecomendacoes(HtmlPanelGrid hpg) { - this.gridRecomendacoes = hpg; - } + public Checkbox getChkTronco() + { + return chkTronco; + } - private HtmlPanelGrid gridPanel48 = new HtmlPanelGrid(); + public void setChkTronco( Checkbox c ) + { + this.chkTronco = c; + } + private StaticText staticText99 = new StaticText(); - public HtmlPanelGrid getGridPanel48() { - return gridPanel48; - } + public StaticText getStaticText99() + { + return staticText99; + } - public void setGridPanel48(HtmlPanelGrid hpg) { - this.gridPanel48 = hpg; - } + public void setStaticText99( StaticText st ) + { + this.staticText99 = st; + } + private PanelGroup groupPanel22 = new PanelGroup(); - private StaticText stNrRecomendacao1 = new StaticText(); + public PanelGroup getGroupPanel22() + { + return groupPanel22; + } - public StaticText getStNrRecomendacao1() { - return stNrRecomendacao1; - } + public void setGroupPanel22( PanelGroup pg ) + { + this.groupPanel22 = pg; + } + private Checkbox chkMembroInfDir = new Checkbox(); - public void setStNrRecomendacao1(StaticText st) { - this.stNrRecomendacao1 = st; - } + public Checkbox getChkMembroInfDir() + { + return chkMembroInfDir; + } - private ImageHyperlink lnkMoreRec1 = new ImageHyperlink(); + public void setChkMembroInfDir( Checkbox c ) + { + this.chkMembroInfDir = c; + } + private StaticText staticText100 = new StaticText(); - public ImageHyperlink getLnkMoreRec1() { - return lnkMoreRec1; - } + public StaticText getStaticText100() + { + return staticText100; + } - public void setLnkMoreRec1(ImageHyperlink ih) { - this.lnkMoreRec1 = ih; - } - - private Hyperlink lnkDelImageTmp = new Hyperlink(); + public void setStaticText100( StaticText st ) + { + this.staticText100 = st; + } + private HtmlPanelGrid gridPanel64 = new HtmlPanelGrid(); - public Hyperlink getLnkDelImageTmp() { - return lnkDelImageTmp; - } + public HtmlPanelGrid getGridPanel64() + { + return gridPanel64; + } - public void setLnkDelImageTmp(Hyperlink lnkDelImageTmp) { - this.lnkDelImageTmp = lnkDelImageTmp; - } + public void setGridPanel64( HtmlPanelGrid hpg ) + { + this.gridPanel64 = hpg; + } + private StaticText lblEspecif3 = new StaticText(); - private HtmlPanelGrid gridSiprpView = new HtmlPanelGrid(); + public StaticText getLblEspecif3() + { + return lblEspecif3; + } - public HtmlPanelGrid getGridSiprpView() { - return gridSiprpView; - } + public void setLblEspecif3( StaticText st ) + { + this.lblEspecif3 = st; + } + private TextField txtEspecif3 = new TextField(); - public void setGridSiprpView(HtmlPanelGrid hpg) { - this.gridSiprpView = hpg; - } + public TextField getTxtEspecif3() + { + return txtEspecif3; + } - private HtmlPanelGrid gridPanel49 = new HtmlPanelGrid(); + public void setTxtEspecif3( TextField tf ) + { + this.txtEspecif3 = tf; + } + private StaticText staticText102 = new StaticText(); - public HtmlPanelGrid getGridPanel49() { - return gridPanel49; - } + public StaticText getStaticText102() + { + return staticText102; + } - public void setGridPanel49(HtmlPanelGrid hpg) { - this.gridPanel49 = hpg; - } + public void setStaticText102( StaticText st ) + { + this.staticText102 = st; + } + private PanelGroup groupPanel23 = new PanelGroup(); - private StaticText staticText69 = new StaticText(); + public PanelGroup getGroupPanel23() + { + return groupPanel23; + } - public StaticText getStaticText69() { - return staticText69; - } + public void setGroupPanel23( PanelGroup pg ) + { + this.groupPanel23 = pg; + } + private Checkbox chkMembroInfEsq = new Checkbox(); - public void setStaticText69(StaticText st) { - this.staticText69 = st; - } + public Checkbox getChkMembroInfEsq() + { + return chkMembroInfEsq; + } - private HtmlPanelGrid gridPanel50 = new HtmlPanelGrid(); + public void setChkMembroInfEsq( Checkbox c ) + { + this.chkMembroInfEsq = c; + } + private StaticText staticText103 = new StaticText(); - public HtmlPanelGrid getGridPanel50() { - return gridPanel50; - } + public StaticText getStaticText103() + { + return staticText103; + } - public void setGridPanel50(HtmlPanelGrid hpg) { - this.gridPanel50 = hpg; - } + public void setStaticText103( StaticText st ) + { + this.staticText103 = st; + } + private HtmlPanelGrid gridPanel65 = new HtmlPanelGrid(); - private HtmlPanelGrid gridPanel51 = new HtmlPanelGrid(); + public HtmlPanelGrid getGridPanel65() + { + return gridPanel65; + } - public HtmlPanelGrid getGridPanel51() { - return gridPanel51; - } + public void setGridPanel65( HtmlPanelGrid hpg ) + { + this.gridPanel65 = hpg; + } + private StaticText lblEspecif4 = new StaticText(); - public void setGridPanel51(HtmlPanelGrid hpg) { - this.gridPanel51 = hpg; - } + public StaticText getLblEspecif4() + { + return lblEspecif4; + } - private HtmlPanelGrid gridAcidentadoView = new HtmlPanelGrid(); + public void setLblEspecif4( StaticText st ) + { + this.lblEspecif4 = st; + } + private TextField txtEspecif4 = new TextField(); - public HtmlPanelGrid getGridAcidentadoView() { - return gridAcidentadoView; - } + public TextField getTxtEspecif4() + { + return txtEspecif4; + } - public void setGridAcidentadoView(HtmlPanelGrid hpg) { - this.gridAcidentadoView = hpg; - } + public void setTxtEspecif4( TextField tf ) + { + this.txtEspecif4 = tf; + } + private HtmlPanelGrid gridPanel66 = new HtmlPanelGrid(); - private HtmlPanelGrid gridPanel52 = new HtmlPanelGrid(); + public HtmlPanelGrid getGridPanel66() + { + return gridPanel66; + } - public HtmlPanelGrid getGridPanel52() { - return gridPanel52; - } + public void setGridPanel66( HtmlPanelGrid hpg ) + { + this.gridPanel66 = hpg; + } + private StaticText staticText105 = new StaticText(); - public void setGridPanel52(HtmlPanelGrid hpg) { - this.gridPanel52 = hpg; - } + public StaticText getStaticText105() + { + return staticText105; + } - private StaticText staticText78 = new StaticText(); + public void setStaticText105( StaticText st ) + { + this.staticText105 = st; + } + private TextField txtTipoLesao = new TextField(); - public StaticText getStaticText78() { - return staticText78; - } + public TextField getTxtTipoLesao() + { + return txtTipoLesao; + } - public void setStaticText78(StaticText st) { - this.staticText78 = st; - } + public void setTxtTipoLesao( TextField tf ) + { + this.txtTipoLesao = tf; + } + private HtmlPanelGrid gridPanel67 = new HtmlPanelGrid(); - private HtmlPanelGrid gridPanel53 = new HtmlPanelGrid(); + public HtmlPanelGrid getGridPanel67() + { + return gridPanel67; + } - public HtmlPanelGrid getGridPanel53() { - return gridPanel53; - } + public void setGridPanel67( HtmlPanelGrid hpg ) + { + this.gridPanel67 = hpg; + } + private StaticText staticText106 = new StaticText(); - public void setGridPanel53(HtmlPanelGrid hpg) { - this.gridPanel53 = hpg; - } + public StaticText getStaticText106() + { + return staticText106; + } - private HtmlPanelGrid gridPanel54 = new HtmlPanelGrid(); + public void setStaticText106( StaticText st ) + { + this.staticText106 = st; + } + private HtmlPanelGrid gridIncapacidade1 = new HtmlPanelGrid(); - public HtmlPanelGrid getGridPanel54() { - return gridPanel54; - } + public HtmlPanelGrid getGridIncapacidade1() + { + return gridIncapacidade1; + } - public void setGridPanel54(HtmlPanelGrid hpg) { - this.gridPanel54 = hpg; - } + public void setGridIncapacidade1( HtmlPanelGrid hpg ) + { + this.gridIncapacidade1 = hpg; + } + private HtmlPanelGrid gridPanel68 = new HtmlPanelGrid(); - private HtmlPanelGrid gridDadosAcidenteRhView = new HtmlPanelGrid(); + public HtmlPanelGrid getGridPanel68() + { + return gridPanel68; + } - public HtmlPanelGrid getGridDadosAcidenteRhView() { - return gridDadosAcidenteRhView; - } + public void setGridPanel68( HtmlPanelGrid hpg ) + { + this.gridPanel68 = hpg; + } + private PanelGroup groupPanel24 = new PanelGroup(); - public void setGridDadosAcidenteRhView(HtmlPanelGrid hpg) { - this.gridDadosAcidenteRhView = hpg; - } + public PanelGroup getGroupPanel24() + { + return groupPanel24; + } - private HtmlPanelGrid gridPanel55 = new HtmlPanelGrid(); + public void setGroupPanel24( PanelGroup pg ) + { + this.groupPanel24 = pg; + } + private StaticText staticText107 = new StaticText(); - public HtmlPanelGrid getGridPanel55() { - return gridPanel55; - } + public StaticText getStaticText107() + { + return staticText107; + } - public void setGridPanel55(HtmlPanelGrid hpg) { - this.gridPanel55 = hpg; - } + public void setStaticText107( StaticText st ) + { + this.staticText107 = st; + } + private RadioButton rbIncapacidadeNone = new RadioButton(); - private StaticText staticText88 = new StaticText(); + public RadioButton getRbIncapacidadeNone() + { + return rbIncapacidadeNone; + } - public StaticText getStaticText88() { - return staticText88; - } + public void setRbIncapacidadeNone( RadioButton rb ) + { + this.rbIncapacidadeNone = rb; + } + private StaticText staticText108 = new StaticText(); - public void setStaticText88(StaticText st) { - this.staticText88 = st; - } + public StaticText getStaticText108() + { + return staticText108; + } - private HtmlPanelGrid gridPanel56 = new HtmlPanelGrid(); + public void setStaticText108( StaticText st ) + { + this.staticText108 = st; + } + private RadioButton rbIncapacidadeTemp = new RadioButton(); - public HtmlPanelGrid getGridPanel56() { - return gridPanel56; - } + public RadioButton getRbIncapacidadeTemp() + { + return rbIncapacidadeTemp; + } - public void setGridPanel56(HtmlPanelGrid hpg) { - this.gridPanel56 = hpg; - } + public void setRbIncapacidadeTemp( RadioButton rb ) + { + this.rbIncapacidadeTemp = rb; + } + private StaticText staticText109 = new StaticText(); - private HtmlPanelGrid gridSHST = new HtmlPanelGrid(); + public StaticText getStaticText109() + { + return staticText109; + } - public HtmlPanelGrid getGridSHST() { - return gridSHST; - } + public void setStaticText109( StaticText st ) + { + this.staticText109 = st; + } + private PanelGroup groupPanel25 = new PanelGroup(); - public void setGridSHST(HtmlPanelGrid hpg) { - this.gridSHST = hpg; - } + public PanelGroup getGroupPanel25() + { + return groupPanel25; + } - private HtmlPanelGrid gridColaborador = new HtmlPanelGrid(); + public void setGroupPanel25( PanelGroup pg ) + { + this.groupPanel25 = pg; + } + private StaticText staticText110 = new StaticText(); - public HtmlPanelGrid getGridColaborador() { - return gridColaborador; - } + public StaticText getStaticText110() + { + return staticText110; + } - public void setGridColaborador(HtmlPanelGrid hpg) { - this.gridColaborador = hpg; - } + public void setStaticText110( StaticText st ) + { + this.staticText110 = st; + } + private TextField txtCoefIncapacidade = new TextField(); - private HtmlPanelGrid gridColaboradores = new HtmlPanelGrid(); + public TextField getTxtCoefIncapacidade() + { + return txtCoefIncapacidade; + } - public HtmlPanelGrid getGridColaboradores() { - return gridColaboradores; - } + public void setTxtCoefIncapacidade( TextField tf ) + { + this.txtCoefIncapacidade = tf; + } + private StaticText staticText111 = new StaticText(); - public void setGridColaboradores(HtmlPanelGrid hpg) { - this.gridColaboradores = hpg; - } + public StaticText getStaticText111() + { + return staticText111; + } - private SingleSelectOptionsList drpHoursDefaultOptions = new SingleSelectOptionsList(); + public void setStaticText111( StaticText st ) + { + this.staticText111 = st; + } + private HtmlPanelGrid gridPanel69 = new HtmlPanelGrid(); - public SingleSelectOptionsList getDrpHoursDefaultOptions() { - return drpHoursDefaultOptions; - } + public HtmlPanelGrid getGridPanel69() + { + return gridPanel69; + } - public void setDrpHoursDefaultOptions(SingleSelectOptionsList ssol) { - this.drpHoursDefaultOptions = ssol; - } + public void setGridPanel69( HtmlPanelGrid hpg ) + { + this.gridPanel69 = hpg; + } + private StaticText staticText112 = new StaticText(); - private SingleSelectOptionsList drpMinutesDefaultOptions = new SingleSelectOptionsList(); + public StaticText getStaticText112() + { + return staticText112; + } - public SingleSelectOptionsList getDrpMinutesDefaultOptions() { - return drpMinutesDefaultOptions; - } + 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 void setDrpMinutesDefaultOptions(SingleSelectOptionsList ssol) { - this.drpMinutesDefaultOptions = ssol; - } + public com.sun.rave.web.ui.component.Calendar getCalAvaliacaoIncap() + { + return calAvaliacaoIncap; + } - private TextArea txtRecomendacao1 = new TextArea(); + public void setCalAvaliacaoIncap( com.sun.rave.web.ui.component.Calendar c ) + { + this.calAvaliacaoIncap = c; + } + private StaticText staticText113 = new StaticText(); - public TextArea getTxtRecomendacao1() { - return txtRecomendacao1; - } + public StaticText getStaticText113() + { + return staticText113; + } - public void setTxtRecomendacao1(TextArea ta) { - this.txtRecomendacao1 = ta; - } + 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(); - private HtmlPanelGrid gridRecomendacoesViewHS = new HtmlPanelGrid(); + public com.sun.rave.web.ui.component.Calendar getCalRevisaoIncap() + { + return calRevisaoIncap; + } - public HtmlPanelGrid getGridRecomendacoesViewHS() { - return gridRecomendacoesViewHS; - } + public void setCalRevisaoIncap( com.sun.rave.web.ui.component.Calendar c ) + { + this.calRevisaoIncap = c; + } + private HtmlPanelGrid gridPanel70 = new HtmlPanelGrid(); - public void setGridRecomendacoesViewHS(HtmlPanelGrid hpg) { - this.gridRecomendacoesViewHS = hpg; - } + public HtmlPanelGrid getGridPanel70() + { + return gridPanel70; + } - private HtmlPanelGrid gridPanel47 = new HtmlPanelGrid(); + public void setGridPanel70( HtmlPanelGrid hpg ) + { + this.gridPanel70 = hpg; + } + private StaticText staticText114 = new StaticText(); - public HtmlPanelGrid getGridPanel47() { - return gridPanel47; - } + public StaticText getStaticText114() + { + return staticText114; + } - public void setGridPanel47(HtmlPanelGrid hpg) { - this.gridPanel47 = hpg; - } + 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(); - private StaticText staticText51 = new StaticText(); + public com.sun.rave.web.ui.component.Calendar getCalPeridoIncapDe() + { + return calPeridoIncapDe; + } - public StaticText getStaticText51() { - return staticText51; - } + public void setCalPeridoIncapDe( com.sun.rave.web.ui.component.Calendar c ) + { + this.calPeridoIncapDe = c; + } + private StaticText staticText115 = new StaticText(); - public void setStaticText51(StaticText st) { - this.staticText51 = st; - } + public StaticText getStaticText115() + { + return staticText115; + } - private HtmlPanelGrid gridRecomendacoesView = new HtmlPanelGrid(); + 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 HtmlPanelGrid getGridRecomendacoesView() { - return gridRecomendacoesView; - } + public com.sun.rave.web.ui.component.Calendar getCalPeriodoIncapA() + { + return calPeriodoIncapA; + } - public void setGridRecomendacoesView(HtmlPanelGrid hpg) { - this.gridRecomendacoesView = hpg; - } + public void setCalPeriodoIncapA( com.sun.rave.web.ui.component.Calendar c ) + { + this.calPeriodoIncapA = c; + } + private HtmlPanelGrid gridPanel71 = new HtmlPanelGrid(); - private HtmlPanelGrid gridMedidasRH = new HtmlPanelGrid(); + public HtmlPanelGrid getGridPanel71() + { + return gridPanel71; + } - public HtmlPanelGrid getGridMedidasRH() { - return gridMedidasRH; - } + public void setGridPanel71( HtmlPanelGrid hpg ) + { + this.gridPanel71 = hpg; + } + private StaticText staticText116 = new StaticText(); - public void setGridMedidasRH(HtmlPanelGrid hpg) { - this.gridMedidasRH = hpg; - } + public StaticText getStaticText116() + { + return staticText116; + } - private HtmlPanelGrid gridPanel57 = new HtmlPanelGrid(); + public void setStaticText116( StaticText st ) + { + this.staticText116 = st; + } + private HtmlPanelGrid gridRestricoes = new HtmlPanelGrid(); - public HtmlPanelGrid getGridPanel57() { - return gridPanel57; - } + public HtmlPanelGrid getGridRestricoes() + { + return gridRestricoes; + } - public void setGridPanel57(HtmlPanelGrid hpg) { - this.gridPanel57 = hpg; - } + public void setGridRestricoes( HtmlPanelGrid hpg ) + { + this.gridRestricoes = hpg; + } + private HtmlPanelGrid gridPanel72 = new HtmlPanelGrid(); - private StaticText staticText68 = new StaticText(); + public HtmlPanelGrid getGridPanel72() + { + return gridPanel72; + } - public StaticText getStaticText68() { - return staticText68; - } + public void setGridPanel72( HtmlPanelGrid hpg ) + { + this.gridPanel72 = hpg; + } + private HtmlPanelGrid gridPanel73 = new HtmlPanelGrid(); - public void setStaticText68(StaticText st) { - this.staticText68 = st; - } + public HtmlPanelGrid getGridPanel73() + { + return gridPanel73; + } - private HtmlPanelGrid gridMedidas = new HtmlPanelGrid(); + public void setGridPanel73( HtmlPanelGrid hpg ) + { + this.gridPanel73 = hpg; + } + private HtmlPanelGrid gridPanel74 = new HtmlPanelGrid(); - public HtmlPanelGrid getGridMedidas() { - return gridMedidas; - } + public HtmlPanelGrid getGridPanel74() + { + return gridPanel74; + } - public void setGridMedidas(HtmlPanelGrid hpg) { - this.gridMedidas = hpg; - } + public void setGridPanel74( HtmlPanelGrid hpg ) + { + this.gridPanel74 = hpg; + } + private HtmlPanelGrid gridPanel75 = new HtmlPanelGrid(); - private HtmlPanelGrid gridPanel58 = new HtmlPanelGrid(); + public HtmlPanelGrid getGridPanel75() + { + return gridPanel75; + } - public HtmlPanelGrid getGridPanel58() { - return gridPanel58; - } + public void setGridPanel75( HtmlPanelGrid hpg ) + { + this.gridPanel75 = hpg; + } + private ImageComponent image3 = new ImageComponent(); - public void setGridPanel58(HtmlPanelGrid hpg) { - this.gridPanel58 = hpg; - } + public ImageComponent getImage3() + { + return image3; + } - private StaticText stNrMedida1 = new StaticText(); + public void setImage3( ImageComponent ic ) + { + this.image3 = ic; + } + private ImageComponent image4 = new ImageComponent(); - public StaticText getStNrMedida1() { - return stNrMedida1; - } + public ImageComponent getImage4() + { + return image4; + } - public void setStNrMedida1(StaticText st) { - this.stNrMedida1 = st; - } + public void setImage4( ImageComponent ic ) + { + this.image4 = ic; + } + private ImageComponent image5 = new ImageComponent(); - private TextArea txtMedida1 = new TextArea(); + public ImageComponent getImage5() + { + return image5; + } - public TextArea getTxtMedida1() { - return txtMedida1; - } + public void setImage5( ImageComponent ic ) + { + this.image5 = ic; + } + private PanelGroup groupPanel26 = new PanelGroup(); - public void setTxtMedida1(TextArea ta) { - this.txtMedida1 = ta; - } + public PanelGroup getGroupPanel26() + { + return groupPanel26; + } - private ImageHyperlink lnkMoreMed1 = new ImageHyperlink(); + public void setGroupPanel26( PanelGroup pg ) + { + this.groupPanel26 = pg; + } + private StaticText staticText117 = new StaticText(); - public ImageHyperlink getLnkMoreMed1() { - return lnkMoreMed1; - } + public StaticText getStaticText117() + { + return staticText117; + } - public void setLnkMoreMed1(ImageHyperlink ih) { - this.lnkMoreMed1 = ih; - } + public void setStaticText117( StaticText st ) + { + this.staticText117 = st; + } + private Checkbox chkImgFlexao = new Checkbox(); - private HtmlPanelGrid gridMedidasViewRH = new HtmlPanelGrid(); + public Checkbox getChkImgFlexao() + { + return chkImgFlexao; + } - public HtmlPanelGrid getGridMedidasViewRH() { - return gridMedidasViewRH; - } + public void setChkImgFlexao( Checkbox c ) + { + this.chkImgFlexao = c; + } + private HtmlPanelGrid gridPanel76 = new HtmlPanelGrid(); - public void setGridMedidasViewRH(HtmlPanelGrid hpg) { - this.gridMedidasViewRH = hpg; - } + public HtmlPanelGrid getGridPanel76() + { + return gridPanel76; + } - private HtmlPanelGrid gridPanel59 = new HtmlPanelGrid(); + public void setGridPanel76( HtmlPanelGrid hpg ) + { + this.gridPanel76 = hpg; + } + private ImageComponent image6 = new ImageComponent(); - public HtmlPanelGrid getGridPanel59() { - return gridPanel59; - } + public ImageComponent getImage6() + { + return image6; + } - public void setGridPanel59(HtmlPanelGrid hpg) { - this.gridPanel59 = hpg; - } + public void setImage6( ImageComponent ic ) + { + this.image6 = ic; + } + private HtmlPanelGrid gridPanel77 = new HtmlPanelGrid(); - private StaticText staticText89 = new StaticText(); + public HtmlPanelGrid getGridPanel77() + { + return gridPanel77; + } - public StaticText getStaticText89() { - return staticText89; - } + public void setGridPanel77( HtmlPanelGrid hpg ) + { + this.gridPanel77 = hpg; + } + private ImageComponent image7 = new ImageComponent(); - public void setStaticText89(StaticText st) { - this.staticText89 = st; - } + public ImageComponent getImage7() + { + return image7; + } - private HtmlPanelGrid gridMedidasView = new HtmlPanelGrid(); + public void setImage7( ImageComponent ic ) + { + this.image7 = ic; + } + private ImageComponent image8 = new ImageComponent(); - public HtmlPanelGrid getGridMedidasView() { - return gridMedidasView; - } + public ImageComponent getImage8() + { + return image8; + } - public void setGridMedidasView(HtmlPanelGrid hpg) { - this.gridMedidasView = hpg; - } + public void setImage8( ImageComponent ic ) + { + this.image8 = ic; + } + private PanelGroup groupPanel27 = new PanelGroup(); - private HtmlPanelGrid gridMedico = new HtmlPanelGrid(); + public PanelGroup getGroupPanel27() + { + return groupPanel27; + } - public HtmlPanelGrid getGridMedico() { - return gridMedico; - } + public void setGroupPanel27( PanelGroup pg ) + { + this.groupPanel27 = pg; + } + private StaticText staticText118 = new StaticText(); - public void setGridMedico(HtmlPanelGrid hpg) { - this.gridMedico = hpg; - } + public StaticText getStaticText118() + { + return staticText118; + } - private HtmlPanelGrid gridPanel60 = new HtmlPanelGrid(); + public void setStaticText118( StaticText st ) + { + this.staticText118 = st; + } + private Checkbox chkImgExt1 = new Checkbox(); - public HtmlPanelGrid getGridPanel60() { - return gridPanel60; - } + public Checkbox getChkImgExt1() + { + return chkImgExt1; + } - public void setGridPanel60(HtmlPanelGrid hpg) { - this.gridPanel60 = hpg; - } + public void setChkImgExt1( Checkbox c ) + { + this.chkImgExt1 = c; + } + private PanelGroup groupPanel28 = new PanelGroup(); - private StaticText staticText90 = new StaticText(); + public PanelGroup getGroupPanel28() + { + return groupPanel28; + } - public StaticText getStaticText90() { - return staticText90; - } + public void setGroupPanel28( PanelGroup pg ) + { + this.groupPanel28 = pg; + } + private StaticText staticText119 = new StaticText(); - public void setStaticText90(StaticText st) { - this.staticText90 = st; - } + public StaticText getStaticText119() + { + return staticText119; + } - private HtmlPanelGrid gridLesao1 = new HtmlPanelGrid(); + public void setStaticText119( StaticText st ) + { + this.staticText119 = st; + } + private Checkbox chkImgExt2 = new Checkbox(); - public HtmlPanelGrid getGridLesao1() { - return gridLesao1; - } + public Checkbox getChkImgExt2() + { + return chkImgExt2; + } - public void setGridLesao1(HtmlPanelGrid hpg) { - this.gridLesao1 = hpg; - } + public void setChkImgExt2( Checkbox c ) + { + this.chkImgExt2 = c; + } + private HtmlPanelGrid gridPanel78 = new HtmlPanelGrid(); - private StaticText staticText91 = new StaticText(); + public HtmlPanelGrid getGridPanel78() + { + return gridPanel78; + } - public StaticText getStaticText91() { - return staticText91; - } + public void setGridPanel78( HtmlPanelGrid hpg ) + { + this.gridPanel78 = hpg; + } + private ImageComponent image9 = new ImageComponent(); - public void setStaticText91(StaticText st) { - this.staticText91 = st; - } + public ImageComponent getImage9() + { + return image9; + } - private HtmlPanelGrid gridPanel61 = new HtmlPanelGrid(); + public void setImage9( ImageComponent ic ) + { + this.image9 = ic; + } + private ImageComponent image10 = new ImageComponent(); - public HtmlPanelGrid getGridPanel61() { - return gridPanel61; - } + public ImageComponent getImage10() + { + return image10; + } - public void setGridPanel61(HtmlPanelGrid hpg) { - this.gridPanel61 = hpg; - } + public void setImage10( ImageComponent ic ) + { + this.image10 = ic; + } + private PanelGroup groupPanel29 = new PanelGroup(); - private PanelGroup groupPanel17 = new PanelGroup(); + public PanelGroup getGroupPanel29() + { + return groupPanel29; + } - public PanelGroup getGroupPanel17() { - return groupPanel17; - } + public void setGroupPanel29( PanelGroup pg ) + { + this.groupPanel29 = pg; + } + private StaticText staticText120 = new StaticText(); - public void setGroupPanel17(PanelGroup pg) { - this.groupPanel17 = pg; - } + public StaticText getStaticText120() + { + return staticText120; + } - private Checkbox chkCabeca = new Checkbox(); + public void setStaticText120( StaticText st ) + { + this.staticText120 = st; + } + private Checkbox chkImgCab2 = new Checkbox(); - public Checkbox getChkCabeca() { - return chkCabeca; - } + public Checkbox getChkImgCab2() + { + return chkImgCab2; + } - public void setChkCabeca(Checkbox c) { - this.chkCabeca = c; - } + public void setChkImgCab2( Checkbox c ) + { + this.chkImgCab2 = c; + } + private PanelGroup groupPanel30 = new PanelGroup(); - private StaticText staticText93 = new StaticText(); + public PanelGroup getGroupPanel30() + { + return groupPanel30; + } - public StaticText getStaticText93() { - return staticText93; - } + public void setGroupPanel30( PanelGroup pg ) + { + this.groupPanel30 = pg; + } + private StaticText staticText121 = new StaticText(); - public void setStaticText93(StaticText st) { - this.staticText93 = st; - } + public StaticText getStaticText121() + { + return staticText121; + } - private PanelGroup groupPanel18 = new PanelGroup(); + public void setStaticText121( StaticText st ) + { + this.staticText121 = st; + } + private Checkbox chkImgCab3 = new Checkbox(); - public PanelGroup getGroupPanel18() { - return groupPanel18; - } + public Checkbox getChkImgCab3() + { + return chkImgCab3; + } - public void setGroupPanel18(PanelGroup pg) { - this.groupPanel18 = pg; - } + public void setChkImgCab3( Checkbox c ) + { + this.chkImgCab3 = c; + } + private HtmlPanelGrid gridPanel79 = new HtmlPanelGrid(); - private Checkbox chkMembroSupDir = new Checkbox(); + public HtmlPanelGrid getGridPanel79() + { + return gridPanel79; + } - public Checkbox getChkMembroSupDir() { - return chkMembroSupDir; - } + public void setGridPanel79( HtmlPanelGrid hpg ) + { + this.gridPanel79 = hpg; + } + private ImageComponent image12 = new ImageComponent(); - public void setChkMembroSupDir(Checkbox c) { - this.chkMembroSupDir = c; - } + public ImageComponent getImage12() + { + return image12; + } - private StaticText staticText94 = new StaticText(); + public void setImage12( ImageComponent ic ) + { + this.image12 = ic; + } + private ImageComponent image13 = new ImageComponent(); - public StaticText getStaticText94() { - return staticText94; - } + public ImageComponent getImage13() + { + return image13; + } - public void setStaticText94(StaticText st) { - this.staticText94 = st; - } + public void setImage13( ImageComponent ic ) + { + this.image13 = ic; + } + private ImageComponent image14 = new ImageComponent(); - private HtmlPanelGrid gridPanel62 = new HtmlPanelGrid(); + public ImageComponent getImage14() + { + return image14; + } - public HtmlPanelGrid getGridPanel62() { - return gridPanel62; - } + public void setImage14( ImageComponent ic ) + { + this.image14 = ic; + } + private PanelGroup groupPanel31 = new PanelGroup(); - public void setGridPanel62(HtmlPanelGrid hpg) { - this.gridPanel62 = hpg; - } + public PanelGroup getGroupPanel31() + { + return groupPanel31; + } - private StaticText lblEspecif1 = new StaticText(); + public void setGroupPanel31( PanelGroup pg ) + { + this.groupPanel31 = pg; + } + private StaticText staticText122 = new StaticText(); - public StaticText getLblEspecif1() { - return lblEspecif1; - } + public StaticText getStaticText122() + { + return staticText122; + } - public void setLblEspecif1(StaticText st) { - this.lblEspecif1 = st; - } + public void setStaticText122( StaticText st ) + { + this.staticText122 = st; + } + private Checkbox chkImgMa2 = new Checkbox(); - private TextField txtEspecif1 = new TextField(); + public Checkbox getChkImgMa2() + { + return chkImgMa2; + } - public TextField getTxtEspecif1() { - return txtEspecif1; - } + public void setChkImgMa2( Checkbox c ) + { + this.chkImgMa2 = c; + } + private PanelGroup groupPanel32 = new PanelGroup(); - public void setTxtEspecif1(TextField tf) { - this.txtEspecif1 = tf; - } + public PanelGroup getGroupPanel32() + { + return groupPanel32; + } - private PanelGroup groupPanel19 = new PanelGroup(); + public void setGroupPanel32( PanelGroup pg ) + { + this.groupPanel32 = pg; + } + private StaticText staticText123 = new StaticText(); - public PanelGroup getGroupPanel19() { - return groupPanel19; - } + public StaticText getStaticText123() + { + return staticText123; + } - public void setGroupPanel19(PanelGroup pg) { - this.groupPanel19 = pg; - } + public void setStaticText123( StaticText st ) + { + this.staticText123 = st; + } + private Checkbox chkImgMa3 = new Checkbox(); - private Checkbox chkPescoco = new Checkbox(); + public Checkbox getChkImgMa3() + { + return chkImgMa3; + } - public Checkbox getChkPescoco() { - return chkPescoco; - } + public void setChkImgMa3( Checkbox c ) + { + this.chkImgMa3 = c; + } + private PanelGroup groupPanel33 = new PanelGroup(); - public void setChkPescoco(Checkbox c) { - this.chkPescoco = c; - } + public PanelGroup getGroupPanel33() + { + return groupPanel33; + } - private StaticText staticText96 = new StaticText(); + public void setGroupPanel33( PanelGroup pg ) + { + this.groupPanel33 = pg; + } + private StaticText staticText124 = new StaticText(); - public StaticText getStaticText96() { - return staticText96; - } + public StaticText getStaticText124() + { + return staticText124; + } - public void setStaticText96(StaticText st) { - this.staticText96 = st; - } + public void setStaticText124( StaticText st ) + { + this.staticText124 = st; + } + private Checkbox chkImgMa5 = new Checkbox(); - private PanelGroup groupPanel20 = new PanelGroup(); + public Checkbox getChkImgMa5() + { + return chkImgMa5; + } - public PanelGroup getGroupPanel20() { - return groupPanel20; - } + public void setChkImgMa5( Checkbox c ) + { + this.chkImgMa5 = c; + } + private PanelGroup groupPanel34 = new PanelGroup(); - public void setGroupPanel20(PanelGroup pg) { - this.groupPanel20 = pg; - } + public PanelGroup getGroupPanel34() + { + return groupPanel34; + } - private Checkbox chkMembroSupEsq = new Checkbox(); + public void setGroupPanel34( PanelGroup pg ) + { + this.groupPanel34 = pg; + } + private StaticText staticText125 = new StaticText(); - public Checkbox getChkMembroSupEsq() { - return chkMembroSupEsq; - } + public StaticText getStaticText125() + { + return staticText125; + } - public void setChkMembroSupEsq(Checkbox c) { - this.chkMembroSupEsq = c; - } + public void setStaticText125( StaticText st ) + { + this.staticText125 = st; + } + private Checkbox chkImgMa6 = new Checkbox(); - private StaticText staticText97 = new StaticText(); + public Checkbox getChkImgMa6() + { + return chkImgMa6; + } - public StaticText getStaticText97() { - return staticText97; - } + public void setChkImgMa6( Checkbox c ) + { + this.chkImgMa6 = c; + } + private HtmlPanelGrid gridPanel80 = new HtmlPanelGrid(); - public void setStaticText97(StaticText st) { - this.staticText97 = st; - } + public HtmlPanelGrid getGridPanel80() + { + return gridPanel80; + } - private HtmlPanelGrid gridPanel63 = new HtmlPanelGrid(); + public void setGridPanel80( HtmlPanelGrid hpg ) + { + this.gridPanel80 = hpg; + } + private ImageComponent image15 = new ImageComponent(); - public HtmlPanelGrid getGridPanel63() { - return gridPanel63; - } + public ImageComponent getImage15() + { + return image15; + } - public void setGridPanel63(HtmlPanelGrid hpg) { - this.gridPanel63 = hpg; - } + public void setImage15( ImageComponent ic ) + { + this.image15 = ic; + } + private ImageComponent image16 = new ImageComponent(); - private StaticText lblEspecif2 = new StaticText(); + public ImageComponent getImage16() + { + return image16; + } - public StaticText getLblEspecif2() { - return lblEspecif2; - } + public void setImage16( ImageComponent ic ) + { + this.image16 = ic; + } + private PanelGroup groupPanel35 = new PanelGroup(); - public void setLblEspecif2(StaticText st) { - this.lblEspecif2 = st; - } + public PanelGroup getGroupPanel35() + { + return groupPanel35; + } - private TextField txtEspecif2 = new TextField(); + public void setGroupPanel35( PanelGroup pg ) + { + this.groupPanel35 = pg; + } + private StaticText staticText126 = new StaticText(); - public TextField getTxtEspecif2() { - return txtEspecif2; - } + public StaticText getStaticText126() + { + return staticText126; + } - public void setTxtEspecif2(TextField tf) { - this.txtEspecif2 = tf; - } + public void setStaticText126( StaticText st ) + { + this.staticText126 = st; + } + private Checkbox chkImgMa8 = new Checkbox(); - private PanelGroup groupPanel21 = new PanelGroup(); + public Checkbox getChkImgMa8() + { + return chkImgMa8; + } - public PanelGroup getGroupPanel21() { - return groupPanel21; - } + public void setChkImgMa8( Checkbox c ) + { + this.chkImgMa8 = c; + } + private PanelGroup groupPanel36 = new PanelGroup(); - public void setGroupPanel21(PanelGroup pg) { - this.groupPanel21 = pg; - } + public PanelGroup getGroupPanel36() + { + return groupPanel36; + } - private Checkbox chkTronco = new Checkbox(); + public void setGroupPanel36( PanelGroup pg ) + { + this.groupPanel36 = pg; + } + private StaticText staticText127 = new StaticText(); - public Checkbox getChkTronco() { - return chkTronco; - } + public StaticText getStaticText127() + { + return staticText127; + } - public void setChkTronco(Checkbox c) { - this.chkTronco = c; - } + public void setStaticText127( StaticText st ) + { + this.staticText127 = st; + } + private Checkbox chkImgMa10 = new Checkbox(); - private StaticText staticText99 = new StaticText(); + public Checkbox getChkImgMa10() + { + return chkImgMa10; + } - public StaticText getStaticText99() { - return staticText99; - } + public void setChkImgMa10( Checkbox c ) + { + this.chkImgMa10 = c; + } + private HtmlPanelGrid gridPanel81 = new HtmlPanelGrid(); - public void setStaticText99(StaticText st) { - this.staticText99 = st; - } + public HtmlPanelGrid getGridPanel81() + { + return gridPanel81; + } - private PanelGroup groupPanel22 = new PanelGroup(); + public void setGridPanel81( HtmlPanelGrid hpg ) + { + this.gridPanel81 = hpg; + } + private StaticText staticText128 = new StaticText(); - public PanelGroup getGroupPanel22() { - return groupPanel22; - } + public StaticText getStaticText128() + { + return staticText128; + } - public void setGroupPanel22(PanelGroup pg) { - this.groupPanel22 = pg; - } + public void setStaticText128( StaticText st ) + { + this.staticText128 = st; + } + private PanelGroup groupPanel37 = new PanelGroup(); - private Checkbox chkMembroInfDir = new Checkbox(); + public PanelGroup getGroupPanel37() + { + return groupPanel37; + } - public Checkbox getChkMembroInfDir() { - return chkMembroInfDir; - } + public void setGroupPanel37( PanelGroup pg ) + { + this.groupPanel37 = pg; + } + private Checkbox chkRestricaoCargas = new Checkbox(); - public void setChkMembroInfDir(Checkbox c) { - this.chkMembroInfDir = c; - } + public Checkbox getChkRestricaoCargas() + { + return chkRestricaoCargas; + } - private StaticText staticText100 = new StaticText(); + public void setChkRestricaoCargas( Checkbox c ) + { + this.chkRestricaoCargas = c; + } + private StaticText staticText129 = new StaticText(); - public StaticText getStaticText100() { - return staticText100; - } + public StaticText getStaticText129() + { + return staticText129; + } - public void setStaticText100(StaticText st) { - this.staticText100 = st; - } + public void setStaticText129( StaticText st ) + { + this.staticText129 = st; + } + private RadioButton rbKgs2 = new RadioButton(); - private HtmlPanelGrid gridPanel64 = new HtmlPanelGrid(); + public RadioButton getRbKgs2() + { + return rbKgs2; + } - public HtmlPanelGrid getGridPanel64() { - return gridPanel64; - } + public void setRbKgs2( RadioButton rb ) + { + this.rbKgs2 = rb; + } + private StaticText stKgs2 = new StaticText(); - public void setGridPanel64(HtmlPanelGrid hpg) { - this.gridPanel64 = hpg; - } + public StaticText getStKgs2() + { + return stKgs2; + } - private StaticText lblEspecif3 = new StaticText(); + public void setStKgs2( StaticText st ) + { + this.stKgs2 = st; + } + private RadioButton rbKgs5 = new RadioButton(); - public StaticText getLblEspecif3() { - return lblEspecif3; - } + public RadioButton getRbKgs5() + { + return rbKgs5; + } - public void setLblEspecif3(StaticText st) { - this.lblEspecif3 = st; - } + public void setRbKgs5( RadioButton rb ) + { + this.rbKgs5 = rb; + } + private StaticText stKgs5 = new StaticText(); - private TextField txtEspecif3 = new TextField(); + public StaticText getStKgs5() + { + return stKgs5; + } - public TextField getTxtEspecif3() { - return txtEspecif3; - } + public void setStKgs5( StaticText st ) + { + this.stKgs5 = st; + } + private RadioButton rbKgs10 = new RadioButton(); - public void setTxtEspecif3(TextField tf) { - this.txtEspecif3 = tf; - } + public RadioButton getRbKgs10() + { + return rbKgs10; + } - private StaticText staticText102 = new StaticText(); + public void setRbKgs10( RadioButton rb ) + { + this.rbKgs10 = rb; + } + private StaticText stKgs10 = new StaticText(); - public StaticText getStaticText102() { - return staticText102; - } + public StaticText getStKgs10() + { + return stKgs10; + } - public void setStaticText102(StaticText st) { - this.staticText102 = st; - } + public void setStKgs10( StaticText st ) + { + this.stKgs10 = st; + } + private RadioButton rbKgs15 = new RadioButton(); - private PanelGroup groupPanel23 = new PanelGroup(); + public RadioButton getRbKgs15() + { + return rbKgs15; + } - public PanelGroup getGroupPanel23() { - return groupPanel23; - } + public void setRbKgs15( RadioButton rb ) + { + this.rbKgs15 = rb; + } + private StaticText stKgs15 = new StaticText(); - public void setGroupPanel23(PanelGroup pg) { - this.groupPanel23 = pg; - } + public StaticText getStKgs15() + { + return stKgs15; + } - private Checkbox chkMembroInfEsq = new Checkbox(); + public void setStKgs15( StaticText st ) + { + this.stKgs15 = st; + } + private RadioButton rbKgsOutro = new RadioButton(); - public Checkbox getChkMembroInfEsq() { - return chkMembroInfEsq; - } + public RadioButton getRbKgsOutro() + { + return rbKgsOutro; + } - public void setChkMembroInfEsq(Checkbox c) { - this.chkMembroInfEsq = c; - } + public void setRbKgsOutro( RadioButton rb ) + { + this.rbKgsOutro = rb; + } + private StaticText stKgsOutro = new StaticText(); - private StaticText staticText103 = new StaticText(); + public StaticText getStKgsOutro() + { + return stKgsOutro; + } - public StaticText getStaticText103() { - return staticText103; - } + public void setStKgsOutro( StaticText st ) + { + this.stKgsOutro = st; + } + private TextField txtKgs = new TextField(); - public void setStaticText103(StaticText st) { - this.staticText103 = st; - } + public TextField getTxtKgs() + { + return txtKgs; + } - private HtmlPanelGrid gridPanel65 = new HtmlPanelGrid(); + public void setTxtKgs( TextField tf ) + { + this.txtKgs = tf; + } + private StaticText stKg = new StaticText(); - public HtmlPanelGrid getGridPanel65() { - return gridPanel65; - } + public StaticText getStKg() + { + return stKg; + } - public void setGridPanel65(HtmlPanelGrid hpg) { - this.gridPanel65 = hpg; - } + public void setStKg( StaticText st ) + { + this.stKg = st; + } + private PanelGroup groupPanel38 = new PanelGroup(); - private StaticText lblEspecif4 = new StaticText(); + public PanelGroup getGroupPanel38() + { + return groupPanel38; + } - public StaticText getLblEspecif4() { - return lblEspecif4; - } + public void setGroupPanel38( PanelGroup pg ) + { + this.groupPanel38 = pg; + } + private Checkbox chkRestricaoMotricidade = new Checkbox(); - public void setLblEspecif4(StaticText st) { - this.lblEspecif4 = st; - } + public Checkbox getChkRestricaoMotricidade() + { + return chkRestricaoMotricidade; + } - private TextField txtEspecif4 = new TextField(); + public void setChkRestricaoMotricidade( Checkbox c ) + { + this.chkRestricaoMotricidade = c; + } + private StaticText staticText136 = new StaticText(); - public TextField getTxtEspecif4() { - return txtEspecif4; - } + public StaticText getStaticText136() + { + return staticText136; + } - public void setTxtEspecif4(TextField tf) { - this.txtEspecif4 = tf; - } + public void setStaticText136( StaticText st ) + { + this.staticText136 = st; + } + private PanelGroup groupPanel39 = new PanelGroup(); - private HtmlPanelGrid gridPanel66 = new HtmlPanelGrid(); + public PanelGroup getGroupPanel39() + { + return groupPanel39; + } - public HtmlPanelGrid getGridPanel66() { - return gridPanel66; - } + public void setGroupPanel39( PanelGroup pg ) + { + this.groupPanel39 = pg; + } + private Checkbox chkRestricaoConducao = new Checkbox(); - public void setGridPanel66(HtmlPanelGrid hpg) { - this.gridPanel66 = hpg; - } + public Checkbox getChkRestricaoConducao() + { + return chkRestricaoConducao; + } - private StaticText staticText105 = new StaticText(); + public void setChkRestricaoConducao( Checkbox c ) + { + this.chkRestricaoConducao = c; + } + private StaticText staticText137 = new StaticText(); - public StaticText getStaticText105() { - return staticText105; - } + public StaticText getStaticText137() + { + return staticText137; + } - public void setStaticText105(StaticText st) { - this.staticText105 = st; - } + public void setStaticText137( StaticText st ) + { + this.staticText137 = st; + } + private PanelGroup groupPanel40 = new PanelGroup(); - private TextField txtTipoLesao = new TextField(); + public PanelGroup getGroupPanel40() + { + return groupPanel40; + } - public TextField getTxtTipoLesao() { - return txtTipoLesao; - } + public void setGroupPanel40( PanelGroup pg ) + { + this.groupPanel40 = pg; + } + private Checkbox chkRestricaoVibracoes = new Checkbox(); - public void setTxtTipoLesao(TextField tf) { - this.txtTipoLesao = tf; - } + public Checkbox getChkRestricaoVibracoes() + { + return chkRestricaoVibracoes; + } - private HtmlPanelGrid gridPanel67 = new HtmlPanelGrid(); + public void setChkRestricaoVibracoes( Checkbox c ) + { + this.chkRestricaoVibracoes = c; + } + private StaticText staticText138 = new StaticText(); - public HtmlPanelGrid getGridPanel67() { - return gridPanel67; - } + public StaticText getStaticText138() + { + return staticText138; + } - public void setGridPanel67(HtmlPanelGrid hpg) { - this.gridPanel67 = hpg; - } + public void setStaticText138( StaticText st ) + { + this.staticText138 = st; + } + private HtmlPanelGrid gridPanel82 = new HtmlPanelGrid(); - private StaticText staticText106 = new StaticText(); + public HtmlPanelGrid getGridPanel82() + { + return gridPanel82; + } - public StaticText getStaticText106() { - return staticText106; - } + public void setGridPanel82( HtmlPanelGrid hpg ) + { + this.gridPanel82 = hpg; + } + private PanelGroup groupPanel41 = new PanelGroup(); - public void setStaticText106(StaticText st) { - this.staticText106 = st; - } + public PanelGroup getGroupPanel41() + { + return groupPanel41; + } - private HtmlPanelGrid gridIncapacidade1 = new HtmlPanelGrid(); + public void setGroupPanel41( PanelGroup pg ) + { + this.groupPanel41 = pg; + } + private Checkbox chkRestricaoOutras = new Checkbox(); - public HtmlPanelGrid getGridIncapacidade1() { - return gridIncapacidade1; - } + public Checkbox getChkRestricaoOutras() + { + return chkRestricaoOutras; + } - public void setGridIncapacidade1(HtmlPanelGrid hpg) { - this.gridIncapacidade1 = hpg; - } + public void setChkRestricaoOutras( Checkbox c ) + { + this.chkRestricaoOutras = c; + } + private StaticText staticText139 = new StaticText(); - private HtmlPanelGrid gridPanel68 = new HtmlPanelGrid(); + public StaticText getStaticText139() + { + return staticText139; + } - public HtmlPanelGrid getGridPanel68() { - return gridPanel68; - } + public void setStaticText139( StaticText st ) + { + this.staticText139 = st; + } + private TextField txtRestricaoOutras = new TextField(); - public void setGridPanel68(HtmlPanelGrid hpg) { - this.gridPanel68 = hpg; - } + public TextField getTxtRestricaoOutras() + { + return txtRestricaoOutras; + } - private PanelGroup groupPanel24 = new PanelGroup(); + public void setTxtRestricaoOutras( TextField tf ) + { + this.txtRestricaoOutras = tf; + } + private HtmlPanelGrid gridPanel83 = new HtmlPanelGrid(); - public PanelGroup getGroupPanel24() { - return groupPanel24; - } + public HtmlPanelGrid getGridPanel83() + { + return gridPanel83; + } - public void setGroupPanel24(PanelGroup pg) { - this.groupPanel24 = pg; - } + public void setGridPanel83( HtmlPanelGrid hpg ) + { + this.gridPanel83 = hpg; + } + private StaticText staticText140 = new StaticText(); - private StaticText staticText107 = new StaticText(); + public StaticText getStaticText140() + { + return staticText140; + } - public StaticText getStaticText107() { - return staticText107; - } + public void setStaticText140( StaticText st ) + { + this.staticText140 = st; + } + private TextField txtObservacoes = new TextField(); - public void setStaticText107(StaticText st) { - this.staticText107 = st; - } + public TextField getTxtObservacoes() + { + return txtObservacoes; + } - private RadioButton rbIncapacidadeNone = new RadioButton(); + public void setTxtObservacoes( TextField tf ) + { + this.txtObservacoes = tf; + } + private RadioButton rbIncapacidadePerm = new RadioButton(); - public RadioButton getRbIncapacidadeNone() { - return rbIncapacidadeNone; - } + public RadioButton getRbIncapacidadePerm() + { + return rbIncapacidadePerm; + } - public void setRbIncapacidadeNone(RadioButton rb) { - this.rbIncapacidadeNone = rb; - } + public void setRbIncapacidadePerm( RadioButton rb ) + { + this.rbIncapacidadePerm = rb; + } + private StaticText staticText141 = new StaticText(); - private StaticText staticText108 = new StaticText(); + public StaticText getStaticText141() + { + return staticText141; + } - public StaticText getStaticText108() { - return staticText108; - } + public void setStaticText141( StaticText st ) + { + this.staticText141 = st; + } + private ImageComponent image17 = new ImageComponent(); - public void setStaticText108(StaticText st) { - this.staticText108 = st; - } + public ImageComponent getImage17() + { + return image17; + } - private RadioButton rbIncapacidadeTemp = new RadioButton(); + public void setImage17( ImageComponent ic ) + { + this.image17 = ic; + } + private ImageComponent image18 = new ImageComponent(); - public RadioButton getRbIncapacidadeTemp() { - return rbIncapacidadeTemp; - } + public ImageComponent getImage18() + { + return image18; + } - public void setRbIncapacidadeTemp(RadioButton rb) { - this.rbIncapacidadeTemp = rb; - } + public void setImage18( ImageComponent ic ) + { + this.image18 = ic; + } + private HtmlPanelGrid gridPanel84 = new HtmlPanelGrid(); - private StaticText staticText109 = new StaticText(); + public HtmlPanelGrid getGridPanel84() + { + return gridPanel84; + } - public StaticText getStaticText109() { - return staticText109; - } + public void setGridPanel84( HtmlPanelGrid hpg ) + { + this.gridPanel84 = hpg; + } + private ImageComponent image19 = new ImageComponent(); - public void setStaticText109(StaticText st) { - this.staticText109 = st; - } + public ImageComponent getImage19() + { + return image19; + } - private PanelGroup groupPanel25 = new PanelGroup(); + public void setImage19( ImageComponent ic ) + { + this.image19 = ic; + } + private ImageComponent image20 = new ImageComponent(); - public PanelGroup getGroupPanel25() { - return groupPanel25; - } + public ImageComponent getImage20() + { + return image20; + } - public void setGroupPanel25(PanelGroup pg) { - this.groupPanel25 = pg; - } + public void setImage20( ImageComponent ic ) + { + this.image20 = ic; + } + private PanelGroup groupPanel42 = new PanelGroup(); - private StaticText staticText110 = new StaticText(); + public PanelGroup getGroupPanel42() + { + return groupPanel42; + } - public StaticText getStaticText110() { - return staticText110; - } + public void setGroupPanel42( PanelGroup pg ) + { + this.groupPanel42 = pg; + } + private StaticText staticText142 = new StaticText(); - public void setStaticText110(StaticText st) { - this.staticText110 = st; - } + public StaticText getStaticText142() + { + return staticText142; + } - private TextField txtCoefIncapacidade = new TextField(); + public void setStaticText142( StaticText st ) + { + this.staticText142 = st; + } + private Checkbox chkImgRot1 = new Checkbox(); - public TextField getTxtCoefIncapacidade() { - return txtCoefIncapacidade; - } + public Checkbox getChkImgRot1() + { + return chkImgRot1; + } - public void setTxtCoefIncapacidade(TextField tf) { - this.txtCoefIncapacidade = tf; - } + public void setChkImgRot1( Checkbox c ) + { + this.chkImgRot1 = c; + } + private PanelGroup groupPanel43 = new PanelGroup(); - private StaticText staticText111 = new StaticText(); + public PanelGroup getGroupPanel43() + { + return groupPanel43; + } - public StaticText getStaticText111() { - return staticText111; - } + public void setGroupPanel43( PanelGroup pg ) + { + this.groupPanel43 = pg; + } + private StaticText staticText143 = new StaticText(); - public void setStaticText111(StaticText st) { - this.staticText111 = st; - } + public StaticText getStaticText143() + { + return staticText143; + } - private HtmlPanelGrid gridPanel69 = new HtmlPanelGrid(); + public void setStaticText143( StaticText st ) + { + this.staticText143 = st; + } + private Checkbox chkImgRot2 = new Checkbox(); - public HtmlPanelGrid getGridPanel69() { - return gridPanel69; - } + public Checkbox getChkImgRot2() + { + return chkImgRot2; + } - public void setGridPanel69(HtmlPanelGrid hpg) { - this.gridPanel69 = hpg; - } + public void setChkImgRot2( Checkbox c ) + { + this.chkImgRot2 = c; + } + private ImageComponent image21 = new ImageComponent(); - private StaticText staticText112 = new StaticText(); + public ImageComponent getImage21() + { + return image21; + } - public StaticText getStaticText112() { - return staticText112; - } + public void setImage21( ImageComponent ic ) + { + this.image21 = ic; + } + private ImageComponent image11 = new ImageComponent(); - public void setStaticText112(StaticText st) { - this.staticText112 = st; - } + public ImageComponent getImage11() + { + return image11; + } - private com.sun.rave.web.ui.component.Calendar calAvaliacaoIncap = new com.sun.rave.web.ui.component.Calendar(); + public void setImage11( ImageComponent ic ) + { + this.image11 = ic; + } + private PanelGroup groupPanel44 = new PanelGroup(); - public com.sun.rave.web.ui.component.Calendar getCalAvaliacaoIncap() { - return calAvaliacaoIncap; - } + public PanelGroup getGroupPanel44() + { + return groupPanel44; + } - public void setCalAvaliacaoIncap(com.sun.rave.web.ui.component.Calendar c) { - this.calAvaliacaoIncap = c; - } + public void setGroupPanel44( PanelGroup pg ) + { + this.groupPanel44 = pg; + } + private StaticText staticText144 = new StaticText(); - private StaticText staticText113 = new StaticText(); + public StaticText getStaticText144() + { + return staticText144; + } - public StaticText getStaticText113() { - return staticText113; - } + public void setStaticText144( StaticText st ) + { + this.staticText144 = st; + } + private Checkbox chkImgCab1 = new Checkbox(); - public void setStaticText113(StaticText st) { - this.staticText113 = st; - } + public Checkbox getChkImgCab1() + { + return chkImgCab1; + } - private com.sun.rave.web.ui.component.Calendar calRevisaoIncap = new com.sun.rave.web.ui.component.Calendar(); + public void setChkImgCab1( Checkbox c ) + { + this.chkImgCab1 = c; + } + private PanelGroup groupPanel45 = new PanelGroup(); - public com.sun.rave.web.ui.component.Calendar getCalRevisaoIncap() { - return calRevisaoIncap; - } + public PanelGroup getGroupPanel45() + { + return groupPanel45; + } - public void setCalRevisaoIncap(com.sun.rave.web.ui.component.Calendar c) { - this.calRevisaoIncap = c; - } + public void setGroupPanel45( PanelGroup pg ) + { + this.groupPanel45 = pg; + } + private StaticText staticText145 = new StaticText(); - private HtmlPanelGrid gridPanel70 = new HtmlPanelGrid(); + public StaticText getStaticText145() + { + return staticText145; + } - public HtmlPanelGrid getGridPanel70() { - return gridPanel70; - } + public void setStaticText145( StaticText st ) + { + this.staticText145 = st; + } + private Checkbox chkImgCab4 = new Checkbox(); - public void setGridPanel70(HtmlPanelGrid hpg) { - this.gridPanel70 = hpg; - } + public Checkbox getChkImgCab4() + { + return chkImgCab4; + } - private StaticText staticText114 = new StaticText(); + public void setChkImgCab4( Checkbox c ) + { + this.chkImgCab4 = c; + } + private ImageComponent image22 = new ImageComponent(); - public StaticText getStaticText114() { - return staticText114; - } + public ImageComponent getImage22() + { + return image22; + } - public void setStaticText114(StaticText st) { - this.staticText114 = st; - } + public void setImage22( ImageComponent ic ) + { + this.image22 = ic; + } + private ImageComponent image23 = new ImageComponent(); - private com.sun.rave.web.ui.component.Calendar calPeridoIncapDe = new com.sun.rave.web.ui.component.Calendar(); + public ImageComponent getImage23() + { + return image23; + } - public com.sun.rave.web.ui.component.Calendar getCalPeridoIncapDe() { - return calPeridoIncapDe; - } + public void setImage23( ImageComponent ic ) + { + this.image23 = ic; + } + private ImageComponent image24 = new ImageComponent(); - public void setCalPeridoIncapDe(com.sun.rave.web.ui.component.Calendar c) { - this.calPeridoIncapDe = c; - } + public ImageComponent getImage24() + { + return image24; + } - private StaticText staticText115 = new StaticText(); + public void setImage24( ImageComponent ic ) + { + this.image24 = ic; + } + private PanelGroup groupPanel46 = new PanelGroup(); - public StaticText getStaticText115() { - return staticText115; - } + public PanelGroup getGroupPanel46() + { + return groupPanel46; + } - public void setStaticText115(StaticText st) { - this.staticText115 = st; - } + public void setGroupPanel46( PanelGroup pg ) + { + this.groupPanel46 = pg; + } + private StaticText staticText146 = new StaticText(); - private com.sun.rave.web.ui.component.Calendar calPeriodoIncapA = new com.sun.rave.web.ui.component.Calendar(); + public StaticText getStaticText146() + { + return staticText146; + } - public com.sun.rave.web.ui.component.Calendar getCalPeriodoIncapA() { - return calPeriodoIncapA; - } + public void setStaticText146( StaticText st ) + { + this.staticText146 = st; + } + private Checkbox chkImgMa1 = new Checkbox(); - public void setCalPeriodoIncapA(com.sun.rave.web.ui.component.Calendar c) { - this.calPeriodoIncapA = c; - } + public Checkbox getChkImgMa1() + { + return chkImgMa1; + } - private HtmlPanelGrid gridPanel71 = new HtmlPanelGrid(); + public void setChkImgMa1( Checkbox c ) + { + this.chkImgMa1 = c; + } + private PanelGroup groupPanel47 = new PanelGroup(); - public HtmlPanelGrid getGridPanel71() { - return gridPanel71; - } + public PanelGroup getGroupPanel47() + { + return groupPanel47; + } - public void setGridPanel71(HtmlPanelGrid hpg) { - this.gridPanel71 = hpg; - } + public void setGroupPanel47( PanelGroup pg ) + { + this.groupPanel47 = pg; + } + private StaticText staticText147 = new StaticText(); - private StaticText staticText116 = new StaticText(); + public StaticText getStaticText147() + { + return staticText147; + } - public StaticText getStaticText116() { - return staticText116; - } + public void setStaticText147( StaticText st ) + { + this.staticText147 = st; + } + private Checkbox chkImgMa4 = new Checkbox(); - public void setStaticText116(StaticText st) { - this.staticText116 = st; - } + public Checkbox getChkImgMa4() + { + return chkImgMa4; + } - private HtmlPanelGrid gridRestricoes = new HtmlPanelGrid(); + public void setChkImgMa4( Checkbox c ) + { + this.chkImgMa4 = c; + } + private ImageComponent image25 = new ImageComponent(); - public HtmlPanelGrid getGridRestricoes() { - return gridRestricoes; - } + public ImageComponent getImage25() + { + return image25; + } - public void setGridRestricoes(HtmlPanelGrid hpg) { - this.gridRestricoes = hpg; - } + public void setImage25( ImageComponent ic ) + { + this.image25 = ic; + } + private ImageComponent image26 = new ImageComponent(); - private HtmlPanelGrid gridPanel72 = new HtmlPanelGrid(); + public ImageComponent getImage26() + { + return image26; + } - public HtmlPanelGrid getGridPanel72() { - return gridPanel72; - } + public void setImage26( ImageComponent ic ) + { + this.image26 = ic; + } + private PanelGroup groupPanel48 = new PanelGroup(); - public void setGridPanel72(HtmlPanelGrid hpg) { - this.gridPanel72 = hpg; - } + public PanelGroup getGroupPanel48() + { + return groupPanel48; + } - private HtmlPanelGrid gridPanel73 = new HtmlPanelGrid(); + public void setGroupPanel48( PanelGroup pg ) + { + this.groupPanel48 = pg; + } + private StaticText staticText148 = new StaticText(); - public HtmlPanelGrid getGridPanel73() { - return gridPanel73; - } + public StaticText getStaticText148() + { + return staticText148; + } - public void setGridPanel73(HtmlPanelGrid hpg) { - this.gridPanel73 = hpg; - } + public void setStaticText148( StaticText st ) + { + this.staticText148 = st; + } + private Checkbox chkImgMa7 = new Checkbox(); - private HtmlPanelGrid gridPanel74 = new HtmlPanelGrid(); + public Checkbox getChkImgMa7() + { + return chkImgMa7; + } - public HtmlPanelGrid getGridPanel74() { - return gridPanel74; - } + public void setChkImgMa7( Checkbox c ) + { + this.chkImgMa7 = c; + } + private PanelGroup groupPanel49 = new PanelGroup(); - public void setGridPanel74(HtmlPanelGrid hpg) { - this.gridPanel74 = hpg; - } + public PanelGroup getGroupPanel49() + { + return groupPanel49; + } - private HtmlPanelGrid gridPanel75 = new HtmlPanelGrid(); + public void setGroupPanel49( PanelGroup pg ) + { + this.groupPanel49 = pg; + } + private StaticText staticText149 = new StaticText(); - public HtmlPanelGrid getGridPanel75() { - return gridPanel75; - } + public StaticText getStaticText149() + { + return staticText149; + } - public void setGridPanel75(HtmlPanelGrid hpg) { - this.gridPanel75 = hpg; - } + public void setStaticText149( StaticText st ) + { + this.staticText149 = st; + } + private Checkbox chkImgMa9 = new Checkbox(); - private ImageComponent image3 = new ImageComponent(); + public Checkbox getChkImgMa9() + { + return chkImgMa9; + } - public ImageComponent getImage3() { - return image3; - } + public void setChkImgMa9( Checkbox c ) + { + this.chkImgMa9 = c; + } + private HtmlPanelGrid gridMedicoView = new HtmlPanelGrid(); - public void setImage3(ImageComponent ic) { - this.image3 = ic; - } + public HtmlPanelGrid getGridMedicoView() + { + return gridMedicoView; + } - private ImageComponent image4 = new ImageComponent(); + public void setGridMedicoView( HtmlPanelGrid hpg ) + { + this.gridMedicoView = hpg; + } + private HtmlPanelGrid gridPanel85 = new HtmlPanelGrid(); - public ImageComponent getImage4() { - return image4; - } + public HtmlPanelGrid getGridPanel85() + { + return gridPanel85; + } - public void setImage4(ImageComponent ic) { - this.image4 = ic; - } + public void setGridPanel85( HtmlPanelGrid hpg ) + { + this.gridPanel85 = hpg; + } + private StaticText staticText150 = new StaticText(); - private ImageComponent image5 = new ImageComponent(); + public StaticText getStaticText150() + { + return staticText150; + } - public ImageComponent getImage5() { - return image5; - } + public void setStaticText150( StaticText st ) + { + this.staticText150 = st; + } + private HtmlPanelGrid gridLesao = new HtmlPanelGrid(); - public void setImage5(ImageComponent ic) { - this.image5 = ic; - } + public HtmlPanelGrid getGridLesao() + { + return gridLesao; + } - private PanelGroup groupPanel26 = new PanelGroup(); + public void setGridLesao( HtmlPanelGrid hpg ) + { + this.gridLesao = hpg; + } + private StaticText staticText151 = new StaticText(); - public PanelGroup getGroupPanel26() { - return groupPanel26; - } + public StaticText getStaticText151() + { + return staticText151; + } - public void setGroupPanel26(PanelGroup pg) { - this.groupPanel26 = pg; - } + public void setStaticText151( StaticText st ) + { + this.staticText151 = st; + } + private HtmlPanelGrid gridPanel86 = new HtmlPanelGrid(); - private StaticText staticText117 = new StaticText(); + public HtmlPanelGrid getGridPanel86() + { + return gridPanel86; + } - public StaticText getStaticText117() { - return staticText117; - } + public void setGridPanel86( HtmlPanelGrid hpg ) + { + this.gridPanel86 = hpg; + } + private StaticText staticText152 = new StaticText(); - public void setStaticText117(StaticText st) { - this.staticText117 = st; - } + public StaticText getStaticText152() + { + return staticText152; + } - private Checkbox chkImgFlexao = new Checkbox(); + public void setStaticText152( StaticText st ) + { + this.staticText152 = st; + } + private HtmlPanelGrid gridIncapacidade2 = new HtmlPanelGrid(); - public Checkbox getChkImgFlexao() { - return chkImgFlexao; - } + public HtmlPanelGrid getGridIncapacidade2() + { + return gridIncapacidade2; + } - public void setChkImgFlexao(Checkbox c) { - this.chkImgFlexao = c; - } + public void setGridIncapacidade2( HtmlPanelGrid hpg ) + { + this.gridIncapacidade2 = hpg; + } + private HtmlPanelGrid gridPanel87 = new HtmlPanelGrid(); - private HtmlPanelGrid gridPanel76 = new HtmlPanelGrid(); + public HtmlPanelGrid getGridPanel87() + { + return gridPanel87; + } - public HtmlPanelGrid getGridPanel76() { - return gridPanel76; - } + public void setGridPanel87( HtmlPanelGrid hpg ) + { + this.gridPanel87 = hpg; + } + private StaticText staticText153 = new StaticText(); - public void setGridPanel76(HtmlPanelGrid hpg) { - this.gridPanel76 = hpg; - } + public StaticText getStaticText153() + { + return staticText153; + } - private ImageComponent image6 = new ImageComponent(); + public void setStaticText153( StaticText st ) + { + this.staticText153 = st; + } + private HtmlPanelGrid gridRestricoes1 = new HtmlPanelGrid(); - public ImageComponent getImage6() { - return image6; - } + public HtmlPanelGrid getGridRestricoes1() + { + return gridRestricoes1; + } - public void setImage6(ImageComponent ic) { - this.image6 = ic; - } + public void setGridRestricoes1( HtmlPanelGrid hpg ) + { + this.gridRestricoes1 = hpg; + } + private HtmlPanelGrid gridPanel88 = new HtmlPanelGrid(); - private HtmlPanelGrid gridPanel77 = new HtmlPanelGrid(); + public HtmlPanelGrid getGridPanel88() + { + return gridPanel88; + } - public HtmlPanelGrid getGridPanel77() { - return gridPanel77; - } + public void setGridPanel88( HtmlPanelGrid hpg ) + { + this.gridPanel88 = hpg; + } + private HtmlPanelGrid gridImagesRestricoes = new HtmlPanelGrid(); - public void setGridPanel77(HtmlPanelGrid hpg) { - this.gridPanel77 = hpg; - } + public HtmlPanelGrid getGridImagesRestricoes() + { + return gridImagesRestricoes; + } - private ImageComponent image7 = new ImageComponent(); + public void setGridImagesRestricoes( HtmlPanelGrid hpg ) + { + this.gridImagesRestricoes = hpg; + } + private HtmlPanelGrid gridOutrasRestricoes = new HtmlPanelGrid(); - public ImageComponent getImage7() { - return image7; - } + public HtmlPanelGrid getGridOutrasRestricoes() + { + return gridOutrasRestricoes; + } - public void setImage7(ImageComponent ic) { - this.image7 = ic; - } + public void setGridOutrasRestricoes( HtmlPanelGrid hpg ) + { + this.gridOutrasRestricoes = hpg; + } + private StaticText staticText154 = new StaticText(); - private ImageComponent image8 = new ImageComponent(); + public StaticText getStaticText154() + { + return staticText154; + } - public ImageComponent getImage8() { - return image8; - } + public void setStaticText154( StaticText st ) + { + this.staticText154 = st; + } + private HtmlPanelGrid gridPanel90 = new HtmlPanelGrid(); - public void setImage8(ImageComponent ic) { - this.image8 = ic; - } + public HtmlPanelGrid getGridPanel90() + { + return gridPanel90; + } - private PanelGroup groupPanel27 = new PanelGroup(); + public void setGridPanel90( HtmlPanelGrid hpg ) + { + this.gridPanel90 = hpg; + } + private StaticText staticText155 = new StaticText(); - public PanelGroup getGroupPanel27() { - return groupPanel27; - } + public StaticText getStaticText155() + { + return staticText155; + } - public void setGroupPanel27(PanelGroup pg) { - this.groupPanel27 = pg; - } + public void setStaticText155( StaticText st ) + { + this.staticText155 = st; + } + private StaticText stObservacoes = new StaticText(); - private StaticText staticText118 = new StaticText(); + public StaticText getStObservacoes() + { + return stObservacoes; + } - public StaticText getStaticText118() { - return staticText118; - } + public void setStObservacoes( StaticText st ) + { + this.stObservacoes = st; + } + private HtmlPanelGrid gridHeader1 = new HtmlPanelGrid(); - public void setStaticText118(StaticText st) { - this.staticText118 = st; - } + public HtmlPanelGrid getGridHeader1() + { + return gridHeader1; + } - private Checkbox chkImgExt1 = new Checkbox(); + public void setGridHeader1( HtmlPanelGrid hpg ) + { + this.gridHeader1 = hpg; + } + private HtmlPanelGrid gridPanel114 = new HtmlPanelGrid(); - public Checkbox getChkImgExt1() { - return chkImgExt1; - } + public HtmlPanelGrid getGridPanel114() + { + return gridPanel114; + } - public void setChkImgExt1(Checkbox c) { - this.chkImgExt1 = c; - } + public void setGridPanel114( HtmlPanelGrid hpg ) + { + this.gridPanel114 = hpg; + } + private PanelGroup groupPanel57 = new PanelGroup(); - private PanelGroup groupPanel28 = new PanelGroup(); + public PanelGroup getGroupPanel57() + { + return groupPanel57; + } - public PanelGroup getGroupPanel28() { - return groupPanel28; - } + public void setGroupPanel57( PanelGroup pg ) + { + this.groupPanel57 = pg; + } + private ImageComponent image27 = new ImageComponent(); - public void setGroupPanel28(PanelGroup pg) { - this.groupPanel28 = pg; - } + public ImageComponent getImage27() + { + return image27; + } - private StaticText staticText119 = new StaticText(); + public void setImage27( ImageComponent ic ) + { + this.image27 = ic; + } + private HtmlPanelGrid gridPanel115 = new HtmlPanelGrid(); - public StaticText getStaticText119() { - return staticText119; - } + public HtmlPanelGrid getGridPanel115() + { + return gridPanel115; + } - public void setStaticText119(StaticText st) { - this.staticText119 = st; - } + public void setGridPanel115( HtmlPanelGrid hpg ) + { + this.gridPanel115 = hpg; + } + private StaticText staticText168 = new StaticText(); - private Checkbox chkImgExt2 = new Checkbox(); + public StaticText getStaticText168() + { + return staticText168; + } - public Checkbox getChkImgExt2() { - return chkImgExt2; - } + public void setStaticText168( StaticText st ) + { + this.staticText168 = st; + } + private HtmlPanelGrid gridPanel116 = new HtmlPanelGrid(); - public void setChkImgExt2(Checkbox c) { - this.chkImgExt2 = c; - } + public HtmlPanelGrid getGridPanel116() + { + return gridPanel116; + } - private HtmlPanelGrid gridPanel78 = new HtmlPanelGrid(); + public void setGridPanel116( HtmlPanelGrid hpg ) + { + this.gridPanel116 = hpg; + } + private PanelGroup groupPanel58 = new PanelGroup(); - public HtmlPanelGrid getGridPanel78() { - return gridPanel78; - } + public PanelGroup getGroupPanel58() + { + return groupPanel58; + } - public void setGridPanel78(HtmlPanelGrid hpg) { - this.gridPanel78 = hpg; - } + public void setGroupPanel58( PanelGroup pg ) + { + this.groupPanel58 = pg; + } + private StaticText staticText169 = new StaticText(); - private ImageComponent image9 = new ImageComponent(); + public StaticText getStaticText169() + { + return staticText169; + } - public ImageComponent getImage9() { - return image9; - } + public void setStaticText169( StaticText st ) + { + this.staticText169 = st; + } + private StaticText stHeaderNr = new StaticText(); - public void setImage9(ImageComponent ic) { - this.image9 = ic; - } + public StaticText getStHeaderNr() + { + return stHeaderNr; + } - private ImageComponent image10 = new ImageComponent(); + public void setStHeaderNr( StaticText st ) + { + this.stHeaderNr = st; + } + private PanelGroup groupPanel59 = new PanelGroup(); - public ImageComponent getImage10() { - return image10; - } + public PanelGroup getGroupPanel59() + { + return groupPanel59; + } - public void setImage10(ImageComponent ic) { - this.image10 = ic; - } + public void setGroupPanel59( PanelGroup pg ) + { + this.groupPanel59 = pg; + } + private StaticText staticText170 = new StaticText(); - private PanelGroup groupPanel29 = new PanelGroup(); + public StaticText getStaticText170() + { + return staticText170; + } - public PanelGroup getGroupPanel29() { - return groupPanel29; - } + public void setStaticText170( StaticText st ) + { + this.staticText170 = st; + } + private StaticText stHeaderDate = new StaticText(); - public void setGroupPanel29(PanelGroup pg) { - this.groupPanel29 = pg; - } + public StaticText getStHeaderDate() + { + return stHeaderDate; + } - private StaticText staticText120 = new StaticText(); + public void setStHeaderDate( StaticText st ) + { + this.stHeaderDate = st; + } + private ImageComponent image28 = new ImageComponent(); - public StaticText getStaticText120() { - return staticText120; - } + public ImageComponent getImage28() + { + return image28; + } - public void setStaticText120(StaticText st) { - this.staticText120 = st; - } + public void setImage28( ImageComponent ic ) + { + this.image28 = ic; + } + private PanelGroup groupPanel1 = new PanelGroup(); - private Checkbox chkImgCab2 = new Checkbox(); + public PanelGroup getGroupPanel1() + { + return groupPanel1; + } - public Checkbox getChkImgCab2() { - return chkImgCab2; - } + public void setGroupPanel1( PanelGroup pg ) + { + this.groupPanel1 = pg; + } + private RadioButton rbTurnoManha = new RadioButton(); - public void setChkImgCab2(Checkbox c) { - this.chkImgCab2 = c; - } + public RadioButton getRbTurnoManha() + { + return rbTurnoManha; + } - private PanelGroup groupPanel30 = new PanelGroup(); + public void setRbTurnoManha( RadioButton rb ) + { + this.rbTurnoManha = rb; + } + private StaticText staticText1 = new StaticText(); - public PanelGroup getGroupPanel30() { - return groupPanel30; - } + public StaticText getStaticText1() + { + return staticText1; + } - public void setGroupPanel30(PanelGroup pg) { - this.groupPanel30 = pg; - } + public void setStaticText1( StaticText st ) + { + this.staticText1 = st; + } + private StaticText staticText2 = new StaticText(); - private StaticText staticText121 = new StaticText(); + public StaticText getStaticText2() + { + return staticText2; + } - public StaticText getStaticText121() { - return staticText121; - } + public void setStaticText2( StaticText st ) + { + this.staticText2 = st; + } + private RadioButton rbTurnoTarde = new RadioButton(); - public void setStaticText121(StaticText st) { - this.staticText121 = st; - } + public RadioButton getRbTurnoTarde() + { + return rbTurnoTarde; + } - private Checkbox chkImgCab3 = new Checkbox(); + public void setRbTurnoTarde( RadioButton rb ) + { + this.rbTurnoTarde = rb; + } + private StaticText staticText3 = new StaticText(); - public Checkbox getChkImgCab3() { - return chkImgCab3; - } + public StaticText getStaticText3() + { + return staticText3; + } - public void setChkImgCab3(Checkbox c) { - this.chkImgCab3 = c; - } + public void setStaticText3( StaticText st ) + { + this.staticText3 = st; + } + private StaticText staticText41 = new StaticText(); - private HtmlPanelGrid gridPanel79 = new HtmlPanelGrid(); + public StaticText getStaticText41() + { + return staticText41; + } - public HtmlPanelGrid getGridPanel79() { - return gridPanel79; - } + public void setStaticText41( StaticText st ) + { + this.staticText41 = st; + } + private RadioButton rbTurnoNoite = new RadioButton(); - public void setGridPanel79(HtmlPanelGrid hpg) { - this.gridPanel79 = hpg; - } + public RadioButton getRbTurnoNoite() + { + return rbTurnoNoite; + } - private ImageComponent image12 = new ImageComponent(); + public void setRbTurnoNoite( RadioButton rb ) + { + this.rbTurnoNoite = rb; + } + private StaticText staticText42 = new StaticText(); - public ImageComponent getImage12() { - return image12; - } + public StaticText getStaticText42() + { + return staticText42; + } - public void setImage12(ImageComponent ic) { - this.image12 = ic; - } + public void setStaticText42( StaticText st ) + { + this.staticText42 = st; + } + private HiddenField hidDisableEnviar = new HiddenField(); - private ImageComponent image13 = new ImageComponent(); + public HiddenField getHidDisableEnviar() + { + return hidDisableEnviar; + } - public ImageComponent getImage13() { - return image13; - } + public void setHidDisableEnviar( HiddenField hf ) + { + this.hidDisableEnviar = hf; + } + private PanelGroup groupPanel2 = new PanelGroup(); - public void setImage13(ImageComponent ic) { - this.image13 = ic; - } + public PanelGroup getGroupPanel2() + { + return groupPanel2; + } - private ImageComponent image14 = new ImageComponent(); + public void setGroupPanel2( PanelGroup pg ) + { + this.groupPanel2 = pg; + } + private StaticText staticText43 = new StaticText(); - public ImageComponent getImage14() { - return image14; - } + public StaticText getStaticText43() + { + return staticText43; + } - public void setImage14(ImageComponent ic) { - this.image14 = ic; - } + public void setStaticText43( StaticText st ) + { + this.staticText43 = st; + } + private TextField txtNrMecanografico = new TextField(); - private PanelGroup groupPanel31 = new PanelGroup(); + public TextField getTxtNrMecanografico() + { + return txtNrMecanografico; + } - public PanelGroup getGroupPanel31() { - return groupPanel31; - } + public void setTxtNrMecanografico( TextField tf ) + { + this.txtNrMecanografico = tf; + } + private StaticText staticText44 = new StaticText(); - public void setGroupPanel31(PanelGroup pg) { - this.groupPanel31 = pg; - } + public StaticText getStaticText44() + { + return staticText44; + } - private StaticText staticText122 = new StaticText(); + public void setStaticText44( StaticText st ) + { + this.staticText44 = st; + } + private TextField txtNomeTrabalhador = new TextField(); - public StaticText getStaticText122() { - return staticText122; - } + public TextField getTxtNomeTrabalhador() + { + return txtNomeTrabalhador; + } - public void setStaticText122(StaticText st) { - this.staticText122 = st; - } + public void setTxtNomeTrabalhador( TextField tf ) + { + this.txtNomeTrabalhador = tf; + } + private StaticText staticText45 = new StaticText(); - private Checkbox chkImgMa2 = new Checkbox(); + public StaticText getStaticText45() + { + return staticText45; + } - public Checkbox getChkImgMa2() { - return chkImgMa2; - } + public void setStaticText45( StaticText st ) + { + this.staticText45 = st; + } + private Button butProcurarTrab = new Button(); - public void setChkImgMa2(Checkbox c) { - this.chkImgMa2 = c; - } + public Button getButProcurarTrab() + { + return butProcurarTrab; + } - private PanelGroup groupPanel32 = new PanelGroup(); + public void setButProcurarTrab( Button b ) + { + this.butProcurarTrab = b; + } + private Table tblTrabalhadores = new Table(); - public PanelGroup getGroupPanel32() { - return groupPanel32; - } + public Table getTblTrabalhadores() + { + return tblTrabalhadores; + } - public void setGroupPanel32(PanelGroup pg) { - this.groupPanel32 = pg; - } + public void setTblTrabalhadores( Table t ) + { + this.tblTrabalhadores = t; + } + private TableRowGroup tableRowGroup1 = new TableRowGroup(); - private StaticText staticText123 = new StaticText(); + public TableRowGroup getTableRowGroup1() + { + return tableRowGroup1; + } - public StaticText getStaticText123() { - return staticText123; - } + public void setTableRowGroup1( TableRowGroup trg ) + { + this.tableRowGroup1 = trg; + } + private TableColumn tableColumn1 = new TableColumn(); - public void setStaticText123(StaticText st) { - this.staticText123 = st; - } + public TableColumn getTableColumn1() + { + return tableColumn1; + } - private Checkbox chkImgMa3 = new Checkbox(); + public void setTableColumn1( TableColumn tc ) + { + this.tableColumn1 = tc; + } + private TableColumn tableColumn2 = new TableColumn(); - public Checkbox getChkImgMa3() { - return chkImgMa3; - } + public TableColumn getTableColumn2() + { + return tableColumn2; + } - public void setChkImgMa3(Checkbox c) { - this.chkImgMa3 = c; - } + public void setTableColumn2( TableColumn tc ) + { + this.tableColumn2 = tc; + } + private TableColumn tableColumn3 = new TableColumn(); - private PanelGroup groupPanel33 = new PanelGroup(); + public TableColumn getTableColumn3() + { + return tableColumn3; + } - public PanelGroup getGroupPanel33() { - return groupPanel33; - } + public void setTableColumn3( TableColumn tc ) + { + this.tableColumn3 = tc; + } + private DefaultTableDataProvider defaultTableDataProvider = new DefaultTableDataProvider(); - public void setGroupPanel33(PanelGroup pg) { - this.groupPanel33 = pg; - } + public DefaultTableDataProvider getDefaultTableDataProvider() + { + return defaultTableDataProvider; + } - private StaticText staticText124 = new StaticText(); + public void setDefaultTableDataProvider( DefaultTableDataProvider dtdp ) + { + this.defaultTableDataProvider = dtdp; + } + private Hyperlink lnkPOR = new Hyperlink(); - public StaticText getStaticText124() { - return staticText124; - } + public Hyperlink getLnkPOR() + { + return lnkPOR; + } - public void setStaticText124(StaticText st) { - this.staticText124 = st; - } + public void setLnkPOR( Hyperlink h ) + { + this.lnkPOR = h; + } + private Hyperlink lnkNomeTrabalhador = new Hyperlink(); - private Checkbox chkImgMa5 = new Checkbox(); + public Hyperlink getLnkNomeTrabalhador() + { + return lnkNomeTrabalhador; + } - public Checkbox getChkImgMa5() { - return chkImgMa5; - } + public void setLnkNomeTrabalhador( Hyperlink h ) + { + this.lnkNomeTrabalhador = h; + } + private Hyperlink lnkEstabelecimentoTrabalhador = new Hyperlink(); - public void setChkImgMa5(Checkbox c) { - this.chkImgMa5 = c; - } + public Hyperlink getLnkEstabelecimentoTrabalhador() + { + return lnkEstabelecimentoTrabalhador; + } - private PanelGroup groupPanel34 = new PanelGroup(); + public void setLnkEstabelecimentoTrabalhador( Hyperlink h ) + { + this.lnkEstabelecimentoTrabalhador = h; + } + private StaticText stTecnicoNomeEdit = new StaticText(); - public PanelGroup getGroupPanel34() { - return groupPanel34; - } + public StaticText getStTecnicoNomeEdit() + { + return stTecnicoNomeEdit; + } - public void setGroupPanel34(PanelGroup pg) { - this.groupPanel34 = pg; - } + public void setStTecnicoNomeEdit( StaticText st ) + { + this.stTecnicoNomeEdit = st; + } + private HtmlPanelGrid gridDadosAcidenteSegView = new HtmlPanelGrid(); - private StaticText staticText125 = new StaticText(); + public HtmlPanelGrid getGridDadosAcidenteSegView() + { + return gridDadosAcidenteSegView; + } - public StaticText getStaticText125() { - return staticText125; - } + public void setGridDadosAcidenteSegView( HtmlPanelGrid hpg ) + { + this.gridDadosAcidenteSegView = hpg; + } + private HtmlPanelGrid gridPanel1 = new HtmlPanelGrid(); - public void setStaticText125(StaticText st) { - this.staticText125 = st; - } + public HtmlPanelGrid getGridPanel1() + { + return gridPanel1; + } - private Checkbox chkImgMa6 = new Checkbox(); + public void setGridPanel1( HtmlPanelGrid hpg ) + { + this.gridPanel1 = hpg; + } + private StaticText staticText95 = new StaticText(); - public Checkbox getChkImgMa6() { - return chkImgMa6; - } + public StaticText getStaticText95() + { + return staticText95; + } - public void setChkImgMa6(Checkbox c) { - this.chkImgMa6 = c; - } + public void setStaticText95( StaticText st ) + { + this.staticText95 = st; + } + private HtmlPanelGrid gridPanel117 = new HtmlPanelGrid(); - private HtmlPanelGrid gridPanel80 = new HtmlPanelGrid(); + public HtmlPanelGrid getGridPanel117() + { + return gridPanel117; + } - public HtmlPanelGrid getGridPanel80() { - return gridPanel80; - } + public void setGridPanel117( HtmlPanelGrid hpg ) + { + this.gridPanel117 = hpg; + } + private HtmlPanelGrid gridTurnoSeccaoLocal = new HtmlPanelGrid(); - public void setGridPanel80(HtmlPanelGrid hpg) { - this.gridPanel80 = hpg; - } + public HtmlPanelGrid getGridTurnoSeccaoLocal() + { + return gridTurnoSeccaoLocal; + } - private ImageComponent image15 = new ImageComponent(); + public void setGridTurnoSeccaoLocal( HtmlPanelGrid hpg ) + { + this.gridTurnoSeccaoLocal = hpg; + } + private StaticText lblHorasTurno = new StaticText(); - public ImageComponent getImage15() { - return image15; - } + public StaticText getLblHorasTurno() + { + return lblHorasTurno; + } - public void setImage15(ImageComponent ic) { - this.image15 = ic; - } + public void setLblHorasTurno( StaticText st ) + { + this.lblHorasTurno = st; + } + private StaticText txtHorasTurno2 = new StaticText(); - private ImageComponent image16 = new ImageComponent(); + public StaticText getTxtHorasTurno2() + { + return txtHorasTurno2; + } - public ImageComponent getImage16() { - return image16; - } + public void setTxtHorasTurno2( StaticText st ) + { + this.txtHorasTurno2 = st; + } + private StaticText lblSeccao = new StaticText(); - public void setImage16(ImageComponent ic) { - this.image16 = ic; - } + public StaticText getLblSeccao() + { + return lblSeccao; + } - private PanelGroup groupPanel35 = new PanelGroup(); + public void setLblSeccao( StaticText st ) + { + this.lblSeccao = st; + } + private StaticText txtSeccao1 = new StaticText(); - public PanelGroup getGroupPanel35() { - return groupPanel35; - } + public StaticText getTxtSeccao1() + { + return txtSeccao1; + } - public void setGroupPanel35(PanelGroup pg) { - this.groupPanel35 = pg; - } + public void setTxtSeccao1( StaticText st ) + { + this.txtSeccao1 = st; + } + private StaticText lblLocal = new StaticText(); - private StaticText staticText126 = new StaticText(); + public StaticText getLblLocal() + { + return lblLocal; + } - public StaticText getStaticText126() { - return staticText126; - } + public void setLblLocal( StaticText st ) + { + this.lblLocal = st; + } + private StaticText txtLocal1 = new StaticText(); - public void setStaticText126(StaticText st) { - this.staticText126 = st; - } + public StaticText getTxtLocal1() + { + return txtLocal1; + } - private Checkbox chkImgMa8 = new Checkbox(); + public void setTxtLocal1( StaticText st ) + { + this.txtLocal1 = st; + } + private HtmlPanelGrid gridTarefa = new HtmlPanelGrid(); - public Checkbox getChkImgMa8() { - return chkImgMa8; - } + public HtmlPanelGrid getGridTarefa() + { + return gridTarefa; + } - public void setChkImgMa8(Checkbox c) { - this.chkImgMa8 = c; - } + public void setGridTarefa( HtmlPanelGrid hpg ) + { + this.gridTarefa = hpg; + } + private StaticText lblTarefa = new StaticText(); - private PanelGroup groupPanel36 = new PanelGroup(); + public StaticText getLblTarefa() + { + return lblTarefa; + } - public PanelGroup getGroupPanel36() { - return groupPanel36; - } + public void setLblTarefa( StaticText st ) + { + this.lblTarefa = st; + } + private StaticText txtTarefa1 = new StaticText(); - public void setGroupPanel36(PanelGroup pg) { - this.groupPanel36 = pg; - } + public StaticText getTxtTarefa1() + { + return txtTarefa1; + } - private StaticText staticText127 = new StaticText(); + public void setTxtTarefa1( StaticText st ) + { + this.txtTarefa1 = st; + } + private HtmlPanelGrid gridSubstancias = new HtmlPanelGrid(); - public StaticText getStaticText127() { - return staticText127; - } + public HtmlPanelGrid getGridSubstancias() + { + return gridSubstancias; + } - public void setStaticText127(StaticText st) { - this.staticText127 = st; - } + public void setGridSubstancias( HtmlPanelGrid hpg ) + { + this.gridSubstancias = hpg; + } + private StaticText lblSubstancias = new StaticText(); - private Checkbox chkImgMa10 = new Checkbox(); + public StaticText getLblSubstancias() + { + return lblSubstancias; + } - public Checkbox getChkImgMa10() { - return chkImgMa10; - } + public void setLblSubstancias( StaticText st ) + { + this.lblSubstancias = st; + } + private StaticText txtSubstancias1 = new StaticText(); - public void setChkImgMa10(Checkbox c) { - this.chkImgMa10 = c; - } + public StaticText getTxtSubstancias1() + { + return txtSubstancias1; + } - private HtmlPanelGrid gridPanel81 = new HtmlPanelGrid(); + public void setTxtSubstancias1( StaticText st ) + { + this.txtSubstancias1 = st; + } + private HtmlPanelGrid gridCondicoes = new HtmlPanelGrid(); - public HtmlPanelGrid getGridPanel81() { - return gridPanel81; - } + public HtmlPanelGrid getGridCondicoes() + { + return gridCondicoes; + } - public void setGridPanel81(HtmlPanelGrid hpg) { - this.gridPanel81 = hpg; - } + public void setGridCondicoes( HtmlPanelGrid hpg ) + { + this.gridCondicoes = hpg; + } + private StaticText lblCondicoes = new StaticText(); - private StaticText staticText128 = new StaticText(); + public StaticText getLblCondicoes() + { + return lblCondicoes; + } - public StaticText getStaticText128() { - return staticText128; - } + public void setLblCondicoes( StaticText st ) + { + this.lblCondicoes = st; + } + private StaticText txtCondicoes1 = new StaticText(); - public void setStaticText128(StaticText st) { - this.staticText128 = st; - } + public StaticText getTxtCondicoes1() + { + return txtCondicoes1; + } - private PanelGroup groupPanel37 = new PanelGroup(); + public void setTxtCondicoes1( StaticText st ) + { + this.txtCondicoes1 = st; + } + private HtmlPanelGrid gridTestemunhas = new HtmlPanelGrid(); - public PanelGroup getGroupPanel37() { - return groupPanel37; - } + public HtmlPanelGrid getGridTestemunhas() + { + return gridTestemunhas; + } - public void setGroupPanel37(PanelGroup pg) { - this.groupPanel37 = pg; - } + public void setGridTestemunhas( HtmlPanelGrid hpg ) + { + this.gridTestemunhas = hpg; + } + private StaticText lblTestemunhas = new StaticText(); - private Checkbox chkRestricaoCargas = new Checkbox(); + public StaticText getLblTestemunhas() + { + return lblTestemunhas; + } - public Checkbox getChkRestricaoCargas() { - return chkRestricaoCargas; - } + public void setLblTestemunhas( StaticText st ) + { + this.lblTestemunhas = st; + } + private StaticText txtTestemunhas1 = new StaticText(); - public void setChkRestricaoCargas(Checkbox c) { - this.chkRestricaoCargas = c; - } + public StaticText getTxtTestemunhas1() + { + return txtTestemunhas1; + } - private StaticText staticText129 = new StaticText(); + public void setTxtTestemunhas1( StaticText st ) + { + this.txtTestemunhas1 = st; + } + private HtmlPanelGrid gridCausas = new HtmlPanelGrid(); - public StaticText getStaticText129() { - return staticText129; - } + public HtmlPanelGrid getGridCausas() + { + return gridCausas; + } - public void setStaticText129(StaticText st) { - this.staticText129 = st; - } + public void setGridCausas( HtmlPanelGrid hpg ) + { + this.gridCausas = hpg; + } + private StaticText lblCausas = new StaticText(); - private RadioButton rbKgs2 = new RadioButton(); + public StaticText getLblCausas() + { + return lblCausas; + } - public RadioButton getRbKgs2() { - return rbKgs2; - } + public void setLblCausas( StaticText st ) + { + this.lblCausas = st; + } + private StaticText txtCausas1 = new StaticText(); - public void setRbKgs2(RadioButton rb) { - this.rbKgs2 = rb; - } + public StaticText getTxtCausas1() + { + return txtCausas1; + } - private StaticText stKgs2 = new StaticText(); + public void setTxtCausas1( StaticText st ) + { + this.txtCausas1 = st; + } + private HtmlPanelGrid gridDescricao = new HtmlPanelGrid(); - public StaticText getStKgs2() { - return stKgs2; - } + public HtmlPanelGrid getGridDescricao() + { + return gridDescricao; + } - public void setStKgs2(StaticText st) { - this.stKgs2 = st; - } + public void setGridDescricao( HtmlPanelGrid hpg ) + { + this.gridDescricao = hpg; + } + private StaticText lblDescricao = new StaticText(); - private RadioButton rbKgs5 = new RadioButton(); + public StaticText getLblDescricao() + { + return lblDescricao; + } - public RadioButton getRbKgs5() { - return rbKgs5; - } + public void setLblDescricao( StaticText st ) + { + this.lblDescricao = st; + } + private StaticText txtDescricao1 = new StaticText(); - public void setRbKgs5(RadioButton rb) { - this.rbKgs5 = rb; - } + public StaticText getTxtDescricao1() + { + return txtDescricao1; + } - private StaticText stKgs5 = new StaticText(); + public void setTxtDescricao1( StaticText st ) + { + this.txtDescricao1 = st; + } + private HtmlPanelGrid gridFotografias = new HtmlPanelGrid(); - public StaticText getStKgs5() { - return stKgs5; - } + public HtmlPanelGrid getGridFotografias() + { + return gridFotografias; + } - public void setStKgs5(StaticText st) { - this.stKgs5 = st; - } + public void setGridFotografias( HtmlPanelGrid hpg ) + { + this.gridFotografias = hpg; + } + private HtmlPanelGrid gridPanel127 = new HtmlPanelGrid(); - private RadioButton rbKgs10 = new RadioButton(); + public HtmlPanelGrid getGridPanel127() + { + return gridPanel127; + } - public RadioButton getRbKgs10() { - return rbKgs10; - } + public void setGridPanel127( HtmlPanelGrid hpg ) + { + this.gridPanel127 = hpg; + } + private StaticText lblFotografias = new StaticText(); - public void setRbKgs10(RadioButton rb) { - this.rbKgs10 = rb; - } + public StaticText getLblFotografias() + { + return lblFotografias; + } - private StaticText stKgs10 = new StaticText(); + public void setLblFotografias( StaticText st ) + { + this.lblFotografias = st; + } + private HtmlPanelGrid gridImages1 = new HtmlPanelGrid(); - public StaticText getStKgs10() { - return stKgs10; - } + public HtmlPanelGrid getGridImages1() + { + return gridImages1; + } - public void setStKgs10(StaticText st) { - this.stKgs10 = st; - } + public void setGridImages1( HtmlPanelGrid hpg ) + { + this.gridImages1 = hpg; + } + private HtmlPanelGrid gridConclusoes = new HtmlPanelGrid(); - private RadioButton rbKgs15 = new RadioButton(); + public HtmlPanelGrid getGridConclusoes() + { + return gridConclusoes; + } - public RadioButton getRbKgs15() { - return rbKgs15; - } + public void setGridConclusoes( HtmlPanelGrid hpg ) + { + this.gridConclusoes = hpg; + } + private StaticText lblConclusoes = new StaticText(); - public void setRbKgs15(RadioButton rb) { - this.rbKgs15 = rb; - } + public StaticText getLblConclusoes() + { + return lblConclusoes; + } - private StaticText stKgs15 = new StaticText(); + public void setLblConclusoes( StaticText st ) + { + this.lblConclusoes = st; + } + private StaticText txtConclusoes1 = new StaticText(); - public StaticText getStKgs15() { - return stKgs15; - } + public StaticText getTxtConclusoes1() + { + return txtConclusoes1; + } - public void setStKgs15(StaticText st) { - this.stKgs15 = st; - } + public void setTxtConclusoes1( StaticText st ) + { + this.txtConclusoes1 = st; + } + private HtmlPanelGrid gridAccoes = new HtmlPanelGrid(); - private RadioButton rbKgsOutro = new RadioButton(); + public HtmlPanelGrid getGridAccoes() + { + return gridAccoes; + } - public RadioButton getRbKgsOutro() { - return rbKgsOutro; - } + public void setGridAccoes( HtmlPanelGrid hpg ) + { + this.gridAccoes = hpg; + } + private StaticText lblAccoes = new StaticText(); - public void setRbKgsOutro(RadioButton rb) { - this.rbKgsOutro = rb; - } + public StaticText getLblAccoes() + { + return lblAccoes; + } - private StaticText stKgsOutro = new StaticText(); + public void setLblAccoes( StaticText st ) + { + this.lblAccoes = st; + } + private StaticText txtAccoes1 = new StaticText(); - public StaticText getStKgsOutro() { - return stKgsOutro; - } + public StaticText getTxtAccoes1() + { + return txtAccoes1; + } - public void setStKgsOutro(StaticText st) { - this.stKgsOutro = st; - } + public void setTxtAccoes1( StaticText st ) + { + this.txtAccoes1 = st; + } + private HtmlPanelGrid gridDataHora = new HtmlPanelGrid(); - private TextField txtKgs = new TextField(); + public HtmlPanelGrid getGridDataHora() + { + return gridDataHora; + } - public TextField getTxtKgs() { - return txtKgs; - } + public void setGridDataHora( HtmlPanelGrid hpg ) + { + this.gridDataHora = hpg; + } + private PanelGroup groupPanel7 = new PanelGroup(); - public void setTxtKgs(TextField tf) { - this.txtKgs = tf; - } + public PanelGroup getGroupPanel7() + { + return groupPanel7; + } - private StaticText stKg = new StaticText(); + public void setGroupPanel7( PanelGroup pg ) + { + this.groupPanel7 = pg; + } + private StaticText lblDataAcidente = new StaticText(); - public StaticText getStKg() { - return stKg; - } + public StaticText getLblDataAcidente() + { + return lblDataAcidente; + } - public void setStKg(StaticText st) { - this.stKg = st; - } + public void setLblDataAcidente( StaticText st ) + { + this.lblDataAcidente = st; + } + private StaticText stDataAcidente1 = new StaticText(); - private PanelGroup groupPanel38 = new PanelGroup(); + public StaticText getStDataAcidente1() + { + return stDataAcidente1; + } - public PanelGroup getGroupPanel38() { - return groupPanel38; - } + public void setStDataAcidente1( StaticText st ) + { + this.stDataAcidente1 = st; + } + private PanelGroup groupPanel60 = new PanelGroup(); - public void setGroupPanel38(PanelGroup pg) { - this.groupPanel38 = pg; - } + public PanelGroup getGroupPanel60() + { + return groupPanel60; + } - private Checkbox chkRestricaoMotricidade = new Checkbox(); + public void setGroupPanel60( PanelGroup pg ) + { + this.groupPanel60 = pg; + } + private StaticText lblHoraAcidente = new StaticText(); - public Checkbox getChkRestricaoMotricidade() { - return chkRestricaoMotricidade; - } + public StaticText getLblHoraAcidente() + { + return lblHoraAcidente; + } - public void setChkRestricaoMotricidade(Checkbox c) { - this.chkRestricaoMotricidade = c; - } + public void setLblHoraAcidente( StaticText st ) + { + this.lblHoraAcidente = st; + } + private StaticText stHoraAcidente1 = new StaticText(); - private StaticText staticText136 = new StaticText(); + public StaticText getStHoraAcidente1() + { + return stHoraAcidente1; + } - public StaticText getStaticText136() { - return staticText136; - } + public void setStHoraAcidente1( StaticText st ) + { + this.stHoraAcidente1 = st; + } + private HtmlPanelGrid gridVerificacao = new HtmlPanelGrid(); - public void setStaticText136(StaticText st) { - this.staticText136 = st; - } + public HtmlPanelGrid getGridVerificacao() + { + return gridVerificacao; + } - private PanelGroup groupPanel39 = new PanelGroup(); + public void setGridVerificacao( HtmlPanelGrid hpg ) + { + this.gridVerificacao = hpg; + } + private HtmlPanelGrid gridPanel131 = new HtmlPanelGrid(); - public PanelGroup getGroupPanel39() { - return groupPanel39; - } + public HtmlPanelGrid getGridPanel131() + { + return gridPanel131; + } - public void setGroupPanel39(PanelGroup pg) { - this.groupPanel39 = pg; - } + public void setGridPanel131( HtmlPanelGrid hpg ) + { + this.gridPanel131 = hpg; + } + private StaticText staticText52 = new StaticText(); - private Checkbox chkRestricaoConducao = new Checkbox(); + public StaticText getStaticText52() + { + return staticText52; + } - public Checkbox getChkRestricaoConducao() { - return chkRestricaoConducao; - } + public void setStaticText52( StaticText st ) + { + this.staticText52 = st; + } + private HtmlPanelGrid gridPanel132 = new HtmlPanelGrid(); - public void setChkRestricaoConducao(Checkbox c) { - this.chkRestricaoConducao = c; - } + public HtmlPanelGrid getGridPanel132() + { + return gridPanel132; + } - private StaticText staticText137 = new StaticText(); + public void setGridPanel132( HtmlPanelGrid hpg ) + { + this.gridPanel132 = hpg; + } + private HtmlPanelGrid gridPanel133 = new HtmlPanelGrid(); - public StaticText getStaticText137() { - return staticText137; - } + public HtmlPanelGrid getGridPanel133() + { + return gridPanel133; + } - public void setStaticText137(StaticText st) { - this.staticText137 = st; - } + public void setGridPanel133( HtmlPanelGrid hpg ) + { + this.gridPanel133 = hpg; + } + private PanelGroup grpVerHs = new PanelGroup(); - private PanelGroup groupPanel40 = new PanelGroup(); + public PanelGroup getGrpVerHs() + { + return grpVerHs; + } - public PanelGroup getGroupPanel40() { - return groupPanel40; - } + public void setGrpVerHs( PanelGroup pg ) + { + this.grpVerHs = pg; + } + private Checkbox chkVerHs = new Checkbox(); - public void setGroupPanel40(PanelGroup pg) { - this.groupPanel40 = pg; - } + public Checkbox getChkVerHs() + { + return chkVerHs; + } - private Checkbox chkRestricaoVibracoes = new Checkbox(); + public void setChkVerHs( Checkbox c ) + { + this.chkVerHs = c; + } + private StaticText stVerHs = new StaticText(); - public Checkbox getChkRestricaoVibracoes() { - return chkRestricaoVibracoes; - } + public StaticText getStVerHs() + { + return stVerHs; + } - public void setChkRestricaoVibracoes(Checkbox c) { - this.chkRestricaoVibracoes = c; - } + public void setStVerHs( StaticText st ) + { + this.stVerHs = st; + } + private PanelGroup grpVerRespSeg = new PanelGroup(); - private StaticText staticText138 = new StaticText(); + public PanelGroup getGrpVerRespSeg() + { + return grpVerRespSeg; + } - public StaticText getStaticText138() { - return staticText138; - } + public void setGrpVerRespSeg( PanelGroup pg ) + { + this.grpVerRespSeg = pg; + } + private Checkbox chkVerRespSeg = new Checkbox(); - public void setStaticText138(StaticText st) { - this.staticText138 = st; - } + public Checkbox getChkVerRespSeg() + { + return chkVerRespSeg; + } - private HtmlPanelGrid gridPanel82 = new HtmlPanelGrid(); + public void setChkVerRespSeg( Checkbox c ) + { + this.chkVerRespSeg = c; + } + private StaticText stVerRespSeg = new StaticText(); - public HtmlPanelGrid getGridPanel82() { - return gridPanel82; - } + public StaticText getStVerRespSeg() + { + return stVerRespSeg; + } - public void setGridPanel82(HtmlPanelGrid hpg) { - this.gridPanel82 = hpg; - } + public void setStVerRespSeg( StaticText st ) + { + this.stVerRespSeg = st; + } + private PanelGroup grpVerRespRh = new PanelGroup(); - private PanelGroup groupPanel41 = new PanelGroup(); + public PanelGroup getGrpVerRespRh() + { + return grpVerRespRh; + } - public PanelGroup getGroupPanel41() { - return groupPanel41; - } + public void setGrpVerRespRh( PanelGroup pg ) + { + this.grpVerRespRh = pg; + } + private Checkbox chkVerRespRh = new Checkbox(); - public void setGroupPanel41(PanelGroup pg) { - this.groupPanel41 = pg; - } + public Checkbox getChkVerRespRh() + { + return chkVerRespRh; + } - private Checkbox chkRestricaoOutras = new Checkbox(); + public void setChkVerRespRh( Checkbox c ) + { + this.chkVerRespRh = c; + } + private StaticText stVerRespRh = new StaticText(); - public Checkbox getChkRestricaoOutras() { - return chkRestricaoOutras; - } + public StaticText getStVerRespRh() + { + return stVerRespRh; + } - public void setChkRestricaoOutras(Checkbox c) { - this.chkRestricaoOutras = c; - } + public void setStVerRespRh( StaticText st ) + { + this.stVerRespRh = st; + } + private HtmlPanelGrid gridVerificacaoView = new HtmlPanelGrid(); - private StaticText staticText139 = new StaticText(); + public HtmlPanelGrid getGridVerificacaoView() + { + return gridVerificacaoView; + } - public StaticText getStaticText139() { - return staticText139; - } + public void setGridVerificacaoView( HtmlPanelGrid hpg ) + { + this.gridVerificacaoView = hpg; + } + private HtmlPanelGrid gridPanel134 = new HtmlPanelGrid(); - public void setStaticText139(StaticText st) { - this.staticText139 = st; - } + public HtmlPanelGrid getGridPanel134() + { + return gridPanel134; + } - private TextField txtRestricaoOutras = new TextField(); + public void setGridPanel134( HtmlPanelGrid hpg ) + { + this.gridPanel134 = hpg; + } + private StaticText staticText187 = new StaticText(); - public TextField getTxtRestricaoOutras() { - return txtRestricaoOutras; - } + public StaticText getStaticText187() + { + return staticText187; + } - public void setTxtRestricaoOutras(TextField tf) { - this.txtRestricaoOutras = tf; - } + public void setStaticText187( StaticText st ) + { + this.staticText187 = st; + } + private HtmlPanelGrid gridPanel135 = new HtmlPanelGrid(); - private HtmlPanelGrid gridPanel83 = new HtmlPanelGrid(); + public HtmlPanelGrid getGridPanel135() + { + return gridPanel135; + } - public HtmlPanelGrid getGridPanel83() { - return gridPanel83; - } + public void setGridPanel135( HtmlPanelGrid hpg ) + { + this.gridPanel135 = hpg; + } + private HtmlPanelGrid gridAssinaturasView = new HtmlPanelGrid(); - public void setGridPanel83(HtmlPanelGrid hpg) { - this.gridPanel83 = hpg; - } + public HtmlPanelGrid getGridAssinaturasView() + { + return gridAssinaturasView; + } - private StaticText staticText140 = new StaticText(); + public void setGridAssinaturasView( HtmlPanelGrid hpg ) + { + this.gridAssinaturasView = hpg; + } + private DropDown drpCausas = new DropDown(); - public StaticText getStaticText140() { - return staticText140; - } + public DropDown getDrpCausas() + { + return drpCausas; + } - public void setStaticText140(StaticText st) { - this.staticText140 = st; - } + public void setDrpCausas( DropDown dd ) + { + this.drpCausas = dd; + } + private StaticText stObservacoesCorr = new StaticText(); - private TextField txtObservacoes = new TextField(); + public StaticText getStObservacoesCorr() + { + return stObservacoesCorr; + } - public TextField getTxtObservacoes() { - return txtObservacoes; - } + public void setStObservacoesCorr( StaticText st ) + { + this.stObservacoesCorr = st; + } + private HtmlPanelGrid gridImpressao = new HtmlPanelGrid(); - public void setTxtObservacoes(TextField tf) { - this.txtObservacoes = tf; - } + public HtmlPanelGrid getGridImpressao() + { + return gridImpressao; + } - private RadioButton rbIncapacidadePerm = new RadioButton(); + public void setGridImpressao( HtmlPanelGrid hpg ) + { + this.gridImpressao = hpg; + } + private HtmlPanelGrid gridPanel89 = new HtmlPanelGrid(); - public RadioButton getRbIncapacidadePerm() { - return rbIncapacidadePerm; - } + public HtmlPanelGrid getGridPanel89() + { + return gridPanel89; + } - public void setRbIncapacidadePerm(RadioButton rb) { - this.rbIncapacidadePerm = rb; - } + public void setGridPanel89( HtmlPanelGrid hpg ) + { + this.gridPanel89 = hpg; + } + private StaticText staticText73 = new StaticText(); - private StaticText staticText141 = new StaticText(); + public StaticText getStaticText73() + { + return staticText73; + } - public StaticText getStaticText141() { - return staticText141; - } + public void setStaticText73( StaticText st ) + { + this.staticText73 = st; + } + private HtmlPanelGrid gridPanel91 = new HtmlPanelGrid(); - public void setStaticText141(StaticText st) { - this.staticText141 = st; - } + public HtmlPanelGrid getGridPanel91() + { + return gridPanel91; + } - private ImageComponent image17 = new ImageComponent(); + public void setGridPanel91( HtmlPanelGrid hpg ) + { + this.gridPanel91 = hpg; + } + private HtmlPanelGrid gridPanel92 = new HtmlPanelGrid(); - public ImageComponent getImage17() { - return image17; - } + public HtmlPanelGrid getGridPanel92() + { + return gridPanel92; + } - public void setImage17(ImageComponent ic) { - this.image17 = ic; - } + public void setGridPanel92( HtmlPanelGrid hpg ) + { + this.gridPanel92 = hpg; + } + private PanelGroup grpAssSup = new PanelGroup(); - private ImageComponent image18 = new ImageComponent(); + public PanelGroup getGrpAssSup() + { + return grpAssSup; + } - public ImageComponent getImage18() { - return image18; - } + public void setGrpAssSup( PanelGroup pg ) + { + this.grpAssSup = pg; + } + private Checkbox chkAssSup = new Checkbox(); - public void setImage18(ImageComponent ic) { - this.image18 = ic; - } + public Checkbox getChkAssSup() + { + return chkAssSup; + } - private HtmlPanelGrid gridPanel84 = new HtmlPanelGrid(); + public void setChkAssSup( Checkbox c ) + { + this.chkAssSup = c; + } + private StaticText stAssSup1 = new StaticText(); - public HtmlPanelGrid getGridPanel84() { - return gridPanel84; - } + public StaticText getStAssSup1() + { + return stAssSup1; + } - public void setGridPanel84(HtmlPanelGrid hpg) { - this.gridPanel84 = hpg; - } + public void setStAssSup1( StaticText st ) + { + this.stAssSup1 = st; + } + private HtmlPanelGrid gridImpressaoView = new HtmlPanelGrid(); - private ImageComponent image19 = new ImageComponent(); + public HtmlPanelGrid getGridImpressaoView() + { + return gridImpressaoView; + } - public ImageComponent getImage19() { - return image19; - } + public void setGridImpressaoView( HtmlPanelGrid hpg ) + { + this.gridImpressaoView = hpg; + } + private HtmlPanelGrid gridPanel93 = new HtmlPanelGrid(); - public void setImage19(ImageComponent ic) { - this.image19 = ic; - } + public HtmlPanelGrid getGridPanel93() + { + return gridPanel93; + } - private ImageComponent image20 = new ImageComponent(); + public void setGridPanel93( HtmlPanelGrid hpg ) + { + this.gridPanel93 = hpg; + } + private StaticText staticText76 = new StaticText(); - public ImageComponent getImage20() { - return image20; - } + public StaticText getStaticText76() + { + return staticText76; + } - public void setImage20(ImageComponent ic) { - this.image20 = ic; - } + public void setStaticText76( StaticText st ) + { + this.staticText76 = st; + } + private HtmlPanelGrid gridPanel94 = new HtmlPanelGrid(); - private PanelGroup groupPanel42 = new PanelGroup(); + public HtmlPanelGrid getGridPanel94() + { + return gridPanel94; + } - public PanelGroup getGroupPanel42() { - return groupPanel42; - } + public void setGridPanel94( HtmlPanelGrid hpg ) + { + this.gridPanel94 = hpg; + } + private HtmlPanelGrid gridAssSupView = new HtmlPanelGrid(); - public void setGroupPanel42(PanelGroup pg) { - this.groupPanel42 = pg; - } + public HtmlPanelGrid getGridAssSupView() + { + return gridAssSupView; + } - private StaticText staticText142 = new StaticText(); + public void setGridAssSupView( HtmlPanelGrid hpg ) + { + this.gridAssSupView = hpg; + } + private HtmlPanelGrid gridPanel22 = new HtmlPanelGrid(); - public StaticText getStaticText142() { - return staticText142; - } + public HtmlPanelGrid getGridPanel22() + { + return gridPanel22; + } - public void setStaticText142(StaticText st) { - this.staticText142 = st; - } + public void setGridPanel22( HtmlPanelGrid hpg ) + { + this.gridPanel22 = hpg; + } + private Button butCancelar = new Button(); - private Checkbox chkImgRot1 = new Checkbox(); + public Button getButCancelar() + { + return butCancelar; + } - public Checkbox getChkImgRot1() { - return chkImgRot1; - } + public void setButCancelar( Button b ) + { + this.butCancelar = b; + } + private PanelGroup groupPanel5 = new PanelGroup(); - public void setChkImgRot1(Checkbox c) { - this.chkImgRot1 = c; - } + public PanelGroup getGroupPanel5() + { + return groupPanel5; + } - private PanelGroup groupPanel43 = new PanelGroup(); + public void setGroupPanel5( PanelGroup pg ) + { + this.groupPanel5 = pg; + } + private Button butImprimir = new Button(); - public PanelGroup getGroupPanel43() { - return groupPanel43; - } + public Button getButImprimir() + { + return butImprimir; + } - public void setGroupPanel43(PanelGroup pg) { - this.groupPanel43 = pg; - } + public void setButImprimir( Button b ) + { + this.butImprimir = b; + } + private Button butGravar = new Button(); - private StaticText staticText143 = new StaticText(); + public Button getButGravar() + { + return butGravar; + } - public StaticText getStaticText143() { - return staticText143; - } + public void setButGravar( Button b ) + { + this.butGravar = b; + } + private Button butCorrecao = new Button(); - public void setStaticText143(StaticText st) { - this.staticText143 = st; - } + public Button getButCorrecao() + { + return butCorrecao; + } - private Checkbox chkImgRot2 = new Checkbox(); + public void setButCorrecao( Button b ) + { + this.butCorrecao = b; + } + private Button butEnviar = new Button(); - public Checkbox getChkImgRot2() { - return chkImgRot2; - } + public Button getButEnviar() + { + return butEnviar; + } - public void setChkImgRot2(Checkbox c) { - this.chkImgRot2 = c; - } + public void setButEnviar( Button b ) + { + this.butEnviar = b; + } + private TextField txtAssSup = new TextField(); - private ImageComponent image21 = new ImageComponent(); + public TextField getTxtAssSup() + { + return txtAssSup; + } - public ImageComponent getImage21() { - return image21; - } + public void setTxtAssSup( TextField tf ) + { + this.txtAssSup = tf; + } + private StaticText stAssSup2 = new StaticText(); - public void setImage21(ImageComponent ic) { - this.image21 = ic; - } + public StaticText getStAssSup2() + { + return stAssSup2; + } - private ImageComponent image11 = new ImageComponent(); + public void setStAssSup2( StaticText st ) + { + this.stAssSup2 = st; + } + private HtmlPanelGrid gridPanel95 = new HtmlPanelGrid(); - public ImageComponent getImage11() { - return image11; - } + public HtmlPanelGrid getGridPanel95() + { + return gridPanel95; + } - public void setImage11(ImageComponent ic) { - this.image11 = ic; - } + public void setGridPanel95( HtmlPanelGrid hpg ) + { + this.gridPanel95 = hpg; + } + private PanelGroup groupPanel50 = new PanelGroup(); - private PanelGroup groupPanel44 = new PanelGroup(); + public PanelGroup getGroupPanel50() + { + return groupPanel50; + } - public PanelGroup getGroupPanel44() { - return groupPanel44; - } + public void setGroupPanel50( PanelGroup pg ) + { + this.groupPanel50 = pg; + } + private StaticText staticText98 = new StaticText(); - public void setGroupPanel44(PanelGroup pg) { - this.groupPanel44 = pg; - } + public StaticText getStaticText98() + { + return staticText98; + } - private StaticText staticText144 = new StaticText(); + public void setStaticText98( StaticText st ) + { + this.staticText98 = st; + } + private TextField txtAveriguador = new TextField(); - public StaticText getStaticText144() { - return staticText144; - } + public TextField getTxtAveriguador() + { + return txtAveriguador; + } - public void setStaticText144(StaticText st) { - this.staticText144 = st; - } + public void setTxtAveriguador( TextField tf ) + { + this.txtAveriguador = tf; + } + private HtmlPanelGrid gridPanel96 = new HtmlPanelGrid(); - private Checkbox chkImgCab1 = new Checkbox(); + public HtmlPanelGrid getGridPanel96() + { + return gridPanel96; + } - public Checkbox getChkImgCab1() { - return chkImgCab1; - } + public void setGridPanel96( HtmlPanelGrid hpg ) + { + this.gridPanel96 = hpg; + } + private PanelGroup groupPanel51 = new PanelGroup(); - public void setChkImgCab1(Checkbox c) { - this.chkImgCab1 = c; - } + public PanelGroup getGroupPanel51() + { + return groupPanel51; + } - private PanelGroup groupPanel45 = new PanelGroup(); + public void setGroupPanel51( PanelGroup pg ) + { + this.groupPanel51 = pg; + } + private StaticText staticText101 = new StaticText(); - public PanelGroup getGroupPanel45() { - return groupPanel45; - } + public StaticText getStaticText101() + { + return staticText101; + } - public void setGroupPanel45(PanelGroup pg) { - this.groupPanel45 = pg; - } + public void setStaticText101( StaticText st ) + { + this.staticText101 = st; + } + private StaticText stAveriguador = new StaticText(); - private StaticText staticText145 = new StaticText(); + public StaticText getStAveriguador() + { + return stAveriguador; + } - public StaticText getStaticText145() { - return staticText145; - } + public void setStAveriguador( StaticText st ) + { + this.stAveriguador = st; + } + private HtmlPanelGrid gridPanel97 = new HtmlPanelGrid(); - public void setStaticText145(StaticText st) { - this.staticText145 = st; - } + public HtmlPanelGrid getGridPanel97() + { + return gridPanel97; + } - private Checkbox chkImgCab4 = new Checkbox(); + public void setGridPanel97( HtmlPanelGrid hpg ) + { + this.gridPanel97 = hpg; + } + private PanelGroup groupPanel52 = new PanelGroup(); - public Checkbox getChkImgCab4() { - return chkImgCab4; - } + public PanelGroup getGroupPanel52() + { + return groupPanel52; + } - public void setChkImgCab4(Checkbox c) { - this.chkImgCab4 = c; - } + public void setGroupPanel52( PanelGroup pg ) + { + this.groupPanel52 = pg; + } + private Checkbox chkAveriguacaoPosterior = new Checkbox(); - private ImageComponent image22 = new ImageComponent(); + public Checkbox getChkAveriguacaoPosterior() + { + return chkAveriguacaoPosterior; + } - public ImageComponent getImage22() { - return image22; - } + public void setChkAveriguacaoPosterior( Checkbox c ) + { + this.chkAveriguacaoPosterior = c; + } + private StaticText staticText132 = new StaticText(); - public void setImage22(ImageComponent ic) { - this.image22 = ic; - } + public StaticText getStaticText132() + { + return staticText132; + } - private ImageComponent image23 = new ImageComponent(); + public void setStaticText132( StaticText st ) + { + this.staticText132 = st; + } + private HtmlPanelGrid gridPanel98 = new HtmlPanelGrid(); - public ImageComponent getImage23() { - return image23; - } + public HtmlPanelGrid getGridPanel98() + { + return gridPanel98; + } - public void setImage23(ImageComponent ic) { - this.image23 = ic; - } + public void setGridPanel98( HtmlPanelGrid hpg ) + { + this.gridPanel98 = hpg; + } + private StaticText staticText104 = new StaticText(); - private ImageComponent image24 = new ImageComponent(); + public StaticText getStaticText104() + { + return staticText104; + } - public ImageComponent getImage24() { - return image24; - } + public void setStaticText104( StaticText st ) + { + this.staticText104 = st; + } + private HtmlPanelGrid gridPanel99 = new HtmlPanelGrid(); - public void setImage24(ImageComponent ic) { - this.image24 = ic; - } + public HtmlPanelGrid getGridPanel99() + { + return gridPanel99; + } - private PanelGroup groupPanel46 = new PanelGroup(); + public void setGridPanel99( HtmlPanelGrid hpg ) + { + this.gridPanel99 = hpg; + } + private StaticText staticText131 = new StaticText(); - public PanelGroup getGroupPanel46() { - return groupPanel46; - } + public StaticText getStaticText131() + { + return staticText131; + } - public void setGroupPanel46(PanelGroup pg) { - this.groupPanel46 = pg; - } + public void setStaticText131( StaticText st ) + { + this.staticText131 = st; + } + private TextArea txtAveriguacaoObs = new TextArea(); - private StaticText staticText146 = new StaticText(); + public TextArea getTxtAveriguacaoObs() + { + return txtAveriguacaoObs; + } - public StaticText getStaticText146() { - return staticText146; - } + public void setTxtAveriguacaoObs( TextArea ta ) + { + this.txtAveriguacaoObs = ta; + } + private HtmlPanelGrid gridAveriguacaoPosterior = new HtmlPanelGrid(); - public void setStaticText146(StaticText st) { - this.staticText146 = st; - } + public HtmlPanelGrid getGridAveriguacaoPosterior() + { + return gridAveriguacaoPosterior; + } - private Checkbox chkImgMa1 = new Checkbox(); + public void setGridAveriguacaoPosterior( HtmlPanelGrid hpg ) + { + this.gridAveriguacaoPosterior = hpg; + } + private StaticText lblAveriguacaoPosterior = new StaticText(); - public Checkbox getChkImgMa1() { - return chkImgMa1; - } + public StaticText getLblAveriguacaoPosterior() + { + return lblAveriguacaoPosterior; + } - public void setChkImgMa1(Checkbox c) { - this.chkImgMa1 = c; - } + public void setLblAveriguacaoPosterior( StaticText st ) + { + this.lblAveriguacaoPosterior = st; + } + private StaticText txtAveriguacaoPosterior = new StaticText(); - private PanelGroup groupPanel47 = new PanelGroup(); + public StaticText getTxtAveriguacaoPosterior() + { + return txtAveriguacaoPosterior; + } - public PanelGroup getGroupPanel47() { - return groupPanel47; - } + public void setTxtAveriguacaoPosterior( StaticText st ) + { + this.txtAveriguacaoPosterior = st; + } + private HtmlPanelGrid gridAveriguacaoPosterior1 = new HtmlPanelGrid(); - public void setGroupPanel47(PanelGroup pg) { - this.groupPanel47 = pg; - } + public HtmlPanelGrid getGridAveriguacaoPosterior1() + { + return gridAveriguacaoPosterior1; + } - private StaticText staticText147 = new StaticText(); + public void setGridAveriguacaoPosterior1( HtmlPanelGrid hpg ) + { + this.gridAveriguacaoPosterior1 = hpg; + } + private HtmlPanelGrid gridPanel101 = new HtmlPanelGrid(); - public StaticText getStaticText147() { - return staticText147; - } + public HtmlPanelGrid getGridPanel101() + { + return gridPanel101; + } - public void setStaticText147(StaticText st) { - this.staticText147 = st; - } + public void setGridPanel101( HtmlPanelGrid hpg ) + { + this.gridPanel101 = hpg; + } + private StaticText staticText134 = new StaticText(); - private Checkbox chkImgMa4 = new Checkbox(); + public StaticText getStaticText134() + { + return staticText134; + } - public Checkbox getChkImgMa4() { - return chkImgMa4; - } + public void setStaticText134( StaticText st ) + { + this.staticText134 = st; + } + private HtmlPanelGrid gridPanel102 = new HtmlPanelGrid(); - public void setChkImgMa4(Checkbox c) { - this.chkImgMa4 = c; - } + public HtmlPanelGrid getGridPanel102() + { + return gridPanel102; + } - private ImageComponent image25 = new ImageComponent(); + public void setGridPanel102( HtmlPanelGrid hpg ) + { + this.gridPanel102 = hpg; + } + private StaticText staticText135 = new StaticText(); - public ImageComponent getImage25() { - return image25; - } + public StaticText getStaticText135() + { + return staticText135; + } - public void setImage25(ImageComponent ic) { - this.image25 = ic; - } + public void setStaticText135( StaticText st ) + { + this.staticText135 = st; + } + private TextArea txtAveriguacaoObs1 = new TextArea(); - private ImageComponent image26 = new ImageComponent(); + public TextArea getTxtAveriguacaoObs1() + { + return txtAveriguacaoObs1; + } - public ImageComponent getImage26() { - return image26; - } + public void setTxtAveriguacaoObs1( TextArea ta ) + { + this.txtAveriguacaoObs1 = ta; + } + private StaticText staticText130 = new StaticText(); - public void setImage26(ImageComponent ic) { - this.image26 = ic; - } + public StaticText getStaticText130() + { + return staticText130; + } - private PanelGroup groupPanel48 = new PanelGroup(); + public void setStaticText130( StaticText st ) + { + this.staticText130 = st; + } + private StaticText stEstabelecimentoOrigem = new StaticText(); - public PanelGroup getGroupPanel48() { - return groupPanel48; - } + public StaticText getStEstabelecimentoOrigem() + { + return stEstabelecimentoOrigem; + } - public void setGroupPanel48(PanelGroup pg) { - this.groupPanel48 = pg; - } + public void setStEstabelecimentoOrigem( StaticText st ) + { + this.stEstabelecimentoOrigem = st; + } + private HtmlPanelGrid gridPanel100 = new HtmlPanelGrid(); - private StaticText staticText148 = new StaticText(); + public HtmlPanelGrid getGridPanel100() + { + return gridPanel100; + } - public StaticText getStaticText148() { - return staticText148; - } + public void setGridPanel100( HtmlPanelGrid hpg ) + { + this.gridPanel100 = hpg; + } + private StaticText staticText156 = new StaticText(); - public void setStaticText148(StaticText st) { - this.staticText148 = st; - } + public StaticText getStaticText156() + { + return staticText156; + } - private Checkbox chkImgMa7 = new Checkbox(); + public void setStaticText156( StaticText st ) + { + this.staticText156 = st; + } + private HtmlPanelGrid gridPanel103 = new HtmlPanelGrid(); - public Checkbox getChkImgMa7() { - return chkImgMa7; - } + public HtmlPanelGrid getGridPanel103() + { + return gridPanel103; + } - public void setChkImgMa7(Checkbox c) { - this.chkImgMa7 = c; - } + public void setGridPanel103( HtmlPanelGrid hpg ) + { + this.gridPanel103 = hpg; + } + private PanelGroup groupPanel53 = new PanelGroup(); - private PanelGroup groupPanel49 = new PanelGroup(); + public PanelGroup getGroupPanel53() + { + return groupPanel53; + } - public PanelGroup getGroupPanel49() { - return groupPanel49; - } + public void setGroupPanel53( PanelGroup pg ) + { + this.groupPanel53 = pg; + } + private StaticText staticText157 = new StaticText(); - public void setGroupPanel49(PanelGroup pg) { - this.groupPanel49 = pg; - } + public StaticText getStaticText157() + { + return staticText157; + } - private StaticText staticText149 = new StaticText(); + public void setStaticText157( StaticText st ) + { + this.staticText157 = st; + } + private TextField txtNomeSuperior = new TextField(); - public StaticText getStaticText149() { - return staticText149; - } + public TextField getTxtNomeSuperior() + { + return txtNomeSuperior; + } - public void setStaticText149(StaticText st) { - this.staticText149 = st; - } + public void setTxtNomeSuperior( TextField tf ) + { + this.txtNomeSuperior = tf; + } + private PanelGroup groupPanel54 = new PanelGroup(); - private Checkbox chkImgMa9 = new Checkbox(); + public PanelGroup getGroupPanel54() + { + return groupPanel54; + } - public Checkbox getChkImgMa9() { - return chkImgMa9; - } + public void setGroupPanel54( PanelGroup pg ) + { + this.groupPanel54 = pg; + } + private StaticText staticText158 = new StaticText(); - public void setChkImgMa9(Checkbox c) { - this.chkImgMa9 = c; - } + public StaticText getStaticText158() + { + return staticText158; + } - private HtmlPanelGrid gridMedicoView = new HtmlPanelGrid(); + public void setStaticText158( StaticText st ) + { + this.staticText158 = st; + } + private TextField txtEmailSuperior = new TextField(); - public HtmlPanelGrid getGridMedicoView() { - return gridMedicoView; - } + public TextField getTxtEmailSuperior() + { + return txtEmailSuperior; + } - public void setGridMedicoView(HtmlPanelGrid hpg) { - this.gridMedicoView = hpg; - } + public void setTxtEmailSuperior( TextField tf ) + { + this.txtEmailSuperior = tf; + } + private HtmlPanelGrid gridPanel104 = new HtmlPanelGrid(); - private HtmlPanelGrid gridPanel85 = new HtmlPanelGrid(); + public HtmlPanelGrid getGridPanel104() + { + return gridPanel104; + } - public HtmlPanelGrid getGridPanel85() { - return gridPanel85; - } + public void setGridPanel104( HtmlPanelGrid hpg ) + { + this.gridPanel104 = hpg; + } + private StaticText staticText159 = new StaticText(); - public void setGridPanel85(HtmlPanelGrid hpg) { - this.gridPanel85 = hpg; - } + public StaticText getStaticText159() + { + return staticText159; + } - private StaticText staticText150 = new StaticText(); + public void setStaticText159( StaticText st ) + { + this.staticText159 = st; + } + private HtmlPanelGrid gridPanel105 = new HtmlPanelGrid(); - public StaticText getStaticText150() { - return staticText150; - } + public HtmlPanelGrid getGridPanel105() + { + return gridPanel105; + } - public void setStaticText150(StaticText st) { - this.staticText150 = st; - } + public void setGridPanel105( HtmlPanelGrid hpg ) + { + this.gridPanel105 = hpg; + } + private PanelGroup groupPanel55 = new PanelGroup(); - private HtmlPanelGrid gridLesao = new HtmlPanelGrid(); + public PanelGroup getGroupPanel55() + { + return groupPanel55; + } - public HtmlPanelGrid getGridLesao() { - return gridLesao; - } + public void setGroupPanel55( PanelGroup pg ) + { + this.groupPanel55 = pg; + } + private StaticText staticText160 = new StaticText(); - public void setGridLesao(HtmlPanelGrid hpg) { - this.gridLesao = hpg; - } + public StaticText getStaticText160() + { + return staticText160; + } - private StaticText staticText151 = new StaticText(); + public void setStaticText160( StaticText st ) + { + this.staticText160 = st; + } + private StaticText stNomeSuperior = new StaticText(); - public StaticText getStaticText151() { - return staticText151; - } + public StaticText getStNomeSuperior() + { + return stNomeSuperior; + } - public void setStaticText151(StaticText st) { - this.staticText151 = st; - } + public void setStNomeSuperior( StaticText st ) + { + this.stNomeSuperior = st; + } + private PanelGroup groupPanel61 = new PanelGroup(); - private HtmlPanelGrid gridPanel86 = new HtmlPanelGrid(); + public PanelGroup getGroupPanel61() + { + return groupPanel61; + } - public HtmlPanelGrid getGridPanel86() { - return gridPanel86; - } + public void setGroupPanel61( PanelGroup pg ) + { + this.groupPanel61 = pg; + } + private StaticText staticText162 = new StaticText(); - public void setGridPanel86(HtmlPanelGrid hpg) { - this.gridPanel86 = hpg; - } + public StaticText getStaticText162() + { + return staticText162; + } - private StaticText staticText152 = new StaticText(); + public void setStaticText162( StaticText st ) + { + this.staticText162 = st; + } + private StaticText stEmailSuperior = new StaticText(); - public StaticText getStaticText152() { - return staticText152; - } + public StaticText getStEmailSuperior() + { + return stEmailSuperior; + } - public void setStaticText152(StaticText st) { - this.staticText152 = st; - } + public void setStEmailSuperior( StaticText st ) + { + this.stEmailSuperior = st; + } + private HiddenField hidDisableImprimir = new HiddenField(); - private HtmlPanelGrid gridIncapacidade2 = new HtmlPanelGrid(); + public HiddenField getHidDisableImprimir() + { + return hidDisableImprimir; + } - public HtmlPanelGrid getGridIncapacidade2() { - return gridIncapacidade2; - } + public void setHidDisableImprimir( HiddenField hf ) + { + this.hidDisableImprimir = hf; + } + private DropDown drpSeccao = new DropDown(); - public void setGridIncapacidade2(HtmlPanelGrid hpg) { - this.gridIncapacidade2 = hpg; - } + public DropDown getDrpSeccao() + { + return drpSeccao; + } - private HtmlPanelGrid gridPanel87 = new HtmlPanelGrid(); + public void setDrpSeccao( DropDown dd ) + { + this.drpSeccao = dd; + } + private StaticText staticText163 = new StaticText(); - public HtmlPanelGrid getGridPanel87() { - return gridPanel87; - } + public StaticText getStaticText163() + { + return staticText163; + } - public void setGridPanel87(HtmlPanelGrid hpg) { - this.gridPanel87 = hpg; - } + public void setStaticText163( StaticText st ) + { + this.staticText163 = st; + } + private DropDown drpDepartamento = new DropDown(); - private StaticText staticText153 = new StaticText(); + public DropDown getDrpDepartamento() + { + return drpDepartamento; + } - public StaticText getStaticText153() { - return staticText153; - } + public void setDrpDepartamento( DropDown dd ) + { + this.drpDepartamento = dd; + } + private HiddenField hidAnchor = new HiddenField(); - public void setStaticText153(StaticText st) { - this.staticText153 = st; - } + public HiddenField getHidAnchor() + { + return hidAnchor; + } - private HtmlPanelGrid gridRestricoes1 = new HtmlPanelGrid(); + public void setHidAnchor( HiddenField hf ) + { + this.hidAnchor = hf; + } + private PanelGroup groupPanel62 = new PanelGroup(); - public HtmlPanelGrid getGridRestricoes1() { - return gridRestricoes1; - } + public PanelGroup getGroupPanel62() + { + return groupPanel62; + } - public void setGridRestricoes1(HtmlPanelGrid hpg) { - this.gridRestricoes1 = hpg; - } + public void setGroupPanel62( PanelGroup pg ) + { + this.groupPanel62 = pg; + } + private StaticText staticText164 = new StaticText(); - private HtmlPanelGrid gridPanel88 = new HtmlPanelGrid(); + public StaticText getStaticText164() + { + return staticText164; + } - public HtmlPanelGrid getGridPanel88() { - return gridPanel88; - } + public void setStaticText164( StaticText st ) + { + this.staticText164 = st; + } + private StaticText staticText167 = new StaticText(); - public void setGridPanel88(HtmlPanelGrid hpg) { - this.gridPanel88 = hpg; - } + public StaticText getStaticText167() + { + return staticText167; + } - private HtmlPanelGrid gridImagesRestricoes = new HtmlPanelGrid(); + public void setStaticText167( StaticText st ) + { + this.staticText167 = st; + } + private PanelGroup groupPanel63 = new PanelGroup(); - public HtmlPanelGrid getGridImagesRestricoes() { - return gridImagesRestricoes; - } + public PanelGroup getGroupPanel63() + { + return groupPanel63; + } - public void setGridImagesRestricoes(HtmlPanelGrid hpg) { - this.gridImagesRestricoes = hpg; - } + public void setGroupPanel63( PanelGroup pg ) + { + this.groupPanel63 = pg; + } + private StaticText staticText171 = new StaticText(); - private HtmlPanelGrid gridOutrasRestricoes = new HtmlPanelGrid(); + public StaticText getStaticText171() + { + return staticText171; + } - public HtmlPanelGrid getGridOutrasRestricoes() { - return gridOutrasRestricoes; - } + public void setStaticText171( StaticText st ) + { + this.staticText171 = st; + } + private StaticText stTecnicoNome = new StaticText(); - public void setGridOutrasRestricoes(HtmlPanelGrid hpg) { - this.gridOutrasRestricoes = hpg; - } + public StaticText getStTecnicoNome() + { + return stTecnicoNome; + } - private StaticText staticText154 = new StaticText(); + public void setStTecnicoNome( StaticText st ) + { + this.stTecnicoNome = st; + } + private StaticText staticText172 = new StaticText(); - public StaticText getStaticText154() { - return staticText154; - } + public StaticText getStaticText172() + { + return staticText172; + } - public void setStaticText154(StaticText st) { - this.staticText154 = st; - } + public void setStaticText172( StaticText st ) + { + this.staticText172 = st; + } + private StaticText staticText173 = new StaticText(); - private HtmlPanelGrid gridPanel90 = new HtmlPanelGrid(); + public StaticText getStaticText173() + { + return staticText173; + } - public HtmlPanelGrid getGridPanel90() { - return gridPanel90; - } + public void setStaticText173( StaticText st ) + { + this.staticText173 = st; + } + private StaticText txtCap1 = new StaticText(); - public void setGridPanel90(HtmlPanelGrid hpg) { - this.gridPanel90 = hpg; - } + public StaticText getTxtCap1() + { + return txtCap1; + } - private StaticText staticText155 = new StaticText(); + public void setTxtCap1( StaticText st ) + { + this.txtCap1 = st; + } + private PanelGroup groupPanel64 = new PanelGroup(); - public StaticText getStaticText155() { - return staticText155; - } + public PanelGroup getGroupPanel64() + { + return groupPanel64; + } - public void setStaticText155(StaticText st) { - this.staticText155 = st; - } + public void setGroupPanel64( PanelGroup pg ) + { + this.groupPanel64 = pg; + } + private StaticText staticText174 = new StaticText(); - private StaticText stObservacoes = new StaticText(); + public StaticText getStaticText174() + { + return staticText174; + } - public StaticText getStObservacoes() { - return stObservacoes; - } + public void setStaticText174( StaticText st ) + { + this.staticText174 = st; + } + private StaticText stMedicoNome = new StaticText(); - public void setStObservacoes(StaticText st) { - this.stObservacoes = st; - } + public StaticText getStMedicoNome() + { + return stMedicoNome; + } - private HtmlPanelGrid gridHeader1 = new HtmlPanelGrid(); + public void setStMedicoNome( StaticText st ) + { + this.stMedicoNome = st; + } + private StaticText staticText175 = new StaticText(); - public HtmlPanelGrid getGridHeader1() { - return gridHeader1; - } + public StaticText getStaticText175() + { + return staticText175; + } - public void setGridHeader1(HtmlPanelGrid hpg) { - this.gridHeader1 = hpg; - } + public void setStaticText175( StaticText st ) + { + this.staticText175 = st; + } + private StaticText staticText176 = new StaticText(); - private HtmlPanelGrid gridPanel114 = new HtmlPanelGrid(); + public StaticText getStaticText176() + { + return staticText176; + } - public HtmlPanelGrid getGridPanel114() { - return gridPanel114; - } + public void setStaticText176( StaticText st ) + { + this.staticText176 = st; + } + private StaticText txtCedula1 = new StaticText(); - public void setGridPanel114(HtmlPanelGrid hpg) { - this.gridPanel114 = hpg; - } + public StaticText getTxtCedula1() + { + return txtCedula1; + } - private PanelGroup groupPanel57 = new PanelGroup(); + public void setTxtCedula1( StaticText st ) + { + this.txtCedula1 = st; + } + private HtmlPanelGrid gridPanel14 = new HtmlPanelGrid(); - public PanelGroup getGroupPanel57() { - return groupPanel57; - } + public HtmlPanelGrid getGridPanel14() + { + return gridPanel14; + } - public void setGroupPanel57(PanelGroup pg) { - this.groupPanel57 = pg; - } + public void setGridPanel14( HtmlPanelGrid hpg ) + { + this.gridPanel14 = hpg; + } + private StaticText staticText15 = new StaticText(); - private ImageComponent image27 = new ImageComponent(); + public StaticText getStaticText15() + { + return staticText15; + } - public ImageComponent getImage27() { - return image27; - } + public void setStaticText15( StaticText st ) + { + this.staticText15 = st; + } + private com.sun.rave.web.ui.component.Calendar calDataOcorrencia = new com.sun.rave.web.ui.component.Calendar(); - public void setImage27(ImageComponent ic) { - this.image27 = ic; - } + public com.sun.rave.web.ui.component.Calendar getCalDataOcorrencia() + { + return calDataOcorrencia; + } - private HtmlPanelGrid gridPanel115 = new HtmlPanelGrid(); + public void setCalDataOcorrencia( com.sun.rave.web.ui.component.Calendar c ) + { + this.calDataOcorrencia = c; + } + private PanelGroup groupPanel9 = new PanelGroup(); - public HtmlPanelGrid getGridPanel115() { - return gridPanel115; - } + public PanelGroup getGroupPanel9() + { + return groupPanel9; + } - public void setGridPanel115(HtmlPanelGrid hpg) { - this.gridPanel115 = hpg; - } + public void setGroupPanel9( PanelGroup pg ) + { + this.groupPanel9 = pg; + } + private StaticText staticText71 = new StaticText(); - private StaticText staticText168 = new StaticText(); + public StaticText getStaticText71() + { + return staticText71; + } - public StaticText getStaticText168() { - return staticText168; - } + public void setStaticText71( StaticText st ) + { + this.staticText71 = st; + } + private DropDown drpHours = new DropDown(); - public void setStaticText168(StaticText st) { - this.staticText168 = st; - } + public DropDown getDrpHours() + { + return drpHours; + } - private HtmlPanelGrid gridPanel116 = new HtmlPanelGrid(); + public void setDrpHours( DropDown dd ) + { + this.drpHours = dd; + } + private StaticText staticText72 = new StaticText(); - public HtmlPanelGrid getGridPanel116() { - return gridPanel116; - } + public StaticText getStaticText72() + { + return staticText72; + } - public void setGridPanel116(HtmlPanelGrid hpg) { - this.gridPanel116 = hpg; - } + public void setStaticText72( StaticText st ) + { + this.staticText72 = st; + } + private DropDown drpMinutes = new DropDown(); - private PanelGroup groupPanel58 = new PanelGroup(); + public DropDown getDrpMinutes() + { + return drpMinutes; + } - public PanelGroup getGroupPanel58() { - return groupPanel58; - } + public void setDrpMinutes( DropDown dd ) + { + this.drpMinutes = dd; + } + private PanelGroup groupPanel8 = new PanelGroup(); - public void setGroupPanel58(PanelGroup pg) { - this.groupPanel58 = pg; - } + public PanelGroup getGroupPanel8() + { + return groupPanel8; + } - private StaticText staticText169 = new StaticText(); + public void setGroupPanel8( PanelGroup pg ) + { + this.groupPanel8 = pg; + } + private StaticText staticText14 = new StaticText(); - public StaticText getStaticText169() { - return staticText169; - } + public StaticText getStaticText14() + { + return staticText14; + } - public void setStaticText169(StaticText st) { - this.staticText169 = st; - } + public void setStaticText14( StaticText st ) + { + this.staticText14 = st; + } + private StaticText stNomeAcidentado = new StaticText(); - private StaticText stHeaderNr = new StaticText(); + public StaticText getStNomeAcidentado() + { + return stNomeAcidentado; + } - public StaticText getStHeaderNr() { - return stHeaderNr; - } + public void setStNomeAcidentado( StaticText st ) + { + this.stNomeAcidentado = st; + } + private PanelGroup groupPanel15 = new PanelGroup(); - public void setStHeaderNr(StaticText st) { - this.stHeaderNr = st; - } + public PanelGroup getGroupPanel15() + { + return groupPanel15; + } - private PanelGroup groupPanel59 = new PanelGroup(); + public void setGroupPanel15( PanelGroup pg ) + { + this.groupPanel15 = pg; + } + private StaticText staticText70 = new StaticText(); - public PanelGroup getGroupPanel59() { - return groupPanel59; - } + public StaticText getStaticText70() + { + return staticText70; + } - public void setGroupPanel59(PanelGroup pg) { - this.groupPanel59 = pg; - } + public void setStaticText70( StaticText st ) + { + this.staticText70 = st; + } + private StaticText stEstabelecimentoOrigem1 = new StaticText(); - private StaticText staticText170 = new StaticText(); + public StaticText getStEstabelecimentoOrigem1() + { + return stEstabelecimentoOrigem1; + } - public StaticText getStaticText170() { - return staticText170; - } + public void setStEstabelecimentoOrigem1( StaticText st ) + { + this.stEstabelecimentoOrigem1 = st; + } + private PanelGroup groupPanel16 = new PanelGroup(); - public void setStaticText170(StaticText st) { - this.staticText170 = st; - } + public PanelGroup getGroupPanel16() + { + return groupPanel16; + } - private StaticText stHeaderDate = new StaticText(); + public void setGroupPanel16( PanelGroup pg ) + { + this.groupPanel16 = pg; + } + private StaticText staticText74 = new StaticText(); - public StaticText getStHeaderDate() { - return stHeaderDate; - } + public StaticText getStaticText74() + { + return staticText74; + } - public void setStHeaderDate(StaticText st) { - this.stHeaderDate = st; - } + public void setStaticText74( StaticText st ) + { + this.staticText74 = st; + } + private StaticText stDataNascimento = new StaticText(); - private ImageComponent image28 = new ImageComponent(); + public StaticText getStDataNascimento() + { + return stDataNascimento; + } - public ImageComponent getImage28() { - return image28; - } + public void setStDataNascimento( StaticText st ) + { + this.stDataNascimento = st; + } + private PanelGroup groupPanel65 = new PanelGroup(); - public void setImage28(ImageComponent ic) { - this.image28 = ic; - } + public PanelGroup getGroupPanel65() + { + return groupPanel65; + } - private PanelGroup groupPanel1 = new PanelGroup(); + public void setGroupPanel65( PanelGroup pg ) + { + this.groupPanel65 = pg; + } + private StaticText staticText75 = new StaticText(); - public PanelGroup getGroupPanel1() { - return groupPanel1; - } + public StaticText getStaticText75() + { + return staticText75; + } - public void setGroupPanel1(PanelGroup pg) { - this.groupPanel1 = pg; - } + public void setStaticText75( StaticText st ) + { + this.staticText75 = st; + } + private StaticText stBI = new StaticText(); - private RadioButton rbTurnoManha = new RadioButton(); + public StaticText getStBI() + { + return stBI; + } - public RadioButton getRbTurnoManha() { - return rbTurnoManha; - } + public void setStBI( StaticText st ) + { + this.stBI = st; + } + private PanelGroup groupPanel66 = new PanelGroup(); - public void setRbTurnoManha(RadioButton rb) { - this.rbTurnoManha = rb; - } + public PanelGroup getGroupPanel66() + { + return groupPanel66; + } - private StaticText staticText1 = new StaticText(); + public void setGroupPanel66( PanelGroup pg ) + { + this.groupPanel66 = pg; + } + private StaticText staticText77 = new StaticText(); - public StaticText getStaticText1() { - return staticText1; - } + public StaticText getStaticText77() + { + return staticText77; + } - public void setStaticText1(StaticText st) { - this.staticText1 = st; - } + public void setStaticText77( StaticText st ) + { + this.staticText77 = st; + } + private StaticText stMorada = new StaticText(); - private StaticText staticText2 = new StaticText(); + public StaticText getStMorada() + { + return stMorada; + } - public StaticText getStaticText2() { - return staticText2; - } + public void setStMorada( StaticText st ) + { + this.stMorada = st; + } + private StaticText staticText79 = new StaticText(); - public void setStaticText2(StaticText st) { - this.staticText2 = st; - } + public StaticText getStaticText79() + { + return staticText79; + } - private RadioButton rbTurnoTarde = new RadioButton(); + public void setStaticText79( StaticText st ) + { + this.staticText79 = st; + } + private StaticText stCodPostal = new StaticText(); - public RadioButton getRbTurnoTarde() { - return rbTurnoTarde; - } + public StaticText getStCodPostal() + { + return stCodPostal; + } - public void setRbTurnoTarde(RadioButton rb) { - this.rbTurnoTarde = rb; - } + public void setStCodPostal( StaticText st ) + { + this.stCodPostal = st; + } + private PanelGroup groupPanel67 = new PanelGroup(); - 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 HiddenField hidDisableEnviar = new HiddenField(); + public PanelGroup getGroupPanel67() + { + return groupPanel67; + } - public HiddenField getHidDisableEnviar() { - return hidDisableEnviar; - } + public void setGroupPanel67( PanelGroup pg ) + { + this.groupPanel67 = pg; + } + private StaticText staticText80 = new StaticText(); - public void setHidDisableEnviar(HiddenField hf) { - this.hidDisableEnviar = hf; - } + public StaticText getStaticText80() + { + return staticText80; + } - private PanelGroup groupPanel2 = new PanelGroup(); + public void setStaticText80( StaticText st ) + { + this.staticText80 = st; + } + private StaticText stContactoTelefonico = new StaticText(); - public PanelGroup getGroupPanel2() { - return groupPanel2; - } + public StaticText getStContactoTelefonico() + { + return stContactoTelefonico; + } - public void setGroupPanel2(PanelGroup pg) { - this.groupPanel2 = pg; - } + public void setStContactoTelefonico( StaticText st ) + { + this.stContactoTelefonico = st; + } + private PanelGroup groupPanel68 = new PanelGroup(); - private StaticText staticText43 = new StaticText(); + public PanelGroup getGroupPanel68() + { + return groupPanel68; + } - public StaticText getStaticText43() { - return staticText43; - } + public void setGroupPanel68( PanelGroup pg ) + { + this.groupPanel68 = pg; + } + private StaticText staticText81 = new StaticText(); - public void setStaticText43(StaticText st) { - this.staticText43 = st; - } + public StaticText getStaticText81() + { + return staticText81; + } - private TextField txtNrMecanografico = new TextField(); + public void setStaticText81( StaticText st ) + { + this.staticText81 = st; + } + private StaticText stDataAdmissao1 = new StaticText(); - public TextField getTxtNrMecanografico() { - return txtNrMecanografico; - } + public StaticText getStDataAdmissao1() + { + return stDataAdmissao1; + } - public void setTxtNrMecanografico(TextField tf) { - this.txtNrMecanografico = tf; - } + public void setStDataAdmissao1( StaticText st ) + { + this.stDataAdmissao1 = st; + } + private PanelGroup groupPanel69 = new PanelGroup(); - private StaticText staticText44 = new StaticText(); + public PanelGroup getGroupPanel69() + { + return groupPanel69; + } - public StaticText getStaticText44() { - return staticText44; - } + public void setGroupPanel69( PanelGroup pg ) + { + this.groupPanel69 = pg; + } + private StaticText staticText82 = new StaticText(); - public void setStaticText44(StaticText st) { - this.staticText44 = st; - } + public StaticText getStaticText82() + { + return staticText82; + } - private TextField txtNomeTrabalhador = new TextField(); + public void setStaticText82( StaticText st ) + { + this.staticText82 = st; + } + private StaticText stFuncao1 = new StaticText(); - public TextField getTxtNomeTrabalhador() { - return txtNomeTrabalhador; - } + public StaticText getStFuncao1() + { + return stFuncao1; + } - public void setTxtNomeTrabalhador(TextField tf) { - this.txtNomeTrabalhador = tf; - } + public void setStFuncao1( StaticText st ) + { + this.stFuncao1 = st; + } + private PanelGroup groupPanel70 = new PanelGroup(); - private StaticText staticText45 = new StaticText(); + public PanelGroup getGroupPanel70() + { + return groupPanel70; + } - public StaticText getStaticText45() { - return staticText45; - } + public void setGroupPanel70( PanelGroup pg ) + { + this.groupPanel70 = pg; + } + private StaticText staticText83 = new StaticText(); - public void setStaticText45(StaticText st) { - this.staticText45 = st; - } + public StaticText getStaticText83() + { + return staticText83; + } - private Button butProcurarTrab = new Button(); + public void setStaticText83( StaticText st ) + { + this.staticText83 = st; + } + private StaticText stTurno = new StaticText(); - public Button getButProcurarTrab() { - return butProcurarTrab; - } + public StaticText getStTurno() + { + return stTurno; + } - public void setButProcurarTrab(Button b) { - this.butProcurarTrab = b; - } + public void setStTurno( StaticText st ) + { + this.stTurno = st; + } + private PanelGroup groupPanel71 = new PanelGroup(); - private Table tblTrabalhadores = new Table(); + public PanelGroup getGroupPanel71() + { + return groupPanel71; + } - public Table getTblTrabalhadores() { - return tblTrabalhadores; - } + public void setGroupPanel71( PanelGroup pg ) + { + this.groupPanel71 = pg; + } + private StaticText staticText84 = new StaticText(); - public void setTblTrabalhadores(Table t) { - this.tblTrabalhadores = t; - } + public StaticText getStaticText84() + { + return staticText84; + } - private TableRowGroup tableRowGroup1 = new TableRowGroup(); + public void setStaticText84( StaticText st ) + { + this.staticText84 = st; + } + private StaticText staticText85 = new StaticText(); - public TableRowGroup getTableRowGroup1() { - return tableRowGroup1; - } + public StaticText getStaticText85() + { + return staticText85; + } - public void setTableRowGroup1(TableRowGroup trg) { - this.tableRowGroup1 = trg; - } + public void setStaticText85( StaticText st ) + { + this.staticText85 = st; + } + private PanelGroup groupPanel72 = new PanelGroup(); - private TableColumn tableColumn1 = new TableColumn(); + public PanelGroup getGroupPanel72() + { + return groupPanel72; + } - public TableColumn getTableColumn1() { - return tableColumn1; - } + public void setGroupPanel72( PanelGroup pg ) + { + this.groupPanel72 = pg; + } + private StaticText staticText86 = new StaticText(); - public void setTableColumn1(TableColumn tc) { - this.tableColumn1 = tc; - } + public StaticText getStaticText86() + { + return staticText86; + } - private TableColumn tableColumn2 = new TableColumn(); + public void setStaticText86( StaticText st ) + { + this.staticText86 = st; + } + private StaticText stMedico = new StaticText(); - public TableColumn getTableColumn2() { - return tableColumn2; - } + public StaticText getStMedico() + { + return stMedico; + } - public void setTableColumn2(TableColumn tc) { - this.tableColumn2 = tc; - } + public void setStMedico( StaticText st ) + { + this.stMedico = st; + } + private StaticText staticText87 = new StaticText(); - private TableColumn tableColumn3 = new TableColumn(); + public StaticText getStaticText87() + { + return staticText87; + } - public TableColumn getTableColumn3() { - return tableColumn3; - } + public void setStaticText87( StaticText st ) + { + this.staticText87 = st; + } + private StaticText staticText92 = new StaticText(); - public void setTableColumn3(TableColumn tc) { - this.tableColumn3 = tc; - } + public StaticText getStaticText92() + { + return staticText92; + } - private DefaultTableDataProvider defaultTableDataProvider = new DefaultTableDataProvider(); + public void setStaticText92( StaticText st ) + { + this.staticText92 = st; + } + private StaticText txtCedula = new StaticText(); - public DefaultTableDataProvider getDefaultTableDataProvider() { - return defaultTableDataProvider; - } + public StaticText getTxtCedula() + { + return txtCedula; + } - public void setDefaultTableDataProvider(DefaultTableDataProvider dtdp) { - this.defaultTableDataProvider = dtdp; - } + public void setTxtCedula( StaticText st ) + { + this.txtCedula = st; + } + private PanelGroup groupPanel4 = new PanelGroup(); - private Hyperlink lnkPOR = new Hyperlink(); + public PanelGroup getGroupPanel4() + { + return groupPanel4; + } - public Hyperlink getLnkPOR() { - return lnkPOR; - } + public void setGroupPanel4( PanelGroup pg ) + { + this.groupPanel4 = pg; + } + private StaticText staticText7 = new StaticText(); - public void setLnkPOR(Hyperlink h) { - this.lnkPOR = h; - } + public StaticText getStaticText7() + { + return staticText7; + } - private Hyperlink lnkNomeTrabalhador = new Hyperlink(); + public void setStaticText7( StaticText st ) + { + this.staticText7 = st; + } + private TextField txtHorasTurno = new TextField(); - public Hyperlink getLnkNomeTrabalhador() { - return lnkNomeTrabalhador; - } + public TextField getTxtHorasTurno() + { + return txtHorasTurno; + } - public void setLnkNomeTrabalhador(Hyperlink h) { - this.lnkNomeTrabalhador = h; - } + public void setTxtHorasTurno( TextField tf ) + { + this.txtHorasTurno = tf; + } + private HiddenField hidConfEnviar = new HiddenField(); - private Hyperlink lnkEstabelecimentoTrabalhador = new Hyperlink(); + public HiddenField getHidConfEnviar() + { + return hidConfEnviar; + } - public Hyperlink getLnkEstabelecimentoTrabalhador() { - return lnkEstabelecimentoTrabalhador; - } + public void setHidConfEnviar( HiddenField hf ) + { + this.hidConfEnviar = hf; + } + private StaticText lblUser = new StaticText(); - public void setLnkEstabelecimentoTrabalhador(Hyperlink h) { - this.lnkEstabelecimentoTrabalhador = h; - } + public StaticText getLblUser() + { + return lblUser; + } - private StaticText stTecnicoNomeEdit = new StaticText(); + public void setLblUser( StaticText st ) + { + this.lblUser = st; + } - public StaticText getStTecnicoNomeEdit() { - return stTecnicoNomeEdit; - } + /** + *

Construct a new Page bean instance.

+ */ + public AnaliseAcidenteTrabalho() + { + } - public void setStTecnicoNomeEdit(StaticText st) { - this.stTecnicoNomeEdit = st; - } + /** + *

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.

+ */ + @Override + 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 ); + } - private HtmlPanelGrid gridDadosAcidenteSegView = new HtmlPanelGrid(); + // + // Perform application initialization that must complete + // *after* managed components are initialized + // TODO - add your own initialization code here - public HtmlPanelGrid getGridDadosAcidenteSegView() { - return gridDadosAcidenteSegView; - } + if ( !getSessionBean1().isLoggedIn() ) + { + try + { + getExternalContext().redirect( "Login.jsp" ); + } + catch ( Exception e ) + { + // . . . handle exception . . . + } + } + else + { - public void setGridDadosAcidenteSegView(HtmlPanelGrid hpg) { - this.gridDadosAcidenteSegView = hpg; - } + initCalendars(); - private HtmlPanelGrid gridPanel1 = new HtmlPanelGrid(); + 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(); + //if(getSessionBean1().getImageName() != null) + //{ + fillImages(); + //} + } + else + { + String tmpImageFolder = Global.IMAGE_FOLDER + "/tmp" + getSessionBean1().getCurrentUser().getLogin(); + File tmpFolder = new File( tmpImageFolder ); + if ( tmpFolder.exists() ) + { + Global global = new Global(); + global.deleteFolderFiles( tmpFolder ); + tmpFolder.delete(); + } - public HtmlPanelGrid getGridPanel1() { - return gridPanel1; - } + lblUser.setText( getSessionBean1().getCurrentUser().getLogin() ); + getSessionBean1().setGravado( false ); + getSessionBean1().setSubmetido( false ); + getSessionBean1().setIeBug( false ); + //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 ); - public void setGridPanel1(HtmlPanelGrid hpg) { - this.gridPanel1 = hpg; - } + fillPage(); + } - private StaticText staticText95 = new StaticText(); + } + } - public StaticText getStaticText95() { - return staticText95; - } + } - public void setStaticText95(StaticText st) { - this.staticText95 = st; - } - private HtmlPanelGrid gridPanel117 = new HtmlPanelGrid(); + } - public HtmlPanelGrid getGridPanel117() { - return gridPanel117; - } + /** + *

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.

+ */ + @Override + public void preprocess() + { + } - public void setGridPanel117(HtmlPanelGrid hpg) { - this.gridPanel117 = hpg; - } + /** + *

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.

+ */ + @Override + public void prerender() + { + txtMsg.setText( getSessionBean1().getMsg() ); + getSessionBean1().setMsg( "" ); - private HtmlPanelGrid gridTurnoSeccaoLocal = new HtmlPanelGrid(); + } - public HtmlPanelGrid getGridTurnoSeccaoLocal() { - return gridTurnoSeccaoLocal; - } + /** + *

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).

+ */ + @Override + public void destroy() + { + } - public void setGridTurnoSeccaoLocal(HtmlPanelGrid hpg) { - this.gridTurnoSeccaoLocal = hpg; - } + /** + *

Return a reference to the scoped data bean.

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

Return a reference to the scoped data bean.

+ */ + protected SessionBean1 getSessionBean1() + { + return ( SessionBean1 ) getBean( "SessionBean1" ); + } - public StaticText getLblHorasTurno() { - return lblHorasTurno; - } + /** + *

Return a reference to the scoped data bean.

+ */ + protected ApplicationBean1 getApplicationBean1() + { + return ( ApplicationBean1 ) getBean( "ApplicationBean1" ); + } - public void setLblHorasTurno(StaticText st) { - this.lblHorasTurno = st; - } + public String lnkLogout_action() + { + getSessionBean1().setIeBug( true ); + Utils.doLogout( getExternalContext(), true ); - private StaticText txtHorasTurno2 = new StaticText(); + return null; + } - public StaticText getTxtHorasTurno2() { - return txtHorasTurno2; - } + private void initializePage() + { + hidAnchor.setValue( "none" ); + butCorrecao.setRendered( false ); + butGravar.setText( "Gravar" ); + butEnviar.setText( "Enviar a RH" ); + gridSiprp.setRendered( false ); + //gridAcidentadoView.setRendered(false); + 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 ); + gridVerificacao.setRendered( false ); + gridVerificacaoView.setRendered( false ); + gridImpressao.setRendered( false ); + gridImpressaoView.setRendered( false ); + + tblTrabalhadores.setRendered( false ); + gridAcidentado.setRendered( false ); + gridDadosAcidenteSeg.setRendered( false ); + gridDadosAcidenteSegView.setRendered( false ); + + butImprimir.setRendered( false ); - public void setTxtHorasTurno2(StaticText st) { - this.txtHorasTurno2 = st; - } +// AnalisesDataProvider adp = new AnalisesDataProvider(); + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + String nome_empresa = adp.getEmpresaNome( getSessionBean1().getCurrentUser().getEmpresa_id() ); + txtEmpresa.setText( utils.Utils.unicodeToHTML( nome_empresa ) ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + txtEstabelecimento.setText( adp.getEstabelecimentoNome( getSessionBean1().getCurrentUser().getEstabelecimento_id() ) ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } - private StaticText lblSeccao = new StaticText(); - public StaticText getLblSeccao() { - return lblSeccao; - } + drpDepartamento.setSelected( new Integer( 0 ) ); + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + getSessionBean1().setSeccaoOptions( adp.getSeccoesList( null ) ); + drpSeccao.setSelected( new Integer( 0 ) ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } - public void setLblSeccao(StaticText st) { - this.lblSeccao = st; - } - private StaticText txtSeccao1 = new StaticText(); +// fillTrabalhadoresTable(); - public StaticText getTxtSeccao1() { - return txtSeccao1; - } +// Calendar c = Calendar.getInstance(); +// SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd"); +// stDataAcidente.setText(dateFormat.format(c.getTime())); + txtAveriguador.setText( getSessionBean1().getCurrentUser().getNome() ); + java.util.Date today = + new java.util.Date(); + calDataOcorrencia.setValue( today ); - public void setTxtSeccao1(StaticText st) { - this.txtSeccao1 = st; - } + //drpMedicos.setSelected(new Integer(0)); +// UtilizadoresDataProvider udp = new UtilizadoresDataProvider(); + try + { + UtilizadoresDataProvider udp = UtilizadoresDataProvider.getInstance(); + Medico m = udp.getMedico( getSessionBean1().getCurrentUser().getEstabelecimento_id() ); + getSessionBean1().setMedico( m ); + if ( m != null ) + { + stMedico.setText( m.getNome() + "  " ); + txtCedula.setText( m.getNumero_cedula() ); + } + } + catch ( Exception e ) + { + ErrorLogger.logException( e ); + } + drpHours.setSelected( new Integer( -1 ) ); + drpMinutes.setSelected( new Integer( -1 ) ); + drpDepartamento.setSelected( new Integer( 0 ) ); + drpSeccao.setSelected( new Integer( 0 ) ); + drpCausas.setSelected( new Integer( 0 ) ); + } - private StaticText lblLocal = new StaticText(); +// 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); +// ErrorLogger.logException( ex ); +// } +// } + private String fillPage() + { + AnaliseAcidente a = getSessionBean1().getCurrentAnalise(); - public StaticText getLblLocal() { - return lblLocal; - } + //correcao + if ( a.getCorrecao().matches( "y" ) ) + { + stObservacoesCorr.setText( a.getObservacoes_correcao() ); + } + else + { + stObservacoesCorr.setRendered( false ); + } - public void setLblLocal(StaticText st) { - this.lblLocal = st; - } - private StaticText txtLocal1 = new StaticText(); + 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 ) + { + ErrorLogger.logException( ex ); + } +// AnalisesDataProvider adp = new AnalisesDataProvider(); + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + String nome_empresa = adp.getEmpresaNome( a.getEmpresa_id() ); + txtEmpresa.setText( utils.Utils.unicodeToHTML( nome_empresa ) ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + txtEstabelecimento.setText( adp.getEstabelecimentoNome( a.getEstabelecimento_id() ) ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } - public StaticText getTxtLocal1() { - return txtLocal1; - } + Acidentado ac = null; + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); - public void setTxtLocal1(StaticText st) { - this.txtLocal1 = st; - } + //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 ) + { + ErrorLogger.logException( ex ); + } - private HtmlPanelGrid gridTarefa = new HtmlPanelGrid(); - public HtmlPanelGrid getGridTarefa() { - return gridTarefa; - } + int estado_documento = a.getEstado().intValue(); +// if(estado_documento != Global.ESTADO_IMPRESSAO) +//// if(estado_documento != Global.ESTADO_ASSINATURAS || (estado_documento == Global.ESTADO_ASSINATURAS && getSessionBean1().getCurrentUser().getTipo().intValue() != Global.TIPO_UTILIZADOR_RH)) +//// { +//// butImprimir.setRendered(false); +//// } +//// else +//// { +//// butGravar.setRendered(false); +//// } + butImprimir.setRendered( false ); - public void setGridTarefa(HtmlPanelGrid hpg) { - this.gridTarefa = hpg; - } + if ( estado_documento > Global.ESTADO_SEG && getSessionBean1().getCurrentUser().getTipo().intValue() == 1 && a.getAveriguacao_posterior().matches( "y" ) ) + { + boolean booAveriguacao = false; + if ( a.getAveriguacao_obs() == null ) + { + booAveriguacao = true; + } + else if ( a.getAveriguacao_obs().trim().length() == 0 ) + { + booAveriguacao = true; + } + if ( booAveriguacao ) + { + butCorrecao.setRendered( false ); + butGravar.setText( "Gravar" ); + butEnviar.setRendered( false ); + gridSiprp.setRendered( false ); + //gridSiprpView.setRendered(false); + gridAcidentado.setRendered( false ); //19/11/2007 + gridAcidentadoView.setRendered( false ); //19/11/2007 + gridDadosAcidenteSeg.setRendered( false ); //19/11/2007 + //gridDadosAcidenteSegView.setRendered(false); //19/11/2007 + gridDadosAcidenteRh.setRendered( false ); + gridDadosAcidenteRhView.setRendered( false ); + gridRecomendacoesHS.setRendered( false ); + gridRecomendacoesViewHS.setRendered( false ); + gridMedidasRH.setRendered( false ); + gridMedidasViewRH.setRendered( false ); + gridMedico.setRendered( false ); + gridMedicoView.setRendered( false ); + gridVerificacao.setRendered( false ); + gridVerificacaoView.setRendered( false ); + gridImpressao.setRendered( false ); + gridImpressaoView.setRendered( false ); + + // fillSiprp(a); + // fillDadosAcidenteSegView(a); + fillSiprpView( a ); + if ( ac != null ) + { + fillAcidentadoView( ac ); + } + fillDadosAcidenteSegView( a ); - private StaticText lblTarefa = new StaticText(); + return null; + } - public StaticText getLblTarefa() { - return lblTarefa; - } + } - public void setLblTarefa(StaticText st) { - this.lblTarefa = st; - } - private StaticText txtTarefa1 = new StaticText(); - - public StaticText getTxtTarefa1() { - return txtTarefa1; - } - - public void setTxtTarefa1(StaticText st) { - this.txtTarefa1 = st; - } - - private HtmlPanelGrid gridSubstancias = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridSubstancias() { - return gridSubstancias; - } - - public void setGridSubstancias(HtmlPanelGrid hpg) { - this.gridSubstancias = hpg; - } - - private StaticText lblSubstancias = new StaticText(); - - public StaticText getLblSubstancias() { - return lblSubstancias; - } - - public void setLblSubstancias(StaticText st) { - this.lblSubstancias = st; - } - - private StaticText txtSubstancias1 = new StaticText(); - - public StaticText getTxtSubstancias1() { - return txtSubstancias1; - } + switch ( estado_documento ) + { + case Global.ESTADO_SEG: + butCorrecao.setRendered( false ); + butGravar.setText( "Gravar" ); + if ( a.getCorrecao().matches( "y" ) ) + { + butEnviar.setText( "Enviar a Recomendações SHST" ); + } + else + { + butEnviar.setText( "Enviar a Acompanhamento RH" ); + } + gridSiprpView.setRendered( false ); + gridAcidentado.setRendered( false ); //19/11/2007 + //gridAcidentadoView.setRendered(false); //19/11/2007 + gridDadosAcidenteSegView.setRendered( false ); //19/11/2007 + gridDadosAcidenteRh.setRendered( false ); + gridDadosAcidenteRhView.setRendered( false ); + gridRecomendacoesHS.setRendered( false ); + gridRecomendacoesViewHS.setRendered( false ); + gridMedidasRH.setRendered( false ); + gridMedidasViewRH.setRendered( false ); + gridMedico.setRendered( false ); + gridMedicoView.setRendered( false ); + gridVerificacao.setRendered( false ); + gridVerificacaoView.setRendered( false ); + gridImpressao.setRendered( false ); + gridImpressaoView.setRendered( false ); + + fillSiprp( a ); + fillAcidentadoView( ac ); + fillDadosAcidenteSeg( a ); + break; + case Global.ESTADO_RH1: + butCorrecao.setRendered( false ); + butGravar.setText( "Gravar" ); + butEnviar.setText( "Enviar a Recomendações SHST" ); + gridSiprpView.setRendered( false ); + gridAcidentadoView.setRendered( false ); + gridDadosAcidenteSeg.setRendered( false ); //19/11/2007 + gridDadosAcidenteRhView.setRendered( false ); + gridRecomendacoesHS.setRendered( false ); + gridRecomendacoesViewHS.setRendered( false ); + gridMedidasRH.setRendered( false ); + gridMedidasViewRH.setRendered( false ); + gridMedico.setRendered( false ); + gridMedicoView.setRendered( false ); + gridVerificacao.setRendered( false ); + gridVerificacaoView.setRendered( false ); + gridImpressao.setRendered( false ); + gridImpressaoView.setRendered( false ); + + if ( ac != null ) + { + fillAcidentado( ac ); + } + fillSiprp( a ); + fillDadosAcidenteSegView( a ); + fillDadosAcidenteRh( a ); + break; + case Global.ESTADO_HS: + butGravar.setText( "Gravar" ); + butEnviar.setText( "Enviar a Medidas 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 ); + gridVerificacao.setRendered( false ); + gridVerificacaoView.setRendered( false ); + gridImpressao.setRendered( false ); + gridImpressaoView.setRendered( false ); + + fillSiprpView( a ); + if ( ac != null ) + { + fillAcidentadoView( ac ); + } + fillDadosAcidenteSegView( a ); + fillDadosAcidenteRhView( a ); + fillRecomendacoesHs( a ); + //gridDadosAcidenteRhView.setRendered(false); + //gridRecomendacoesHS.setRendered(false); + break; + case Global.ESTADO_RH2: + butCorrecao.setRendered( false ); + butGravar.setText( "Gravar" ); + //butEnviar.setText("Enviar a Médico"); +// if(a.getCorrecao().matches("y")) +// { +// butEnviar.setText("Enviar a Consolidação"); +// } +// else +// { +// butEnviar.setText("Enviar a Medicina"); +// } + butEnviar.setText( "Enviar a Consolidação" ); + + //butEnviar.setText("Enviar a Medicina"); + //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 ); + gridVerificacao.setRendered( false ); + gridVerificacaoView.setRendered( false ); + gridImpressao.setRendered( false ); + gridImpressaoView.setRendered( false ); + + fillSiprpView( a ); + if ( ac != null ) + { + fillAcidentadoView( ac ); + } + fillDadosAcidenteSegView( a ); + fillDadosAcidenteRhView( a ); + fillRecomendacoesViewHs( a ); + //fillMedico(a); //19/11/2007 + fillMedidasRh( a ); + fillMedico( a ); //23/11/2007 + break; +// case Global.ESTADO_MEDICINA: +// butCorrecao.setRendered(false); +// butGravar.setText("Gravar"); +// butEnviar.setText("Enviar a Consolidação"); +// //gridSiprpView.setRendered(false); +// gridSiprp.setRendered(false); +// gridAcidentado.setRendered(false); +// //gridAcidentadoView.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); +// gridVerificacao.setRendered(false); +// gridVerificacaoView.setRendered(false); +// gridImpressao.setRendered(false); +// gridImpressaoView.setRendered(false); +// +// fillSiprpView(a); +// if(ac != null) +// { +// fillAcidentadoView(ac); +// } +// fillDadosAcidenteSegView(a); +// fillDadosAcidenteRhView(a); +// fillRecomendacoesViewHs(a); +// fillMedidasViewRh(a); +// fillMedico(a); //23/11/2007 +// break; + case Global.ESTADO_CONSOLIDACAO: + //butGravar.setText("Gravar"); + butGravar.setRendered( false ); + butEnviar.setText( "Enviar a Verificação" ); + hidDisableEnviar.setValue( "n" ); +// boolean booAveriguacao = false; +// if(a.getAveriguacao_posterior().matches("y")) +// { +// if(a.getAveriguacao_obs() == null) +// { +// booAveriguacao = true; +// } +// else if(a.getAveriguacao_obs().trim().length() == 0) +// { +// booAveriguacao = true; +// } +// if(booAveriguacao) +// { +// hidDisableEnviar.setValue("y"); +// } +// +// } + gridSiprp.setRendered( false ); + gridAcidentado.setRendered( false ); + //gridAcidentadoView.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); + //gridVerificacao.setRendered(false); + java.util.Date ddate = new java.util.Date(); + stVerHs.setText( "Tomei conhecimento a " + utils.Utils.dateToYYYYMMDD( ddate ) ); + grpVerRespSeg.setRendered( false ); + grpVerRespRh.setRendered( false ); + butGravar.setDisabled( true ); + butEnviar.setDisabled( true ); + gridVerificacaoView.setRendered( false ); + gridImpressao.setRendered( false ); + gridImpressaoView.setRendered( false ); + + fillSiprpView( a ); + if ( ac != null ) + { + fillAcidentadoView( ac ); + } + fillDadosAcidenteSegView( a ); + fillDadosAcidenteRhView( a ); + fillRecomendacoesViewHs( a ); + fillMedidasViewRh( a ); + fillMedicoView( a ); //23/11/2007 + break; + case Global.ESTADO_ASSINATURA_SEG: + butImprimir.setRendered( false ); + butCorrecao.setRendered( false ); + butEnviar.setText( "Enviar a RH" ); + //butGravar.setText("Enviar"); + butGravar.setRendered( 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); + //gridVerificacaoView.setRendered(false); + gridImpressao.setRendered( false ); + gridImpressaoView.setRendered( false ); + grpVerRespSeg.setRendered( true ); + grpVerHs.setRendered( false ); + grpVerRespRh.setRendered( false ); + //chkVerRespRh.setDisabled(true); + ddate = new java.util.Date(); + stVerRespSeg.setText( "Tomei conhecimento a " + utils.Utils.dateToYYYYMMDD( ddate ) ); + + fillSiprpView( a ); + if ( ac != null ) + { + fillAcidentadoView( ac ); + } + fillDadosAcidenteSegView( a ); + fillDadosAcidenteRhView( a ); + fillMedidasViewRh( a ); + fillMedicoView( a ); + fillVerificacaoView( a ); + fillVerificacao( a ); + + break; + case Global.ESTADO_ASSINATURA_RH: + butGravar.setRendered( false ); + //butGravar.setText("Imprimir"); + butCorrecao.setRendered( false ); + butImprimir.setRendered( false ); + butEnviar.setText( "Enviar a Conclusão" ); + gridSiprp.setRendered( false ); + gridAcidentado.setRendered( false ); + gridDadosAcidenteSeg.setRendered( false ); + gridDadosAcidenteRh.setRendered( false ); + gridRecomendacoesHS.setRendered( false ); + gridMedidasRH.setRendered( false ); + gridMedico.setRendered( false ); + //gridMedicoView.setRendered(false); + //gridVerificacaoView.setRendered(false); + gridImpressao.setRendered( false ); + gridImpressaoView.setRendered( false ); + grpVerRespRh.setRendered( true ); + grpVerHs.setRendered( false ); + grpVerRespSeg.setRendered( false ); + //chkVerRespSeg.setDisabled(true); + ddate = new java.util.Date(); + stVerRespRh.setText( "Tomei conhecimento a " + utils.Utils.dateToYYYYMMDD( ddate ) ); + + fillSiprpView( a ); + if ( ac != null ) + { + fillAcidentadoView( ac ); + } + fillDadosAcidenteSegView( a ); + fillDadosAcidenteRhView( a ); + fillRecomendacoesViewHs( a ); + fillMedidasViewRh( a ); + fillMedicoView( a ); + fillVerificacaoView( a ); + fillVerificacao( a ); + break; + + case Global.ESTADO_FECHAR: + butCorrecao.setRendered( false ); + butGravar.setRendered( false ); + butGravar.setText( "Gravar" ); + butEnviar.setText( "Fechar" ); + gridSiprp.setRendered( false ); + gridAcidentado.setRendered( false ); + gridDadosAcidenteSeg.setRendered( false ); + gridDadosAcidenteRh.setRendered( false ); + gridRecomendacoesHS.setRendered( false ); + gridMedidasRH.setRendered( false ); + gridMedico.setRendered( false ); + gridVerificacao.setRendered( false ); + gridImpressao.setRendered( false ); + gridImpressaoView.setRendered( false ); + fillSiprpView( a ); + if ( ac != null ) + { + fillAcidentadoView( ac ); + } + fillDadosAcidenteSegView( a ); + fillDadosAcidenteRhView( a ); + fillRecomendacoesViewHs( a ); + fillMedidasViewRh( a ); + //fillMedico(a); + fillMedicoView( a ); + fillVerificacaoView( a ); + //fillImpressaoView(a); + break; + case Global.ESTADO_CONCLUIDO: + } - public void setTxtSubstancias1(StaticText st) { - this.txtSubstancias1 = st; - } + return null; + } - private HtmlPanelGrid gridCondicoes = new HtmlPanelGrid(); + private void fillSiprp( AnaliseAcidente a ) + { + //drpTecnicos.setSelected(a.getTecnico_saude_id()); + //drpMedicos.setSelected(a.getMedico_id()); +// UtilizadoresDataProvider udp = new UtilizadoresDataProvider(); + try + { + UtilizadoresDataProvider udp = UtilizadoresDataProvider.getInstance(); + Utilizador u = udp.getUtilizador( a.getTecnico_saude_id() ); + txtCap.setText( u.getCap() ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + try + { + UtilizadoresDataProvider udp = UtilizadoresDataProvider.getInstance(); + Utilizador u = udp.getUtilizador( a.getMedico_id() ); + stMedico.setText( u.getNome() + "  " ); + txtCedula.setText( u.getNumero_cedula() ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + } - public HtmlPanelGrid getGridCondicoes() { - return gridCondicoes; - } + private void fillSiprpView( AnaliseAcidente a ) + { + if ( a.getEstado().intValue() == Global.ESTADO_HS ) + { + if ( a.getTecnico_saude_id().equals( new Integer( 0 ) ) ) + { + a.setTecnico_saude_id( getSessionBean1().getCurrentUser().getId() ); + } + } - public void setGridCondicoes(HtmlPanelGrid hpg) { - this.gridCondicoes = hpg; - } + try + { + UtilizadoresDataProvider udp = UtilizadoresDataProvider.getInstance(); - private StaticText lblCondicoes = new StaticText(); + Utilizador u = udp.getUtilizador( a.getTecnico_saude_id() ); + stTecnicoNome.setText( Utils.unicodeToHTML( u.getNome() ) ); + txtCap1.setText( u.getCap() ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + try + { + UtilizadoresDataProvider udp = UtilizadoresDataProvider.getInstance(); - public StaticText getLblCondicoes() { - return lblCondicoes; - } + Utilizador u = udp.getUtilizador( a.getMedico_id() ); + stMedicoNome.setText( Utils.unicodeToHTML( u.getNome() ) ); + txtCedula1.setText( u.getNumero_cedula() ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + } - public void setLblCondicoes(StaticText st) { - this.lblCondicoes = st; - } + private void fillAcidentado( Acidentado a ) + { + txtNomeAcidentado.setText( a.getNome() ); + stEstabelecimentoOrigem.setText( a.getEstabelecimento_origem() ); + //txtDataNascimento.setText(a.getData_nascimento()); + try + { + java.util.Date ddate = new java.util.Date( a.getData_nascimento().getTime() ); + txtDataNascimento.setText( utils.Utils.dateToYYYYMMDD( ddate ) ); + } + catch ( Exception ex ) + { + } + 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 ) + { +// ErrorLogger.logException( ex ); + } + try + { + cod_postal2 = a.getCod_postal().substring( 5, 8 ); + } + catch ( Exception ex ) + { +// ErrorLogger.logException( ex ); + } - private StaticText txtCondicoes1 = new StaticText(); - public StaticText getTxtCondicoes1() { - return txtCondicoes1; - } + txtCodPostal1.setText( cod_postal1 ); + txtCodPostal2.setText( cod_postal2 ); + txtLocalidade.setText( a.getLocalidade() ); + txtContactoTelefonico.setText( a.getContacto_telefonico() ); + try + { + java.util.Date ddate = new java.util.Date( a.getData_admissao().getTime() ); + stDataAdmissao.setText( utils.Utils.dateToYYYYMMDD( ddate ) ); + } + catch ( Exception ex ) + { +// ErrorLogger.logException( ex ); + } - public void setTxtCondicoes1(StaticText st) { - this.txtCondicoes1 = st; - } + stFuncao.setText( a.getFuncao() ); + rbTurnoManha.setSelected( null ); + rbTurnoTarde.setSelected( null ); + rbTurnoNoite.setSelected( null ); + 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 HtmlPanelGrid gridTestemunhas = new HtmlPanelGrid(); + txtNomeSuperior.setText( a.getNome_superior_hierarquico() ); + txtEmailSuperior.setText( a.getEmail_superior_hierarquico() ); - public HtmlPanelGrid getGridTestemunhas() { - return gridTestemunhas; - } + } - public void setGridTestemunhas(HtmlPanelGrid hpg) { - this.gridTestemunhas = hpg; - } + private void fillAcidentadoView( Acidentado a ) + { + stNomeAcidentado.setText( a.getNome() ); + stEstabelecimentoOrigem1.setText( a.getEstabelecimento_origem() ); + //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 ) + { +// ErrorLogger.logException( 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 ) + { + cod_postal1 = ""; + } + try + { + cod_postal2 = a.getCod_postal().substring( 5, 8 ); + } + catch ( Exception ex ) + { + cod_postal2 = ""; + } - private StaticText lblTestemunhas = new StaticText(); + //String cod_postal1 = a.getCod_postal().substring(0, 4); + //String cod_postal2 = a.getCod_postal().substring(5, 8); + if ( a.getLocalidade() == null ) + { + a.setLocalidade( "" ); + } + String cod_postal = cod_postal1 + "-" + cod_postal2 + " " + a.getLocalidade(); + stCodPostal.setText( cod_postal ); + stContactoTelefonico.setText( a.getContacto_telefonico() ); + //stDataAdmissao1.setText(a.getData_admissao()); - public StaticText getLblTestemunhas() { - return lblTestemunhas; - } + try + { + java.util.Date ddate = new java.util.Date( a.getData_admissao().getTime() ); + stDataAdmissao1.setText( utils.Utils.dateToYYYYMMDD( ddate ) ); + } + catch ( Exception ex ) + { +// ErrorLogger.logException( ex ); + } - public void setLblTestemunhas(StaticText st) { - this.lblTestemunhas = st; - } + stFuncao1.setText( a.getFuncao() ); + String turno_str = ""; + if ( a.getTurno() != null ) + { + 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"; + } + } - private StaticText txtTestemunhas1 = new StaticText(); + stTurno.setText( turno_str ); + stNomeSuperior.setText( a.getNome_superior_hierarquico() ); + stEmailSuperior.setText( a.getEmail_superior_hierarquico() ); + } - public StaticText getTxtTestemunhas1() { - return txtTestemunhas1; - } + private void fillDadosAcidenteSeg( AnaliseAcidente a ) + { + //stDataAcidente.setText(a.getData_acidente()); +// try +// { +// java.util.Date ddate = new java.util.Date(a.getData_acidente().getTime()); +// stDataAcidente.setText(utils.Utils.dateToYYYYMMDD(ddate)); +// } +// catch(Exception ex){}; + if ( a.getAveriguador() == null ) + { + txtAveriguador.setText( getSessionBean1().getCurrentUser().getNome() ); + } + else + { + txtAveriguador.setText( a.getAveriguador() ); + } - public void setTxtTestemunhas1(StaticText st) { - this.txtTestemunhas1 = st; - } + if ( a.getData_acidente() != null ) + { + java.util.Date ddate = new java.util.Date( a.getData_acidente().getTime() ); + calDataOcorrencia.setValue( ddate ); + } - private HtmlPanelGrid gridCausas = new HtmlPanelGrid(); + Calendar cal = Calendar.getInstance(); - public HtmlPanelGrid getGridCausas() { - return gridCausas; - } + // set the calendar to have your time + try + { + cal.setTimeInMillis( a.getHora_acidente().getTime() ); - public void setGridCausas(HtmlPanelGrid hpg) { - this.gridCausas = hpg; - } + int hour = cal.get( Calendar.HOUR_OF_DAY ); + int minutes = cal.get( Calendar.MINUTE ); + drpHours.setSelected( new Integer( hour ) ); + drpMinutes.setSelected( new Integer( minutes ) ); + } + catch ( Exception ex ) + { +// ErrorLogger.logException( ex ); + } - private StaticText lblCausas = new StaticText(); + if ( a.getHoras_turno() != null ) + { + txtHorasTurno.setText( a.getHoras_turno().toString() ); + } - public StaticText getLblCausas() { - return lblCausas; - } + ////txtSeccao.setText(a.getSeccao()); - public void setLblCausas(StaticText st) { - this.lblCausas = st; - } +// AnalisesDataProvider adp = new AnalisesDataProvider(); + drpDepartamento.setSelected( a.getDepartamento_id() ); + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + if ( a.getDepartamento_id().intValue() == 0 ) + { + getSessionBean1().setSeccaoOptions( adp.getSeccoesList( null ) ); + drpSeccao.setSelected( new Integer( 0 ) ); + } + else + { + getSessionBean1().setSeccaoOptions( adp.getSeccoesList( a.getDepartamento_id() ) ); + drpSeccao.setSelected( a.getSeccao_id() ); + } + } + catch ( Exception ex ) + { +// ErrorLogger.logException( ex ); + } - private StaticText txtCausas1 = new StaticText(); + 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()); - public StaticText getTxtCausas1() { - return txtCausas1; - } + drpCausas.setSelected( a.getCausas() ); + txtDescricao.setText( a.getDescricao() ); + txtConclusoes.setText( a.getConclusoes() ); + txtAccoes.setText( a.getAccoes() ); - public void setTxtCausas1(StaticText st) { - this.txtCausas1 = st; - } + if ( a.getAveriguacao_posterior().matches( "y" ) ) + { + chkAveriguacaoPosterior.setSelected( new Boolean( true ) ); + } - private HtmlPanelGrid gridDescricao = new HtmlPanelGrid(); + txtAveriguacaoObs.setText( a.getAveriguacao_obs() ); - public HtmlPanelGrid getGridDescricao() { - return gridDescricao; - } + //fill images + if ( gridImages.getChildren().size() > 0 ) + { + gridImages.getChildren().clear(); + } + String folderName = getSessionBean1().getCurrentAnalise().getAnalise_nr().substring( 0, 2 ) + getSessionBean1().getCurrentAnalise().getAnalise_nr().substring( 3 ); + ServletContext theApplicationsServletContext = + ( ServletContext ) this.getExternalContext().getContext(); - public void setGridDescricao(HtmlPanelGrid hpg) { - this.gridDescricao = hpg; - } + File apacheAnaliseFolder = new File( theApplicationsServletContext.getRealPath( Global.RESOURCES_IMAGE_FOLDER ) + "/analises/" + folderName ); + if ( apacheAnaliseFolder.exists() ) + { + Global global = new Global(); + global.deleteFolderFiles( apacheAnaliseFolder ); + } + else + { + apacheAnaliseFolder.mkdir(); + } - private StaticText lblDescricao = new StaticText(); - public StaticText getLblDescricao() { - return lblDescricao; - } +// String imageFileFolder = theApplicationsServletContext.getRealPath(Global.IMAGE_FOLDER + "/" + folderName); + String imageFileFolder = Global.IMAGE_FOLDER + "/" + folderName; + try + { + File f = new File( imageFileFolder ); - public void setLblDescricao(StaticText st) { - this.lblDescricao = st; - } + if ( f.exists() ) + { + File images[] = f.listFiles(); + Arrays.sort( images ); + for ( int i = 0; i < images.length; i++ ) + { + if ( images[i].isFile() ) + { + String imageName = images[i].getName(); + ImageComponent newImg = new ImageComponent(); + newImg.setId( "img_comp" + imageName ); + File apacheImage = new File( theApplicationsServletContext.getRealPath( Global.RESOURCES_IMAGE_FOLDER ) + "/analises/" + folderName + "/" + imageName ); + Global global = new Global(); + global.copyImage( images[i], apacheImage ); + + newImg.setUrl( Global.RESOURCES_IMAGE_FOLDER + "/analises/" + folderName + "/" + imageName ); + newImg.setRendered( true ); + gridImages.getChildren().add( newImg ); + + Hyperlink ln = new Hyperlink(); + ln.setId( "img" + imageName ); + ln.setText( "Apagar" ); + //ln.setValue(imageName); + Class args[] = + { + javax.faces.event.ActionEvent.class + }; + ApplicationFactory factory = ( ApplicationFactory ) FactoryFinder.getFactory( FactoryFinder.APPLICATION_FACTORY ); + //mb = factory.getApplication().createMethodBinding( "#{EditarQuestionario.lnkGrupo_onClick}", args); + MethodBinding mbAction = ( MethodBinding ) factory.getApplication().createMethodBinding( "#{AnaliseAcidenteTrabalho.lnkDelImageReal_actionListener}", args ); + ln.setActionListener( mbAction ); + gridImages.getChildren().add( ln ); + } + } + } + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + } - private StaticText txtDescricao1 = new StaticText(); + private void fillDadosAcidenteSegView( AnaliseAcidente a ) + { +// AnalisesDataProvider adp = new AnalisesDataProvider(); - public StaticText getTxtDescricao1() { - return txtDescricao1; - } + stAveriguador.setText( a.getAveriguador() ); + if ( a.getData_acidente() == null ) + { + lblDataAcidente.setRendered( false ); + stDataAcidente1.setRendered( false ); + } + else + { + try + { + java.util.Date ddate = new java.util.Date( a.getData_acidente().getTime() ); + stDataAcidente1.setText( utils.Utils.dateToYYYYMMDD( ddate ) ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + } - public void setTxtDescricao1(StaticText st) { - this.txtDescricao1 = st; - } + if ( a.getHora_acidente() == null ) + { + lblHoraAcidente.setRendered( false ); + stHoraAcidente1.setRendered( false ); + } + else + { + Calendar cal = Calendar.getInstance(); - private HtmlPanelGrid gridFotografias = new HtmlPanelGrid(); + // set the calendar to have your time + cal.setTimeInMillis( a.getHora_acidente().getTime() ); - public HtmlPanelGrid getGridFotografias() { - return gridFotografias; - } + int hour = cal.get( Calendar.HOUR_OF_DAY ); + int minutes = cal.get( Calendar.MINUTE ); + try + { + stHoraAcidente1.setText( utils.Utils.timeToHHMM( hour + ":" + minutes ) ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + } - public void setGridFotografias(HtmlPanelGrid hpg) { - this.gridFotografias = hpg; - } + boolean booTurnoSeccaoLocal = false; + if ( a.getHoras_turno() == null ) + { + lblHorasTurno.setRendered( false ); + txtHorasTurno2.setRendered( false ); + } + else if ( a.getHoras_turno().intValue() == 0 ) + { + lblHorasTurno.setRendered( false ); + txtHorasTurno2.setRendered( false ); + } + else + { + txtHorasTurno2.setText( a.getHoras_turno().toString() ); + booTurnoSeccaoLocal = true; + } - private HtmlPanelGrid gridPanel127 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel127() { - return gridPanel127; - } - - public void setGridPanel127(HtmlPanelGrid hpg) { - this.gridPanel127 = hpg; - } - - private StaticText lblFotografias = new StaticText(); - - public StaticText getLblFotografias() { - return lblFotografias; - } - - public void setLblFotografias(StaticText st) { - this.lblFotografias = st; - } - - private HtmlPanelGrid gridImages1 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridImages1() { - return gridImages1; - } +// if(a.getSeccao() == null) +// { +// lblSeccao.setRendered(false); +// txtSeccao1.setRendered(false); +// } +// else if(a.getSeccao().trim().length() == 0) +// { +// lblSeccao.setRendered(false); +// txtSeccao1.setRendered(false); +// } +// else +// { +// txtSeccao1.setText(a.getSeccao()); +// booTurnoSeccaoLocal = true; +// } - public void setGridImages1(HtmlPanelGrid hpg) { - this.gridImages1 = hpg; - } + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + Seccao s = adp.getSeccao( a.getSeccao_id() ); + txtSeccao1.setText( s.getDescricao() ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + lblSeccao.setRendered( false ); + txtSeccao1.setRendered( false ); + } - private HtmlPanelGrid gridConclusoes = new HtmlPanelGrid(); - public HtmlPanelGrid getGridConclusoes() { - return gridConclusoes; - } + if ( a.getLocal_trabalho() == null ) + { + lblLocal.setRendered( false ); + txtLocal1.setRendered( false ); + } + else if ( a.getLocal_trabalho().trim().length() == 0 ) + { + lblLocal.setRendered( false ); + txtLocal1.setRendered( false ); + } + else + { + txtLocal1.setText( a.getLocal_trabalho() ); + booTurnoSeccaoLocal = true; + } - public void setGridConclusoes(HtmlPanelGrid hpg) { - this.gridConclusoes = hpg; - } + if ( !booTurnoSeccaoLocal ) + { + gridTurnoSeccaoLocal.setRendered( false ); + } - private StaticText lblConclusoes = new StaticText(); - public StaticText getLblConclusoes() { - return lblConclusoes; - } + if ( a.getTarefa() == null ) + { + gridTarefa.setRendered( false ); + lblTarefa.setRendered( false ); + txtTarefa1.setRendered( false ); + } + else if ( a.getTarefa().trim().length() == 0 ) + { + gridTarefa.setRendered( false ); + lblTarefa.setRendered( false ); + txtTarefa1.setRendered( false ); + } + else + { + txtTarefa1.setText( a.getTarefa() ); + } - public void setLblConclusoes(StaticText st) { - this.lblConclusoes = st; - } - private StaticText txtConclusoes1 = new StaticText(); + if ( a.getSubstancias() == null ) + { + gridSubstancias.setRendered( false ); + lblSubstancias.setRendered( false ); + txtSubstancias1.setRendered( false ); + } + else if ( a.getSubstancias().trim().length() == 0 ) + { + gridSubstancias.setRendered( false ); + lblSubstancias.setRendered( false ); + txtSubstancias1.setRendered( false ); + } + else + { + txtSubstancias1.setText( a.getSubstancias() ); + } - public StaticText getTxtConclusoes1() { - return txtConclusoes1; - } +// if(a.getSuperior_hierarquico() == null) +// { +// gridSuperior.setRendered(false); +// lblSuperior.setRendered(false); +// txtSuperior1.setRendered(false); +// } +// else if(a.getSuperior_hierarquico().trim().length() == 0) +// { +// gridSuperior.setRendered(false); +// lblSuperior.setRendered(false); +// txtSuperior1.setRendered(false); +// } +// else +// { +// txtSuperior1.setText(a.getSuperior_hierarquico()); +// } - public void setTxtConclusoes1(StaticText st) { - this.txtConclusoes1 = st; - } + if ( a.getCondicoes() == null ) + { + gridCondicoes.setRendered( false ); + lblCondicoes.setRendered( false ); + txtCondicoes1.setRendered( false ); + } + else if ( a.getCondicoes().trim().length() == 0 ) + { + gridCondicoes.setRendered( false ); + lblCondicoes.setRendered( false ); + txtCondicoes1.setRendered( false ); + } + else + { + txtCondicoes1.setText( a.getCondicoes() ); + } - private HtmlPanelGrid gridAccoes = new HtmlPanelGrid(); + if ( a.getTestemunhas() == null ) + { + gridTestemunhas.setRendered( false ); + lblTestemunhas.setRendered( false ); + txtTestemunhas1.setRendered( false ); + } + else if ( a.getTestemunhas().trim().length() == 0 ) + { + gridTestemunhas.setRendered( false ); + lblTestemunhas.setRendered( false ); + txtTestemunhas1.setRendered( false ); + } + else + { + txtTestemunhas1.setText( a.getTestemunhas() ); + } - public HtmlPanelGrid getGridAccoes() { - return gridAccoes; - } +// txtCausas1.setText(a.getCausas()); + try + { - public void setGridAccoes(HtmlPanelGrid hpg) { - this.gridAccoes = hpg; - } + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); - private StaticText lblAccoes = new StaticText(); + Causa c = adp.getCausa( a.getCausas() ); + txtCausas1.setText( c.getCausa() ); + } + catch ( Exception ex ) + { +// ErrorLogger.logException( ex ); + gridCausas.setRendered( false ); + } - public StaticText getLblAccoes() { - return lblAccoes; - } + if ( a.getDescricao() == null ) + { + gridDescricao.setRendered( false ); + lblDescricao.setRendered( false ); + txtDescricao1.setRendered( false ); + } + else if ( a.getDescricao().trim().length() == 0 ) + { + gridDescricao.setRendered( false ); + lblDescricao.setRendered( false ); + txtDescricao1.setRendered( false ); + } + else + { + txtDescricao1.setText( a.getDescricao() ); + } - public void setLblAccoes(StaticText st) { - this.lblAccoes = st; - } + if ( a.getConclusoes() == null ) + { + gridConclusoes.setRendered( false ); + lblConclusoes.setRendered( false ); + txtConclusoes1.setRendered( false ); + } + else if ( a.getConclusoes().trim().length() == 0 ) + { + gridConclusoes.setRendered( false ); + lblConclusoes.setRendered( false ); + txtConclusoes1.setRendered( false ); + } + else + { + txtConclusoes1.setText( a.getConclusoes() ); + } - private StaticText txtAccoes1 = new StaticText(); + if ( a.getAccoes() == null ) + { + gridAccoes.setRendered( false ); + lblAccoes.setRendered( false ); + txtAccoes1.setRendered( false ); + } + else if ( a.getAccoes().trim().length() == 0 ) + { + gridAccoes.setRendered( false ); + lblAccoes.setRendered( false ); + txtAccoes1.setRendered( false ); + } + else + { + txtAccoes1.setText( a.getAccoes() ); + } - public StaticText getTxtAccoes1() { - return txtAccoes1; - } + if ( a.getAveriguacao_posterior().matches( "y" ) ) + { + if ( a.getAveriguacao_obs().trim().length() == 0 ) // must edit + { + if ( getSessionBean1().getCurrentUser().getTipo().intValue() == Global.TIPO_UTILIZADOR_SEGURANCA ) // seguranca + { + gridAveriguacaoPosterior.setRendered( false ); + } + else + { + gridAveriguacaoPosterior.setRendered( false ); + gridAveriguacaoPosterior1.setRendered( false ); + } + } + else + { + gridAveriguacaoPosterior1.setRendered( false ); + txtAveriguacaoPosterior.setText( "Averiguação posterior: " + a.getAveriguacao_obs() ); + } + } + else + { + gridAveriguacaoPosterior.setRendered( false ); + gridAveriguacaoPosterior1.setRendered( false ); + } - public void setTxtAccoes1(StaticText st) { - this.txtAccoes1 = st; - } + //fill images + if ( gridImages.getChildren().size() > 0 ) + { + gridImages.getChildren().clear(); + } + String folderName = a.getAnalise_nr().substring( 0, 2 ) + a.getAnalise_nr().substring( 3 ); + ServletContext theApplicationsServletContext = + ( ServletContext ) this.getExternalContext().getContext(); +// String imageFileFolder = theApplicationsServletContext.getRealPath(Global.IMAGE_FOLDER + "/" + folderName); - private HtmlPanelGrid gridDataHora = new HtmlPanelGrid(); + File apacheAnaliseFolder = new File( theApplicationsServletContext.getRealPath( Global.RESOURCES_IMAGE_FOLDER ) + "/analises/" + folderName ); + if ( apacheAnaliseFolder.exists() ) + { + Global global = new Global(); + global.deleteFolderFiles( apacheAnaliseFolder ); + System.out.println( "FILES DELETED" ); + } + else + { + apacheAnaliseFolder.mkdir(); + } - public HtmlPanelGrid getGridDataHora() { - return gridDataHora; - } - public void setGridDataHora(HtmlPanelGrid hpg) { - this.gridDataHora = hpg; - } + String imageFileFolder = Global.IMAGE_FOLDER + "/" + folderName; + try + { + File f = new File( imageFileFolder ); - private PanelGroup groupPanel7 = new PanelGroup(); + if ( f.exists() ) + { + File images[] = f.listFiles(); + Arrays.sort( images ); + for ( int i = 0; i < images.length; i++ ) + { + if ( images[i].isFile() ) + { + String imageName = images[i].getName(); + ImageComponent newImg = new ImageComponent(); - public PanelGroup getGroupPanel7() { - return groupPanel7; - } + File apacheImage = new File( theApplicationsServletContext.getRealPath( Global.RESOURCES_IMAGE_FOLDER ) + "/analises/" + folderName + "/" + imageName ); + Global global = new Global(); + global.copyImage( images[i], apacheImage ); - public void setGroupPanel7(PanelGroup pg) { - this.groupPanel7 = pg; - } + newImg.setUrl( Global.RESOURCES_IMAGE_FOLDER + "/analises/" + folderName + "/" + imageName ); - private StaticText lblDataAcidente = new StaticText(); - public StaticText getLblDataAcidente() { - return lblDataAcidente; - } + //newImg.setUrl("/resources/images/" + getSessionBean1().getCurrentAnalise().getId() + "/" + imageName); + //newImg.setUrl(Global.IMAGE_FOLDER + "/" + folderName + "/" + imageName); + newImg.setRendered( true ); + gridImages1.getChildren().add( newImg ); + } + } + } + else + { + gridFotografias.setRendered( false ); + lblFotografias.setRendered( false ); + gridImages1.setRendered( false ); + } + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + } - public void setLblDataAcidente(StaticText st) { - this.lblDataAcidente = st; - } + private void fillDadosAcidenteRh( AnaliseAcidente a ) + { + if ( a.getFormacao_shst().matches( "y" ) ) + { + rbFormacaoSHSTY.setSelected( new Boolean( true ) ); + } + else if ( a.getFormacao_shst().matches( "n" ) ) + { + rbFormacaoSHSTN.setSelected( new Boolean( true ) ); + txtFormacaoSHSTNWhy.setText( a.getFormacao_shst_nao_porque() ); + } + else //t + { + rbFormacaoSHSTY.setSelected( null ); + rbFormacaoSHSTN.setSelected( null ); + } - private StaticText stDataAcidente1 = new StaticText(); + if ( a.getOutros_acidentes_com_colaborador().matches( "y" ) ) + { + rbAcidentesColaboradorY.setSelected( new Boolean( true ) ); + try + { + txtNrAcidentesColaborador.setText( a.getNr_acidentes_com_colaborador().toString() ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + try + { + txtNrRelatorioAcidentesColaborador1.setText( a.getNr_relatorio_acidente_colaborador1().toString() ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + try + { + txtNrRelatorioAcidentesColaborador2.setText( a.getNr_relatorio_acidente_colaborador2().toString() ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + try + { + txtNrRelatorioAcidentesColaborador3.setText( a.getNr_relatorio_acidente_colaborador3().toString() ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + try + { + txtNrRelatorioAcidentesColaborador4.setText( a.getNr_relatorio_acidente_colaborador4().toString() ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + } + else if ( a.getOutros_acidentes_com_colaborador().matches( "n" ) ) + { + rbAcidentesColaboradorN.setSelected( new Boolean( true ) ); + } + else //t + { + rbAcidentesColaboradorY.setSelected( null ); + rbAcidentesColaboradorN.setSelected( null ); + } - public StaticText getStDataAcidente1() { - return stDataAcidente1; - } + if ( a.getAcidentes_outros_colaboradores().matches( "y" ) ) + { + rbAcidentesColaboradoresY.setSelected( new Boolean( true ) ); + try + { + txtNrAcidentesColaboradores.setText( a.getNr_acidentes_outros_colaboradores().toString() ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } - public void setStDataAcidente1(StaticText st) { - this.stDataAcidente1 = st; - } + try + { + txtNrRelatorioAcidentesColaboradores1.setText( a.getNr_relatorio_acidente_outros_colaboradores1().toString() ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } - private PanelGroup groupPanel60 = new PanelGroup(); + try + { + txtNrRelatorioAcidentesColaboradores2.setText( a.getNr_relatorio_acidente_outros_colaboradores2().toString() ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } - public PanelGroup getGroupPanel60() { - return groupPanel60; - } + try + { + txtNrRelatorioAcidentesColaboradores3.setText( a.getNr_relatorio_acidente_outros_colaboradores3().toString() ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } - public void setGroupPanel60(PanelGroup pg) { - this.groupPanel60 = pg; - } + try + { + txtNrRelatorioAcidentesColaboradores4.setText( a.getNr_relatorio_acidente_outros_colaboradores4().toString() ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + } + else if ( a.getAcidentes_outros_colaboradores().matches( "n" ) ) + { + rbAcidentesColaboradoresN.setSelected( new Boolean( true ) ); + } + else //t + { + rbAcidentesColaboradoresY.setSelected( null ); + rbAcidentesColaboradoresN.setSelected( null ); + } + } - private StaticText lblHoraAcidente = new StaticText(); + private void fillDadosAcidenteRhView( AnaliseAcidente a ) + { + StaticText st = new StaticText(); + st.setId( "stSHST" ); + st.setEscape( false ); - public StaticText getLblHoraAcidente() { - return lblHoraAcidente; - } + StaticText st1 = new StaticText(); + st1.setId( "stColaborador" ); + st1.setEscape( false ); - public void setLblHoraAcidente(StaticText st) { - this.lblHoraAcidente = st; - } + StaticText st2 = new StaticText(); + st2.setId( "stColaboradores" ); + st2.setEscape( false ); - private StaticText stHoraAcidente1 = new StaticText(); + if ( a.getFormacao_shst().matches( "y" ) ) + { + st.setText( "O colaborador teve formação em SHST." ); + gridSHST.getChildren().add( st ); + } + else if ( a.getFormacao_shst().matches( "n" ) ) + { + 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 ); + } + else + { + gridSHST.setRendered( false ); + } - public StaticText getStHoraAcidente1() { - return stHoraAcidente1; - } - public void setStHoraAcidente1(StaticText st) { - this.stHoraAcidente1 = st; - } + if ( a.getOutros_acidentes_com_colaborador().matches( "y" ) ) + { + st1.setText( "Verificaram-se outras ocorrê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; + } - private HtmlPanelGrid gridVerificacao = new HtmlPanelGrid(); + 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 ); + } - public HtmlPanelGrid getGridVerificacao() { - return gridVerificacao; - } + } + 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 ); + } - public void setGridVerificacao(HtmlPanelGrid hpg) { - this.gridVerificacao = hpg; - } + } + else if ( a.getOutros_acidentes_com_colaborador().matches( "n" ) ) + { + st1.setText( "Não se verificaram outras ocorrências/incidências no mesmo posto de trabalho com o colaborador acidentado." ); + gridColaborador.getChildren().add( st1 ); + } + else //t + { + gridColaborador.setRendered( false ); + } - private HtmlPanelGrid gridPanel131 = new HtmlPanelGrid(); + 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; + } - public HtmlPanelGrid getGridPanel131() { - return gridPanel131; - } - - public void setGridPanel131(HtmlPanelGrid hpg) { - this.gridPanel131 = hpg; - } - - private StaticText staticText52 = new StaticText(); + 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 if ( a.getAcidentes_outros_colaboradores().matches( "n" ) ) + { + st2.setText( "Não se verificaram ocorrências/incidentes com outros colaboradores." ); + gridColaboradores.getChildren().add( st2 ); + } + else //t + { + gridColaboradores.setRendered( false ); + } + } - public StaticText getStaticText52() { - return staticText52; - } + private void fillRecomendacoesHs( AnaliseAcidente a ) + { +// AnalisesDataProvider adp = new AnalisesDataProvider(); + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + 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 + { - public void setStaticText52(StaticText st) { - this.staticText52 = st; - } + //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 ); - private HtmlPanelGrid gridPanel132 = new HtmlPanelGrid(); + } + seq++; + } + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + } - public HtmlPanelGrid getGridPanel132() { - return gridPanel132; - } + private void fillRecomendacoesViewHs( AnaliseAcidente a ) + { +// AnalisesDataProvider adp = new AnalisesDataProvider(); + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); - public void setGridPanel132(HtmlPanelGrid hpg) { - this.gridPanel132 = hpg; - } + 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 ) + { + ErrorLogger.logException( ex ); + } + } - private HtmlPanelGrid gridPanel133 = new HtmlPanelGrid(); + private void fillMedidasRh( AnaliseAcidente a ) + { +// AnalisesDataProvider adp = new AnalisesDataProvider(); + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); - public HtmlPanelGrid getGridPanel133() { - return gridPanel133; - } + 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 ) + { + ErrorLogger.logException( ex ); + } + } - public void setGridPanel133(HtmlPanelGrid hpg) { - this.gridPanel133 = hpg; - } + private void fillMedidasViewRh( AnaliseAcidente a ) + { + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); - private PanelGroup grpVerHs = new PanelGroup(); + 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 ) + { + ErrorLogger.logException( ex ); + } + } - public PanelGroup getGrpVerHs() { - return grpVerHs; - } + private void fillMedico( AnaliseAcidente a ) + { - public void setGrpVerHs(PanelGroup pg) { - this.grpVerHs = pg; - } + if ( a.getLesao_cabeca().matches( "y" ) ) + { + chkCabeca.setSelected( new Boolean( true ) ); + } - private Checkbox chkVerHs = new Checkbox(); + if ( a.getLesao_pescoco().matches( "y" ) ) + { + chkPescoco.setSelected( new Boolean( true ) ); + } - public Checkbox getChkVerHs() { - return chkVerHs; - } + if ( a.getLesao_tronco().matches( "y" ) ) + { + chkTronco.setSelected( new Boolean( true ) ); + } - public void setChkVerHs(Checkbox c) { - this.chkVerHs = c; - } + if ( a.getLesao_membro_sup_dir().matches( "y" ) ) + { + chkMembroSupDir.setSelected( new Boolean( true ) ); + //lblEspecif1.setRendered(true); + //txtEspecif1.setRendered(true); + lblEspecif1.setVisible( true ); + txtEspecif1.setVisible( true ); - private StaticText stVerHs = new StaticText(); + txtEspecif1.setText( a.getEspecif1() ); + } + else + { + //lblEspecif1.setRendered(false); + //txtEspecif1.setRendered(false); + lblEspecif1.setVisible( false ); + txtEspecif1.setVisible( false ); - public StaticText getStVerHs() { - return stVerHs; - } + } - public void setStVerHs(StaticText st) { - this.stVerHs = st; - } + if ( a.getLesao_membro_sup_esq().matches( "y" ) ) + { + chkMembroSupEsq.setSelected( new Boolean( true ) ); +// lblEspecif2.setRendered(true); +// txtEspecif2.setRendered(true); + lblEspecif2.setVisible( true ); + txtEspecif2.setVisible( true ); + txtEspecif2.setText( a.getEspecif2() ); + } + else + { + lblEspecif2.setVisible( false ); + txtEspecif2.setVisible( false ); + } - private PanelGroup grpVerRespSeg = new PanelGroup(); + if ( a.getLesao_membro_inf_dir().matches( "y" ) ) + { + chkMembroInfDir.setSelected( new Boolean( true ) ); + lblEspecif3.setVisible( true ); + txtEspecif3.setVisible( true ); + txtEspecif3.setText( a.getEspecif3() ); + } + else + { + lblEspecif3.setVisible( false ); + txtEspecif3.setVisible( false ); + } - public PanelGroup getGrpVerRespSeg() { - return grpVerRespSeg; - } + if ( a.getLesao_membro_inf_esq().matches( "y" ) ) + { + chkMembroInfEsq.setSelected( new Boolean( true ) ); + lblEspecif4.setVisible( true ); + txtEspecif4.setVisible( true ); + txtEspecif4.setText( a.getEspecif4() ); + } + else + { + lblEspecif4.setVisible( false ); + txtEspecif4.setVisible( false ); + } - public void setGrpVerRespSeg(PanelGroup pg) { - this.grpVerRespSeg = pg; - } + 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 ) ); + } + else + { + rbIncapacidadeNone.setSelected( null ); + rbIncapacidadeTemp.setSelected( null ); + rbIncapacidadePerm.setSelected( null ); + } - private Checkbox chkVerRespSeg = new Checkbox(); + if ( a.getCoef_incapacidade() == null ) + { + txtCoefIncapacidade.setText( "" ); + } + else + { + txtCoefIncapacidade.setText( a.getCoef_incapacidade() ); + } - public Checkbox getChkVerRespSeg() { - return chkVerRespSeg; - } - public void setChkVerRespSeg(Checkbox c) { - this.chkVerRespSeg = c; - } + if ( a.getData_aval_incapacidade() != null ) + { + java.util.Date ddate = new java.util.Date( a.getData_aval_incapacidade().getTime() ); + calAvaliacaoIncap.setValue( ddate ); + } - private StaticText stVerRespSeg = new StaticText(); + if ( a.getData_rev_incapacidade() != null ) + { + java.util.Date ddate = new java.util.Date( a.getData_rev_incapacidade().getTime() ); + calRevisaoIncap.setValue( ddate ); + } - public StaticText getStVerRespSeg() { - return stVerRespSeg; - } + if ( a.getPeriodo_incapacidade_de() != null ) + { + java.util.Date ddate = new java.util.Date( a.getPeriodo_incapacidade_de().getTime() ); + calPeridoIncapDe.setValue( ddate ); + } - public void setStVerRespSeg(StaticText st) { - this.stVerRespSeg = st; - } + if ( a.getPeriodo_incapacidade_a() != null ) + { + java.util.Date ddate = new java.util.Date( a.getPeriodo_incapacidade_a().getTime() ); + calPeriodoIncapA.setValue( ddate ); + } - private PanelGroup grpVerRespRh = new PanelGroup(); + if ( a.getImg_flexao().matches( "y" ) ) + { + chkImgFlexao.setSelected( new Boolean( true ) ); + } - public PanelGroup getGrpVerRespRh() { - return grpVerRespRh; - } + if ( a.getImg_rot1().matches( "y" ) ) + { + chkImgRot1.setSelected( new Boolean( true ) ); + } - public void setGrpVerRespRh(PanelGroup pg) { - this.grpVerRespRh = pg; - } + if ( a.getImg_rot2().matches( "y" ) ) + { + chkImgRot2.setSelected( new Boolean( true ) ); + } - private Checkbox chkVerRespRh = new Checkbox(); + if ( a.getImg_ext1().matches( "y" ) ) + { + chkImgExt1.setSelected( new Boolean( true ) ); + } - public Checkbox getChkVerRespRh() { - return chkVerRespRh; - } + if ( a.getImg_ext2().matches( "y" ) ) + { + chkImgExt2.setSelected( new Boolean( true ) ); + } - public void setChkVerRespRh(Checkbox c) { - this.chkVerRespRh = c; - } + if ( a.getImg_cab1().matches( "y" ) ) + { + chkImgCab1.setSelected( new Boolean( true ) ); + } - private StaticText stVerRespRh = new StaticText(); + if ( a.getImg_cab2().matches( "y" ) ) + { + chkImgCab2.setSelected( new Boolean( true ) ); + } - public StaticText getStVerRespRh() { - return stVerRespRh; - } + if ( a.getImg_cab3().matches( "y" ) ) + { + chkImgCab3.setSelected( new Boolean( true ) ); + } - public void setStVerRespRh(StaticText st) { - this.stVerRespRh = st; - } + if ( a.getImg_cab4().matches( "y" ) ) + { + chkImgCab4.setSelected( new Boolean( true ) ); + } - private HtmlPanelGrid gridVerificacaoView = new HtmlPanelGrid(); + if ( a.getImg_ma1().matches( "y" ) ) + { + chkImgMa1.setSelected( new Boolean( true ) ); + } - public HtmlPanelGrid getGridVerificacaoView() { - return gridVerificacaoView; - } + if ( a.getImg_ma2().matches( "y" ) ) + { + chkImgMa2.setSelected( new Boolean( true ) ); + } - public void setGridVerificacaoView(HtmlPanelGrid hpg) { - this.gridVerificacaoView = hpg; - } + if ( a.getImg_ma3().matches( "y" ) ) + { + chkImgMa3.setSelected( new Boolean( true ) ); + } - private HtmlPanelGrid gridPanel134 = new HtmlPanelGrid(); + if ( a.getImg_ma4().matches( "y" ) ) + { + chkImgMa4.setSelected( new Boolean( true ) ); + } - public HtmlPanelGrid getGridPanel134() { - return gridPanel134; - } + if ( a.getImg_ma5().matches( "y" ) ) + { + chkImgMa5.setSelected( new Boolean( true ) ); + } - public void setGridPanel134(HtmlPanelGrid hpg) { - this.gridPanel134 = hpg; - } + if ( a.getImg_ma6().matches( "y" ) ) + { + chkImgMa6.setSelected( new Boolean( true ) ); + } - private StaticText staticText187 = new StaticText(); + if ( a.getImg_ma7().matches( "y" ) ) + { + chkImgMa7.setSelected( new Boolean( true ) ); + } - public StaticText getStaticText187() { - return staticText187; - } + if ( a.getImg_ma8().matches( "y" ) ) + { + chkImgMa8.setSelected( new Boolean( true ) ); + } - public void setStaticText187(StaticText st) { - this.staticText187 = st; - } + if ( a.getImg_ma9().matches( "y" ) ) + { + chkImgMa9.setSelected( new Boolean( true ) ); + } - private HtmlPanelGrid gridPanel135 = new HtmlPanelGrid(); + if ( a.getImg_ma10().matches( "y" ) ) + { + chkImgMa10.setSelected( new Boolean( true ) ); + } - public HtmlPanelGrid getGridPanel135() { - return gridPanel135; - } + 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 ); + } - public void setGridPanel135(HtmlPanelGrid hpg) { - this.gridPanel135 = hpg; - } + if ( a.getRestricao_motricidade().matches( "y" ) ) + { + chkRestricaoMotricidade.setSelected( new Boolean( true ) ); + } - private HtmlPanelGrid gridAssinaturasView = new HtmlPanelGrid(); + if ( a.getRestricao_conducao().matches( "y" ) ) + { + chkRestricaoConducao.setSelected( new Boolean( true ) ); + } - public HtmlPanelGrid getGridAssinaturasView() { - return gridAssinaturasView; - } + if ( a.getRestricao_vibracoes().matches( "y" ) ) + { + chkRestricaoVibracoes.setSelected( new Boolean( true ) ); + } - public void setGridAssinaturasView(HtmlPanelGrid hpg) { - this.gridAssinaturasView = hpg; - } + if ( a.getRestricao_outras() != null ) + { + if ( a.getRestricao_outras().trim().length() > 0 ) + { + chkRestricaoOutras.setSelected( new Boolean( true ) ); + txtRestricaoOutras.setText( a.getRestricao_outras() ); + } + } - private DropDown drpCausas = new DropDown(); + txtObservacoes.setText( a.getMed_observ() ); - public DropDown getDrpCausas() { - return drpCausas; - } + } - public void setDrpCausas(DropDown dd) { - this.drpCausas = dd; - } + private void fillMedicoView( AnaliseAcidente a ) + { + PanelGroup pg = null; + StaticText st = null; + HtmlPanelGrid grd = null; + ImageComponent img = null; + //LESAO : - private StaticText stObservacoesCorr = new StaticText(); + if ( a.getLesao_cabeca().matches( "y" ) ) + { + st = new StaticText(); + st.setId( "stLesaoCabeca" ); + st.setEscape( false ); + st.setText( "Cabeça" ); + gridLesao.getChildren().add( st ); + } - public StaticText getStObservacoesCorr() { - return stObservacoesCorr; - } + if ( a.getLesao_pescoco().matches( "y" ) ) + { + st = new StaticText(); + st.setId( "stLesaoPescoco" ); + st.setEscape( false ); + st.setText( "Pescoço" ); + gridLesao.getChildren().add( st ); + } - public void setStObservacoesCorr(StaticText st) { - this.stObservacoesCorr = st; - } + if ( a.getLesao_tronco().matches( "y" ) ) + { + st = new StaticText(); + st.setId( "stLesaoTronco" ); + st.setEscape( false ); + st.setText( "Tronco" ); + gridLesao.getChildren().add( st ); + } - private HtmlPanelGrid gridImpressao = new HtmlPanelGrid(); + 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 ); + if ( a.getEspecif1() != null ) + { + if ( a.getEspecif1().trim().length() > 0 ) + { + st = new StaticText(); + st.setId( "stEspecif1" ); + st.setEscape( false ); + st.setText( " - " + a.getEspecif1() ); + grd.getChildren().add( st ); + } + } - public HtmlPanelGrid getGridImpressao() { - return gridImpressao; - } + } - public void setGridImpressao(HtmlPanelGrid hpg) { - this.gridImpressao = hpg; - } + 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 ); + if ( a.getEspecif2() != null ) + { + if ( a.getEspecif2().trim().length() > 0 ) + { + st = new StaticText(); + st.setId( "stEspecif2" ); + st.setEscape( false ); + st.setText( " - " + a.getEspecif2() ); + grd.getChildren().add( st ); + } + } - private HtmlPanelGrid gridPanel89 = new HtmlPanelGrid(); + } - public HtmlPanelGrid getGridPanel89() { - return gridPanel89; - } + 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 ); + if ( a.getEspecif3() != null ) + { + if ( a.getEspecif3().trim().length() > 0 ) + { + st = new StaticText(); + st.setId( "stEspecif3" ); + st.setEscape( false ); + st.setText( a.getEspecif3() ); + grd.getChildren().add( st ); + } + } + } - public void setGridPanel89(HtmlPanelGrid hpg) { - this.gridPanel89 = hpg; - } + 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 ); + if ( a.getEspecif4() != null ) + { + if ( a.getEspecif4().trim().length() > 0 ) + { + st = new StaticText(); + st.setId( "stEspecif4" ); + st.setEscape( false ); + st.setText( a.getEspecif4() ); + grd.getChildren().add( st ); + } + } - private StaticText staticText73 = new StaticText(); + } + if ( grd.getChildren().size() > 0 ) + { + gridLesao.getChildren().add( grd ); + } - public StaticText getStaticText73() { - return staticText73; - } + 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 ); + } - public void setStaticText73(StaticText st) { - this.staticText73 = st; - } + //INCAPACIDADE : + pg = new PanelGroup(); + pg.setId( "pgTipoIncapacidade" ); + st = new StaticText(); + st.setId( "stTipoIncapacidadeLbl1" ); + st.setStyle( "font-weight: bold" ); + 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.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 ); + } - private HtmlPanelGrid gridPanel91 = new HtmlPanelGrid(); + if ( pg.getChildren().size() > 0 ) + { + gridIncapacidade2.getChildren().add( pg ); + } - public HtmlPanelGrid getGridPanel91() { - return gridPanel91; - } + pg = new PanelGroup(); + if ( a.getData_aval_incapacidade() != null ) + { - public void setGridPanel91(HtmlPanelGrid hpg) { - this.gridPanel91 = hpg; - } + 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 ) + { +// ErrorLogger.logException( ex ); + } + pg.getChildren().add( st ); + } - private HtmlPanelGrid gridPanel92 = new HtmlPanelGrid(); - public HtmlPanelGrid getGridPanel92() { - return gridPanel92; - } + if ( a.getData_rev_incapacidade() != null ) + { + 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 ) + { +// ErrorLogger.logException( ex ); + } + pg.getChildren().add( st ); + } - public void setGridPanel92(HtmlPanelGrid hpg) { - this.gridPanel92 = hpg; - } - private PanelGroup grpAssSup = new PanelGroup(); + if ( pg.getChildren().size() > 0 ) + { + gridIncapacidade2.getChildren().add( pg ); + } - public PanelGroup getGrpAssSup() { - return grpAssSup; - } - public void setGrpAssSup(PanelGroup pg) { - this.grpAssSup = pg; - } + pg = new PanelGroup(); - private Checkbox chkAssSup = new Checkbox(); + if ( a.getPeriodo_incapacidade_de() != null || a.getPeriodo_incapacidade_a() != null ) + { - public Checkbox getChkAssSup() { - return chkAssSup; - } + 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 ) + { +// ErrorLogger.logException( 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 ) + { +// ErrorLogger.logException( ex ); + } + pg.getChildren().add( st ); - public void setChkAssSup(Checkbox c) { - this.chkAssSup = c; - } + } - private StaticText stAssSup1 = new StaticText(); + if ( pg.getChildren().size() > 0 ) + { + gridIncapacidade2.getChildren().add( pg ); + } - public StaticText getStAssSup1() { - return stAssSup1; - } - public void setStAssSup1(StaticText st) { - this.stAssSup1 = st; - } + //RESTRICOES - private HtmlPanelGrid gridImpressaoView = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridImpressaoView() { - return gridImpressaoView; - } - - public void setGridImpressaoView(HtmlPanelGrid hpg) { - this.gridImpressaoView = hpg; - } - - private HtmlPanelGrid gridPanel93 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel93() { - return gridPanel93; - } - - public void setGridPanel93(HtmlPanelGrid hpg) { - this.gridPanel93 = hpg; - } - - private StaticText staticText76 = new StaticText(); - - public StaticText getStaticText76() { - return staticText76; - } - - public void setStaticText76(StaticText st) { - this.staticText76 = st; - } - - private HtmlPanelGrid gridPanel94 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel94() { - return gridPanel94; - } - - public void setGridPanel94(HtmlPanelGrid hpg) { - this.gridPanel94 = hpg; - } - - private HtmlPanelGrid gridAssSupView = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridAssSupView() { - return gridAssSupView; - } - - public void setGridAssSupView(HtmlPanelGrid hpg) { - this.gridAssSupView = hpg; - } - - private HtmlPanelGrid gridPanel22 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel22() { - return gridPanel22; - } - - public void setGridPanel22(HtmlPanelGrid hpg) { - this.gridPanel22 = 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 butImprimir = new Button(); - - public Button getButImprimir() { - return butImprimir; - } - - public void setButImprimir(Button b) { - this.butImprimir = b; - } - - private Button butGravar = new Button(); - - public Button getButGravar() { - return butGravar; - } - - public void setButGravar(Button b) { - this.butGravar = b; - } - - private Button butCorrecao = new Button(); - - public Button getButCorrecao() { - return butCorrecao; - } - - public void setButCorrecao(Button b) { - this.butCorrecao = b; - } - - private Button butEnviar = new Button(); - - public Button getButEnviar() { - return butEnviar; - } - - public void setButEnviar(Button b) { - this.butEnviar = b; - } - - private TextField txtAssSup = new TextField(); - - public TextField getTxtAssSup() { - return txtAssSup; - } - - public void setTxtAssSup(TextField tf) { - this.txtAssSup = tf; - } - - private StaticText stAssSup2 = new StaticText(); - - public StaticText getStAssSup2() { - return stAssSup2; - } - - public void setStAssSup2(StaticText st) { - this.stAssSup2 = st; - } - - private HtmlPanelGrid gridPanel95 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel95() { - return gridPanel95; - } - - public void setGridPanel95(HtmlPanelGrid hpg) { - this.gridPanel95 = hpg; - } - - private PanelGroup groupPanel50 = new PanelGroup(); - - public PanelGroup getGroupPanel50() { - return groupPanel50; - } - - public void setGroupPanel50(PanelGroup pg) { - this.groupPanel50 = pg; - } - - private StaticText staticText98 = new StaticText(); - - public StaticText getStaticText98() { - return staticText98; - } - - public void setStaticText98(StaticText st) { - this.staticText98 = st; - } - - private TextField txtAveriguador = new TextField(); - - public TextField getTxtAveriguador() { - return txtAveriguador; - } - - public void setTxtAveriguador(TextField tf) { - this.txtAveriguador = tf; - } - - 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 StaticText stAveriguador = new StaticText(); - - public StaticText getStAveriguador() { - return stAveriguador; - } - - public void setStAveriguador(StaticText st) { - this.stAveriguador = st; - } - - private HtmlPanelGrid gridPanel97 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel97() { - return gridPanel97; - } - - public void setGridPanel97(HtmlPanelGrid hpg) { - this.gridPanel97 = hpg; - } - - private PanelGroup groupPanel52 = new PanelGroup(); - - public PanelGroup getGroupPanel52() { - return groupPanel52; - } - - public void setGroupPanel52(PanelGroup pg) { - this.groupPanel52 = pg; - } - - private Checkbox chkAveriguacaoPosterior = new Checkbox(); - - public Checkbox getChkAveriguacaoPosterior() { - return chkAveriguacaoPosterior; - } - - public void setChkAveriguacaoPosterior(Checkbox c) { - this.chkAveriguacaoPosterior = c; - } - - private StaticText staticText132 = new StaticText(); - - public StaticText getStaticText132() { - return staticText132; - } - - public void setStaticText132(StaticText st) { - this.staticText132 = st; - } - - private HtmlPanelGrid gridPanel98 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel98() { - return gridPanel98; - } - - public void setGridPanel98(HtmlPanelGrid hpg) { - this.gridPanel98 = hpg; - } - - private StaticText staticText104 = new StaticText(); - - public StaticText getStaticText104() { - return staticText104; - } - - public void setStaticText104(StaticText st) { - this.staticText104 = st; - } - - private HtmlPanelGrid gridPanel99 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel99() { - return gridPanel99; - } - - public void setGridPanel99(HtmlPanelGrid hpg) { - this.gridPanel99 = hpg; - } - - private StaticText staticText131 = new StaticText(); - - public StaticText getStaticText131() { - return staticText131; - } - - public void setStaticText131(StaticText st) { - this.staticText131 = st; - } - - private TextArea txtAveriguacaoObs = new TextArea(); - - public TextArea getTxtAveriguacaoObs() { - return txtAveriguacaoObs; - } - - public void setTxtAveriguacaoObs(TextArea ta) { - this.txtAveriguacaoObs = ta; - } - - private HtmlPanelGrid gridAveriguacaoPosterior = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridAveriguacaoPosterior() { - return gridAveriguacaoPosterior; - } - - public void setGridAveriguacaoPosterior(HtmlPanelGrid hpg) { - this.gridAveriguacaoPosterior = hpg; - } - - private StaticText lblAveriguacaoPosterior = new StaticText(); - - public StaticText getLblAveriguacaoPosterior() { - return lblAveriguacaoPosterior; - } - - public void setLblAveriguacaoPosterior(StaticText st) { - this.lblAveriguacaoPosterior = st; - } - - private StaticText txtAveriguacaoPosterior = new StaticText(); - - public StaticText getTxtAveriguacaoPosterior() { - return txtAveriguacaoPosterior; - } - - public void setTxtAveriguacaoPosterior(StaticText st) { - this.txtAveriguacaoPosterior = st; - } - - private HtmlPanelGrid gridAveriguacaoPosterior1 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridAveriguacaoPosterior1() { - return gridAveriguacaoPosterior1; - } - - public void setGridAveriguacaoPosterior1(HtmlPanelGrid hpg) { - this.gridAveriguacaoPosterior1 = hpg; - } - - private HtmlPanelGrid gridPanel101 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel101() { - return gridPanel101; - } - - public void setGridPanel101(HtmlPanelGrid hpg) { - this.gridPanel101 = hpg; - } - - private StaticText staticText134 = new StaticText(); - - public StaticText getStaticText134() { - return staticText134; - } - - public void setStaticText134(StaticText st) { - this.staticText134 = st; - } - - private HtmlPanelGrid gridPanel102 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel102() { - return gridPanel102; - } - - public void setGridPanel102(HtmlPanelGrid hpg) { - this.gridPanel102 = hpg; - } - - private StaticText staticText135 = new StaticText(); - - public StaticText getStaticText135() { - return staticText135; - } - - public void setStaticText135(StaticText st) { - this.staticText135 = st; - } - - private TextArea txtAveriguacaoObs1 = new TextArea(); - - public TextArea getTxtAveriguacaoObs1() { - return txtAveriguacaoObs1; - } - - public void setTxtAveriguacaoObs1(TextArea ta) { - this.txtAveriguacaoObs1 = ta; - } - - private StaticText staticText130 = new StaticText(); - - public StaticText getStaticText130() { - return staticText130; - } - - public void setStaticText130(StaticText st) { - this.staticText130 = st; - } - - private StaticText stEstabelecimentoOrigem = new StaticText(); - - public StaticText getStEstabelecimentoOrigem() { - return stEstabelecimentoOrigem; - } - - public void setStEstabelecimentoOrigem(StaticText st) { - this.stEstabelecimentoOrigem = st; - } - - private HtmlPanelGrid gridPanel100 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel100() { - return gridPanel100; - } - - public void setGridPanel100(HtmlPanelGrid hpg) { - this.gridPanel100 = hpg; - } - - private StaticText staticText156 = new StaticText(); - - public StaticText getStaticText156() { - return staticText156; - } - - public void setStaticText156(StaticText st) { - this.staticText156 = st; - } - - private HtmlPanelGrid gridPanel103 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel103() { - return gridPanel103; - } - - public void setGridPanel103(HtmlPanelGrid hpg) { - this.gridPanel103 = hpg; - } - - private PanelGroup groupPanel53 = new PanelGroup(); - - public PanelGroup getGroupPanel53() { - return groupPanel53; - } - - public void setGroupPanel53(PanelGroup pg) { - this.groupPanel53 = pg; - } - - private StaticText staticText157 = new StaticText(); - - public StaticText getStaticText157() { - return staticText157; - } - - public void setStaticText157(StaticText st) { - this.staticText157 = st; - } - - private TextField txtNomeSuperior = new TextField(); - - public TextField getTxtNomeSuperior() { - return txtNomeSuperior; - } - - public void setTxtNomeSuperior(TextField tf) { - this.txtNomeSuperior = tf; - } - - private PanelGroup groupPanel54 = new PanelGroup(); - - public PanelGroup getGroupPanel54() { - return groupPanel54; - } - - public void setGroupPanel54(PanelGroup pg) { - this.groupPanel54 = pg; - } - - private StaticText staticText158 = new StaticText(); - - public StaticText getStaticText158() { - return staticText158; - } - - public void setStaticText158(StaticText st) { - this.staticText158 = st; - } - - private TextField txtEmailSuperior = new TextField(); - - public TextField getTxtEmailSuperior() { - return txtEmailSuperior; - } - - public void setTxtEmailSuperior(TextField tf) { - this.txtEmailSuperior = tf; - } - - private HtmlPanelGrid gridPanel104 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel104() { - return gridPanel104; - } - - public void setGridPanel104(HtmlPanelGrid hpg) { - this.gridPanel104 = hpg; - } - - private StaticText staticText159 = new StaticText(); - - public StaticText getStaticText159() { - return staticText159; - } - - public void setStaticText159(StaticText st) { - this.staticText159 = st; - } - - private HtmlPanelGrid gridPanel105 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel105() { - return gridPanel105; - } - - public void setGridPanel105(HtmlPanelGrid hpg) { - this.gridPanel105 = hpg; - } - - private PanelGroup groupPanel55 = new PanelGroup(); - - public PanelGroup getGroupPanel55() { - return groupPanel55; - } - - public void setGroupPanel55(PanelGroup pg) { - this.groupPanel55 = pg; - } - - private StaticText staticText160 = new StaticText(); - - public StaticText getStaticText160() { - return staticText160; - } - - public void setStaticText160(StaticText st) { - this.staticText160 = st; - } - - private StaticText stNomeSuperior = new StaticText(); - - public StaticText getStNomeSuperior() { - return stNomeSuperior; - } - - public void setStNomeSuperior(StaticText st) { - this.stNomeSuperior = st; - } - - private PanelGroup groupPanel61 = new PanelGroup(); - - public PanelGroup getGroupPanel61() { - return groupPanel61; - } - - public void setGroupPanel61(PanelGroup pg) { - this.groupPanel61 = pg; - } - - private StaticText staticText162 = new StaticText(); - - public StaticText getStaticText162() { - return staticText162; - } - - public void setStaticText162(StaticText st) { - this.staticText162 = st; - } - - private StaticText stEmailSuperior = new StaticText(); - - public StaticText getStEmailSuperior() { - return stEmailSuperior; - } - - public void setStEmailSuperior(StaticText st) { - this.stEmailSuperior = st; - } - - private HiddenField hidDisableImprimir = new HiddenField(); - - public HiddenField getHidDisableImprimir() { - return hidDisableImprimir; - } - - public void setHidDisableImprimir(HiddenField hf) { - this.hidDisableImprimir = hf; - } - - private DropDown drpSeccao = new DropDown(); - - public DropDown getDrpSeccao() { - return drpSeccao; - } - - public void setDrpSeccao(DropDown dd) { - this.drpSeccao = dd; - } - - private StaticText staticText163 = new StaticText(); - - public StaticText getStaticText163() { - return staticText163; - } - - public void setStaticText163(StaticText st) { - this.staticText163 = st; - } - - private DropDown drpDepartamento = new DropDown(); - - public DropDown getDrpDepartamento() { - return drpDepartamento; - } - - public void setDrpDepartamento(DropDown dd) { - this.drpDepartamento = dd; - } - - private HiddenField hidAnchor = new HiddenField(); - - public HiddenField getHidAnchor() { - return hidAnchor; - } - - public void setHidAnchor(HiddenField hf) { - this.hidAnchor = hf; - } - - private PanelGroup groupPanel62 = new PanelGroup(); - - public PanelGroup getGroupPanel62() { - return groupPanel62; - } - - public void setGroupPanel62(PanelGroup pg) { - this.groupPanel62 = pg; - } - - private StaticText staticText164 = new StaticText(); - - public StaticText getStaticText164() { - return staticText164; - } - - public void setStaticText164(StaticText st) { - this.staticText164 = st; - } - - private StaticText staticText167 = new StaticText(); - - public StaticText getStaticText167() { - return staticText167; - } - - public void setStaticText167(StaticText st) { - this.staticText167 = st; - } - - private PanelGroup groupPanel63 = new PanelGroup(); - - public PanelGroup getGroupPanel63() { - return groupPanel63; - } - - public void setGroupPanel63(PanelGroup pg) { - this.groupPanel63 = pg; - } - - private StaticText staticText171 = new StaticText(); - - public StaticText getStaticText171() { - return staticText171; - } - - public void setStaticText171(StaticText st) { - this.staticText171 = st; - } - - private StaticText stTecnicoNome = new StaticText(); - - public StaticText getStTecnicoNome() { - return stTecnicoNome; - } - - public void setStTecnicoNome(StaticText st) { - this.stTecnicoNome = st; - } - - private StaticText staticText172 = new StaticText(); - - public StaticText getStaticText172() { - return staticText172; - } - - public void setStaticText172(StaticText st) { - this.staticText172 = st; - } - - private StaticText staticText173 = new StaticText(); - - public StaticText getStaticText173() { - return staticText173; - } - - public void setStaticText173(StaticText st) { - this.staticText173 = st; - } - - private StaticText txtCap1 = new StaticText(); - - public StaticText getTxtCap1() { - return txtCap1; - } - - public void setTxtCap1(StaticText st) { - this.txtCap1 = st; - } - - private PanelGroup groupPanel64 = new PanelGroup(); - - public PanelGroup getGroupPanel64() { - return groupPanel64; - } - - public void setGroupPanel64(PanelGroup pg) { - this.groupPanel64 = pg; - } - - private StaticText staticText174 = new StaticText(); - - public StaticText getStaticText174() { - return staticText174; - } - - public void setStaticText174(StaticText st) { - this.staticText174 = st; - } - - private StaticText stMedicoNome = new StaticText(); - - public StaticText getStMedicoNome() { - return stMedicoNome; - } - - public void setStMedicoNome(StaticText st) { - this.stMedicoNome = st; - } - - private StaticText staticText175 = new StaticText(); - - public StaticText getStaticText175() { - return staticText175; - } - - public void setStaticText175(StaticText st) { - this.staticText175 = st; - } - - private StaticText staticText176 = new StaticText(); - - public StaticText getStaticText176() { - return staticText176; - } - - public void setStaticText176(StaticText st) { - this.staticText176 = st; - } - - private StaticText txtCedula1 = new StaticText(); - - public StaticText getTxtCedula1() { - return txtCedula1; - } - - public void setTxtCedula1(StaticText st) { - this.txtCedula1 = st; - } - - private HtmlPanelGrid gridPanel14 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel14() { - return gridPanel14; - } - - public void setGridPanel14(HtmlPanelGrid hpg) { - this.gridPanel14 = hpg; - } - - private StaticText staticText15 = new StaticText(); - - public StaticText getStaticText15() { - return staticText15; - } - - public void setStaticText15(StaticText st) { - this.staticText15 = st; - } - - private com.sun.rave.web.ui.component.Calendar calDataOcorrencia = new com.sun.rave.web.ui.component.Calendar(); - - public com.sun.rave.web.ui.component.Calendar getCalDataOcorrencia() { - return calDataOcorrencia; - } - - public void setCalDataOcorrencia(com.sun.rave.web.ui.component.Calendar c) { - this.calDataOcorrencia = c; - } - - private PanelGroup groupPanel9 = new PanelGroup(); - - public PanelGroup getGroupPanel9() { - return groupPanel9; - } - - public void setGroupPanel9(PanelGroup pg) { - this.groupPanel9 = pg; - } - - private StaticText staticText71 = new StaticText(); - - public StaticText getStaticText71() { - return staticText71; - } - - public void setStaticText71(StaticText st) { - this.staticText71 = st; - } - - private DropDown drpHours = new DropDown(); - - public DropDown getDrpHours() { - return drpHours; - } - - public void setDrpHours(DropDown dd) { - this.drpHours = dd; - } - - private StaticText staticText72 = new StaticText(); - - public StaticText getStaticText72() { - return staticText72; - } - - public void setStaticText72(StaticText st) { - this.staticText72 = st; - } - - private DropDown drpMinutes = new DropDown(); - - public DropDown getDrpMinutes() { - return drpMinutes; - } - - public void setDrpMinutes(DropDown dd) { - this.drpMinutes = dd; - } - - private PanelGroup groupPanel8 = new PanelGroup(); - - public PanelGroup getGroupPanel8() { - return groupPanel8; - } - - public void setGroupPanel8(PanelGroup pg) { - this.groupPanel8 = pg; - } - - private StaticText staticText14 = new StaticText(); - - public StaticText getStaticText14() { - return staticText14; - } - - public void setStaticText14(StaticText st) { - this.staticText14 = st; - } - - private StaticText stNomeAcidentado = new StaticText(); - - public StaticText getStNomeAcidentado() { - return stNomeAcidentado; - } - - public void setStNomeAcidentado(StaticText st) { - this.stNomeAcidentado = st; - } - - private PanelGroup groupPanel15 = new PanelGroup(); - - public PanelGroup getGroupPanel15() { - return groupPanel15; - } - - public void setGroupPanel15(PanelGroup pg) { - this.groupPanel15 = pg; - } - - private StaticText staticText70 = new StaticText(); - - public StaticText getStaticText70() { - return staticText70; - } - - public void setStaticText70(StaticText st) { - this.staticText70 = st; - } - - private StaticText stEstabelecimentoOrigem1 = new StaticText(); - - public StaticText getStEstabelecimentoOrigem1() { - return stEstabelecimentoOrigem1; - } - - public void setStEstabelecimentoOrigem1(StaticText st) { - this.stEstabelecimentoOrigem1 = st; - } - - private PanelGroup groupPanel16 = new PanelGroup(); - - public PanelGroup getGroupPanel16() { - return groupPanel16; - } - - public void setGroupPanel16(PanelGroup pg) { - this.groupPanel16 = pg; - } - - private StaticText staticText74 = new StaticText(); - - public StaticText getStaticText74() { - return staticText74; - } - - public void setStaticText74(StaticText st) { - this.staticText74 = st; - } - - private StaticText stDataNascimento = new StaticText(); - - public StaticText getStDataNascimento() { - return stDataNascimento; - } - - public void setStDataNascimento(StaticText st) { - this.stDataNascimento = st; - } - - private PanelGroup groupPanel65 = new PanelGroup(); - - public PanelGroup getGroupPanel65() { - return groupPanel65; - } - - public void setGroupPanel65(PanelGroup pg) { - this.groupPanel65 = pg; - } - - private StaticText staticText75 = new StaticText(); - - public StaticText getStaticText75() { - return staticText75; - } - - public void setStaticText75(StaticText st) { - this.staticText75 = st; - } - - private StaticText stBI = new StaticText(); - - public StaticText getStBI() { - return stBI; - } - - public void setStBI(StaticText st) { - this.stBI = st; - } - - private PanelGroup groupPanel66 = new PanelGroup(); - - public PanelGroup getGroupPanel66() { - return groupPanel66; - } - - public void setGroupPanel66(PanelGroup pg) { - this.groupPanel66 = pg; - } - - private StaticText staticText77 = new StaticText(); - - public StaticText getStaticText77() { - return staticText77; - } - - public void setStaticText77(StaticText st) { - this.staticText77 = st; - } - - private StaticText stMorada = new StaticText(); - - public StaticText getStMorada() { - return stMorada; - } - - public void setStMorada(StaticText st) { - this.stMorada = st; - } - - private StaticText staticText79 = new StaticText(); - - public StaticText getStaticText79() { - return staticText79; - } - - public void setStaticText79(StaticText st) { - this.staticText79 = st; - } - - private StaticText stCodPostal = new StaticText(); - - public StaticText getStCodPostal() { - return stCodPostal; - } - - public void setStCodPostal(StaticText st) { - this.stCodPostal = st; - } - - private PanelGroup groupPanel67 = new PanelGroup(); - - public PanelGroup getGroupPanel67() { - return groupPanel67; - } - - public void setGroupPanel67(PanelGroup pg) { - this.groupPanel67 = pg; - } - - private StaticText staticText80 = new StaticText(); - - public StaticText getStaticText80() { - return staticText80; - } - - public void setStaticText80(StaticText st) { - this.staticText80 = st; - } - - private StaticText stContactoTelefonico = new StaticText(); - - public StaticText getStContactoTelefonico() { - return stContactoTelefonico; - } - - public void setStContactoTelefonico(StaticText st) { - this.stContactoTelefonico = st; - } - - private PanelGroup groupPanel68 = new PanelGroup(); - - public PanelGroup getGroupPanel68() { - return groupPanel68; - } - - public void setGroupPanel68(PanelGroup pg) { - this.groupPanel68 = pg; - } - - private StaticText staticText81 = new StaticText(); - - public StaticText getStaticText81() { - return staticText81; - } - - public void setStaticText81(StaticText st) { - this.staticText81 = st; - } - - private StaticText stDataAdmissao1 = new StaticText(); - - public StaticText getStDataAdmissao1() { - return stDataAdmissao1; - } - - public void setStDataAdmissao1(StaticText st) { - this.stDataAdmissao1 = st; - } - - private PanelGroup groupPanel69 = new PanelGroup(); - - public PanelGroup getGroupPanel69() { - return groupPanel69; - } - - public void setGroupPanel69(PanelGroup pg) { - this.groupPanel69 = pg; - } - - private StaticText staticText82 = new StaticText(); - - public StaticText getStaticText82() { - return staticText82; - } - - public void setStaticText82(StaticText st) { - this.staticText82 = st; - } - - private StaticText stFuncao1 = new StaticText(); - - public StaticText getStFuncao1() { - return stFuncao1; - } - - public void setStFuncao1(StaticText st) { - this.stFuncao1 = st; - } - - private PanelGroup groupPanel70 = new PanelGroup(); - - public PanelGroup getGroupPanel70() { - return groupPanel70; - } - - public void setGroupPanel70(PanelGroup pg) { - this.groupPanel70 = pg; - } - - private StaticText staticText83 = new StaticText(); - - public StaticText getStaticText83() { - return staticText83; - } - - public void setStaticText83(StaticText st) { - this.staticText83 = st; - } - - private StaticText stTurno = new StaticText(); - - public StaticText getStTurno() { - return stTurno; - } - - public void setStTurno(StaticText st) { - this.stTurno = st; - } - - private PanelGroup groupPanel71 = new PanelGroup(); - - public PanelGroup getGroupPanel71() { - return groupPanel71; - } - - public void setGroupPanel71(PanelGroup pg) { - this.groupPanel71 = pg; - } - - private StaticText staticText84 = new StaticText(); - - public StaticText getStaticText84() { - return staticText84; - } - - public void setStaticText84(StaticText st) { - this.staticText84 = st; - } - - private StaticText staticText85 = new StaticText(); - - public StaticText getStaticText85() { - return staticText85; - } - - public void setStaticText85(StaticText st) { - this.staticText85 = st; - } - - private PanelGroup groupPanel72 = new PanelGroup(); - - public PanelGroup getGroupPanel72() { - return groupPanel72; - } - - public void setGroupPanel72(PanelGroup pg) { - this.groupPanel72 = pg; - } - - private StaticText staticText86 = new StaticText(); - - public StaticText getStaticText86() { - return staticText86; - } - - public void setStaticText86(StaticText st) { - this.staticText86 = st; - } - - private StaticText stMedico = new StaticText(); - - public StaticText getStMedico() { - return stMedico; - } - - public void setStMedico(StaticText st) { - this.stMedico = st; - } - - private StaticText staticText87 = new StaticText(); - - public StaticText getStaticText87() { - return staticText87; - } - - public void setStaticText87(StaticText st) { - this.staticText87 = st; - } - - private StaticText staticText92 = new StaticText(); - - public StaticText getStaticText92() { - return staticText92; - } - - public void setStaticText92(StaticText st) { - this.staticText92 = st; - } - - private StaticText txtCedula = new StaticText(); - - public StaticText getTxtCedula() { - return txtCedula; - } - - public void setTxtCedula(StaticText st) { - this.txtCedula = st; - } - - private PanelGroup groupPanel4 = new PanelGroup(); - - public PanelGroup getGroupPanel4() { - return groupPanel4; - } - - public void setGroupPanel4(PanelGroup pg) { - this.groupPanel4 = pg; - } - - private StaticText staticText7 = new StaticText(); - - public StaticText getStaticText7() { - return staticText7; - } - - public void setStaticText7(StaticText st) { - this.staticText7 = st; - } - - private TextField txtHorasTurno = new TextField(); - - public TextField getTxtHorasTurno() { - return txtHorasTurno; - } - - public void setTxtHorasTurno(TextField tf) { - this.txtHorasTurno = tf; - } - - private HiddenField hidConfEnviar = new HiddenField(); - - public HiddenField getHidConfEnviar() { - return hidConfEnviar; - } - - public void setHidConfEnviar(HiddenField hf) { - this.hidConfEnviar = hf; - } - private StaticText lblUser = new StaticText(); - - public StaticText getLblUser() { - return lblUser; - } - - public void setLblUser(StaticText st) { - this.lblUser = st; - } - /** - *

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.

- */ - @Override - 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 . . . - } - } - else - { - - 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(); - //if(getSessionBean1().getImageName() != null) - //{ - fillImages(); - //} - } - else - { - String tmpImageFolder = Global.IMAGE_FOLDER + "/tmp" + getSessionBean1().getCurrentUser().getLogin(); - File tmpFolder = new File(tmpImageFolder); - if(tmpFolder.exists()) - { - Global global = new Global(); - global.deleteFolderFiles(tmpFolder); - tmpFolder.delete(); - } - - lblUser.setText( getSessionBean1().getCurrentUser().getLogin() ); - getSessionBean1().setGravado(false); - getSessionBean1().setSubmetido(false); - getSessionBean1().setIeBug(false); - //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.

- */ - @Override - 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.

- */ - @Override - 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).

- */ - @Override - 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() - { - getSessionBean1().setIeBug( true ); - Utils.doLogout( getExternalContext(), true ); - - return null; - } - - - private void initializePage() - { - hidAnchor.setValue("none"); - butCorrecao.setRendered(false); - butGravar.setText("Gravar"); - butEnviar.setText("Enviar a RH"); - gridSiprp.setRendered(false); - //gridAcidentadoView.setRendered(false); - 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); - gridVerificacao.setRendered(false); - gridVerificacaoView.setRendered(false); - gridImpressao.setRendered(false); - gridImpressaoView.setRendered(false); - - tblTrabalhadores.setRendered(false); - gridAcidentado.setRendered(false); - gridDadosAcidenteSeg.setRendered(false); - gridDadosAcidenteSegView.setRendered(false); - - butImprimir.setRendered(false); - -// AnalisesDataProvider adp = new AnalisesDataProvider(); - try - { - AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); - String nome_empresa = adp.getEmpresaNome(getSessionBean1().getCurrentUser().getEmpresa_id()); - txtEmpresa.setText(utils.Utils.unicodeToHTML(nome_empresa)); - } - catch(Exception ex) - { - ErrorLogger.logException( ex ); - } - try - { - AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); - txtEstabelecimento.setText(adp.getEstabelecimentoNome(getSessionBean1().getCurrentUser().getEstabelecimento_id())); - } - catch(Exception ex) - { - ErrorLogger.logException( ex ); - } - - - drpDepartamento.setSelected(new Integer(0)); - try - { - AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); - getSessionBean1().setSeccaoOptions(adp.getSeccoesList(null)); - drpSeccao.setSelected(new Integer(0)); - } - catch(Exception ex) - { - ErrorLogger.logException( ex ); - } - - -// fillTrabalhadoresTable(); - -// Calendar c = Calendar.getInstance(); -// SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd"); -// stDataAcidente.setText(dateFormat.format(c.getTime())); - txtAveriguador.setText( getSessionBean1().getCurrentUser().getNome() ); - java.util.Date today = - new java.util.Date(); - calDataOcorrencia.setValue(today); - - //drpMedicos.setSelected(new Integer(0)); -// UtilizadoresDataProvider udp = new UtilizadoresDataProvider(); - try - { - UtilizadoresDataProvider udp = UtilizadoresDataProvider.getInstance(); - Medico m = udp.getMedico( getSessionBean1().getCurrentUser().getEstabelecimento_id() ); - getSessionBean1().setMedico( m ); - if(m != null) - { - stMedico.setText(m.getNome() + "  "); - txtCedula.setText(m.getNumero_cedula()); - } - } - catch ( Exception e ) - { - ErrorLogger.logException( e ); - } - drpHours.setSelected(new Integer(-1)); - drpMinutes.setSelected(new Integer(-1)); - drpDepartamento.setSelected(new Integer(0)); - drpSeccao.setSelected(new Integer(0)); - drpCausas.setSelected(new Integer(0)); - } - -// 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); -// ErrorLogger.logException( ex ); -// } -// } - - private String fillPage() - { - AnaliseAcidente a = getSessionBean1().getCurrentAnalise(); - - //correcao - if(a.getCorrecao().matches("y")) - { - stObservacoesCorr.setText(a.getObservacoes_correcao()); - } - else - { - stObservacoesCorr.setRendered(false); - } - - - 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) - { - ErrorLogger.logException( ex ); - } -// AnalisesDataProvider adp = new AnalisesDataProvider(); - try - { - AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); - String nome_empresa = adp.getEmpresaNome(a.getEmpresa_id()); - txtEmpresa.setText(utils.Utils.unicodeToHTML(nome_empresa)); - } - catch(Exception ex) - { - ErrorLogger.logException( ex ); - } - try - { - AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); - txtEstabelecimento.setText(adp.getEstabelecimentoNome(a.getEstabelecimento_id())); - } - catch(Exception ex) - { - ErrorLogger.logException( ex ); - } - - Acidentado ac = null; - try - { - AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); - - //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) - { - ErrorLogger.logException( ex ); - } - - - int estado_documento = a.getEstado().intValue(); -// if(estado_documento != Global.ESTADO_IMPRESSAO) -//// if(estado_documento != Global.ESTADO_ASSINATURAS || (estado_documento == Global.ESTADO_ASSINATURAS && getSessionBean1().getCurrentUser().getTipo().intValue() != Global.TIPO_UTILIZADOR_RH)) -//// { -//// butImprimir.setRendered(false); -//// } -//// else -//// { -//// butGravar.setRendered(false); -//// } - butImprimir.setRendered(false); - - if(estado_documento > Global.ESTADO_SEG && getSessionBean1().getCurrentUser().getTipo().intValue() == 1 && a.getAveriguacao_posterior().matches("y")) - { - boolean booAveriguacao = false; - if(a.getAveriguacao_obs() == null) - { - booAveriguacao = true; - } - else if(a.getAveriguacao_obs().trim().length() == 0) - { - booAveriguacao = true; - } - if(booAveriguacao) - { - butCorrecao.setRendered(false); - butGravar.setText("Gravar"); - butEnviar.setRendered(false); - gridSiprp.setRendered(false); - //gridSiprpView.setRendered(false); - gridAcidentado.setRendered(false); //19/11/2007 - gridAcidentadoView.setRendered(false); //19/11/2007 - gridDadosAcidenteSeg.setRendered(false); //19/11/2007 - //gridDadosAcidenteSegView.setRendered(false); //19/11/2007 - gridDadosAcidenteRh.setRendered(false); - gridDadosAcidenteRhView.setRendered(false); - gridRecomendacoesHS.setRendered(false); - gridRecomendacoesViewHS.setRendered(false); - gridMedidasRH.setRendered(false); - gridMedidasViewRH.setRendered(false); - gridMedico.setRendered(false); - gridMedicoView.setRendered(false); - gridVerificacao.setRendered(false); - gridVerificacaoView.setRendered(false); - gridImpressao.setRendered(false); - gridImpressaoView.setRendered(false); - - // fillSiprp(a); - // fillDadosAcidenteSegView(a); - fillSiprpView(a); - if(ac != null) - { - fillAcidentadoView(ac); - } - fillDadosAcidenteSegView(a); - - return null; - } - - } - - - switch(estado_documento) - { - case Global.ESTADO_SEG: - butCorrecao.setRendered(false); - butGravar.setText("Gravar"); - if(a.getCorrecao().matches("y")) - { - butEnviar.setText("Enviar a Recomendações SHST"); - } - else - { - butEnviar.setText("Enviar a Acompanhamento RH"); - } - gridSiprpView.setRendered(false); - gridAcidentado.setRendered(false); //19/11/2007 - //gridAcidentadoView.setRendered(false); //19/11/2007 - gridDadosAcidenteSegView.setRendered(false); //19/11/2007 - gridDadosAcidenteRh.setRendered(false); - gridDadosAcidenteRhView.setRendered(false); - gridRecomendacoesHS.setRendered(false); - gridRecomendacoesViewHS.setRendered(false); - gridMedidasRH.setRendered(false); - gridMedidasViewRH.setRendered(false); - gridMedico.setRendered(false); - gridMedicoView.setRendered(false); - gridVerificacao.setRendered(false); - gridVerificacaoView.setRendered(false); - gridImpressao.setRendered(false); - gridImpressaoView.setRendered(false); - - fillSiprp(a); - fillAcidentadoView(ac); - fillDadosAcidenteSeg(a); - break; - case Global.ESTADO_RH1: - butCorrecao.setRendered(false); - butGravar.setText("Gravar"); - butEnviar.setText("Enviar a Recomendações SHST"); - gridSiprpView.setRendered(false); - gridAcidentadoView.setRendered(false); - gridDadosAcidenteSeg.setRendered(false); //19/11/2007 - gridDadosAcidenteRhView.setRendered(false); - gridRecomendacoesHS.setRendered(false); - gridRecomendacoesViewHS.setRendered(false); - gridMedidasRH.setRendered(false); - gridMedidasViewRH.setRendered(false); - gridMedico.setRendered(false); - gridMedicoView.setRendered(false); - gridVerificacao.setRendered(false); - gridVerificacaoView.setRendered(false); - gridImpressao.setRendered(false); - gridImpressaoView.setRendered(false); - - if(ac != null) - { - fillAcidentado(ac); - } - fillSiprp(a); - fillDadosAcidenteSegView(a); - fillDadosAcidenteRh(a); - break; - case Global.ESTADO_HS: - butGravar.setText("Gravar"); - butEnviar.setText("Enviar a Medidas 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); - gridVerificacao.setRendered(false); - gridVerificacaoView.setRendered(false); - gridImpressao.setRendered(false); - gridImpressaoView.setRendered(false); - - fillSiprpView(a); - if(ac != null) - { - fillAcidentadoView(ac); - } - fillDadosAcidenteSegView(a); - fillDadosAcidenteRhView(a); - fillRecomendacoesHs(a); - //gridDadosAcidenteRhView.setRendered(false); - //gridRecomendacoesHS.setRendered(false); - break; - case Global.ESTADO_RH2: - butCorrecao.setRendered(false); - butGravar.setText("Gravar"); - //butEnviar.setText("Enviar a Médico"); -// if(a.getCorrecao().matches("y")) -// { -// butEnviar.setText("Enviar a Consolidação"); -// } -// else -// { -// butEnviar.setText("Enviar a Medicina"); -// } - butEnviar.setText("Enviar a Consolidação"); - - //butEnviar.setText("Enviar a Medicina"); - //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); - gridVerificacao.setRendered(false); - gridVerificacaoView.setRendered(false); - gridImpressao.setRendered(false); - gridImpressaoView.setRendered(false); - - fillSiprpView(a); - if(ac != null) - { - fillAcidentadoView(ac); - } - fillDadosAcidenteSegView(a); - fillDadosAcidenteRhView(a); - fillRecomendacoesViewHs(a); - //fillMedico(a); //19/11/2007 - fillMedidasRh(a); - fillMedico(a); //23/11/2007 - break; -// case Global.ESTADO_MEDICINA: -// butCorrecao.setRendered(false); -// butGravar.setText("Gravar"); -// butEnviar.setText("Enviar a Consolidação"); -// //gridSiprpView.setRendered(false); -// gridSiprp.setRendered(false); -// gridAcidentado.setRendered(false); -// //gridAcidentadoView.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); -// gridVerificacao.setRendered(false); -// gridVerificacaoView.setRendered(false); -// gridImpressao.setRendered(false); -// gridImpressaoView.setRendered(false); -// -// fillSiprpView(a); -// if(ac != null) -// { -// fillAcidentadoView(ac); -// } -// fillDadosAcidenteSegView(a); -// fillDadosAcidenteRhView(a); -// fillRecomendacoesViewHs(a); -// fillMedidasViewRh(a); -// fillMedico(a); //23/11/2007 -// break; - case Global.ESTADO_CONSOLIDACAO: - //butGravar.setText("Gravar"); - butGravar.setRendered(false); - butEnviar.setText("Enviar a Verificação"); - hidDisableEnviar.setValue("n"); -// boolean booAveriguacao = false; -// if(a.getAveriguacao_posterior().matches("y")) -// { -// if(a.getAveriguacao_obs() == null) -// { -// booAveriguacao = true; -// } -// else if(a.getAveriguacao_obs().trim().length() == 0) -// { -// booAveriguacao = true; -// } -// if(booAveriguacao) -// { -// hidDisableEnviar.setValue("y"); -// } -// -// } - gridSiprp.setRendered(false); - gridAcidentado.setRendered(false); - //gridAcidentadoView.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); - //gridVerificacao.setRendered(false); - java.util.Date ddate = new java.util.Date(); - stVerHs.setText("Tomei conhecimento a " + utils.Utils.dateToYYYYMMDD(ddate)); - grpVerRespSeg.setRendered(false); - grpVerRespRh.setRendered(false); - butGravar.setDisabled(true); - butEnviar.setDisabled(true); - gridVerificacaoView.setRendered(false); - gridImpressao.setRendered(false); - gridImpressaoView.setRendered(false); - - fillSiprpView(a); - if(ac != null) - { - fillAcidentadoView(ac); - } - fillDadosAcidenteSegView(a); - fillDadosAcidenteRhView(a); - fillRecomendacoesViewHs(a); - fillMedidasViewRh(a); - fillMedicoView(a); //23/11/2007 - break; - case Global.ESTADO_ASSINATURA_SEG: - butImprimir.setRendered(false); - butCorrecao.setRendered(false); - butEnviar.setText("Enviar a RH"); - //butGravar.setText("Enviar"); - butGravar.setRendered(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); - //gridVerificacaoView.setRendered(false); - gridImpressao.setRendered(false); - gridImpressaoView.setRendered(false); - grpVerRespSeg.setRendered(true); - grpVerHs.setRendered(false); - grpVerRespRh.setRendered(false); - //chkVerRespRh.setDisabled(true); - ddate = new java.util.Date(); - stVerRespSeg.setText("Tomei conhecimento a " + utils.Utils.dateToYYYYMMDD(ddate)); - - fillSiprpView(a); - if(ac != null) - { - fillAcidentadoView(ac); - } - fillDadosAcidenteSegView(a); - fillDadosAcidenteRhView(a); - fillMedidasViewRh(a); - fillMedicoView(a); - fillVerificacaoView(a); - fillVerificacao(a); - - break; - case Global.ESTADO_ASSINATURA_RH: - butGravar.setRendered(false); - //butGravar.setText("Imprimir"); - butCorrecao.setRendered(false); - butImprimir.setRendered(false); - butEnviar.setText("Enviar a Conclusão"); - gridSiprp.setRendered(false); - gridAcidentado.setRendered(false); - gridDadosAcidenteSeg.setRendered(false); - gridDadosAcidenteRh.setRendered(false); - gridRecomendacoesHS.setRendered(false); - gridMedidasRH.setRendered(false); - gridMedico.setRendered(false); - //gridMedicoView.setRendered(false); - //gridVerificacaoView.setRendered(false); - gridImpressao.setRendered(false); - gridImpressaoView.setRendered(false); - grpVerRespRh.setRendered(true); - grpVerHs.setRendered(false); - grpVerRespSeg.setRendered(false); - //chkVerRespSeg.setDisabled(true); - ddate = new java.util.Date(); - stVerRespRh.setText("Tomei conhecimento a " + utils.Utils.dateToYYYYMMDD(ddate)); - - fillSiprpView(a); - if(ac != null) - { - fillAcidentadoView(ac); - } - fillDadosAcidenteSegView(a); - fillDadosAcidenteRhView(a); - fillRecomendacoesViewHs(a); - fillMedidasViewRh(a); - fillMedicoView(a); - fillVerificacaoView(a); - fillVerificacao(a); - break; - - case Global.ESTADO_FECHAR: - butCorrecao.setRendered(false); - butGravar.setRendered(false); - butGravar.setText("Gravar"); - butEnviar.setText("Fechar"); - gridSiprp.setRendered(false); - gridAcidentado.setRendered(false); - gridDadosAcidenteSeg.setRendered(false); - gridDadosAcidenteRh.setRendered(false); - gridRecomendacoesHS.setRendered(false); - gridMedidasRH.setRendered(false); - gridMedico.setRendered(false); - gridVerificacao.setRendered(false); - gridImpressao.setRendered(false); - gridImpressaoView.setRendered(false); - fillSiprpView(a); - if(ac != null) - { - fillAcidentadoView(ac); - } - fillDadosAcidenteSegView(a); - fillDadosAcidenteRhView(a); - fillRecomendacoesViewHs(a); - fillMedidasViewRh(a); - //fillMedico(a); - fillMedicoView(a); - fillVerificacaoView(a); - //fillImpressaoView(a); - break; - case Global.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 - { - UtilizadoresDataProvider udp = UtilizadoresDataProvider.getInstance(); - Utilizador u = udp.getUtilizador(a.getTecnico_saude_id()); - txtCap.setText(u.getCap()); - } - catch(Exception ex) - { - ErrorLogger.logException( ex ); - } - try - { - UtilizadoresDataProvider udp = UtilizadoresDataProvider.getInstance(); - Utilizador u = udp.getUtilizador( a.getMedico_id() ); - stMedico.setText(u.getNome() + "  "); - txtCedula.setText( u.getNumero_cedula() ); - } - catch ( Exception ex ) - { - ErrorLogger.logException( ex ); - } - } - - private void fillSiprpView(AnaliseAcidente a) - { - if(a.getEstado().intValue() == Global.ESTADO_HS) - { - if(a.getTecnico_saude_id().equals(new Integer(0))) - { - a.setTecnico_saude_id( getSessionBean1().getCurrentUser().getId()); - } - } - - try - { - UtilizadoresDataProvider udp = UtilizadoresDataProvider.getInstance(); - - Utilizador u = udp.getUtilizador(a.getTecnico_saude_id()); - stTecnicoNome.setText(Utils.unicodeToHTML(u.getNome())); - txtCap1.setText(u.getCap()); - } - catch(Exception ex) - { - ErrorLogger.logException( ex ); - } - try - { - UtilizadoresDataProvider udp = UtilizadoresDataProvider.getInstance(); - - Utilizador u = udp.getUtilizador(a.getMedico_id()); - stMedicoNome.setText(Utils.unicodeToHTML(u.getNome())); - txtCedula1.setText(u.getNumero_cedula()); - } - catch(Exception ex) - { - ErrorLogger.logException( ex ); - } - } - - private void fillAcidentado(Acidentado a) - { - txtNomeAcidentado.setText(a.getNome()); - stEstabelecimentoOrigem.setText(a.getEstabelecimento_origem()); - //txtDataNascimento.setText(a.getData_nascimento()); - try - { - java.util.Date ddate = new java.util.Date(a.getData_nascimento().getTime()); - txtDataNascimento.setText(utils.Utils.dateToYYYYMMDD(ddate)); - } - catch(Exception ex) - { - - } - 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) - { -// ErrorLogger.logException( ex ); - } - try - { - cod_postal2 = a.getCod_postal().substring(5, 8); - } - catch(Exception ex) - { -// ErrorLogger.logException( ex ); - } - - - txtCodPostal1.setText(cod_postal1); - txtCodPostal2.setText(cod_postal2); - txtLocalidade.setText(a.getLocalidade()); - txtContactoTelefonico.setText(a.getContacto_telefonico()); - try - { - java.util.Date ddate = new java.util.Date(a.getData_admissao().getTime()); - stDataAdmissao.setText(utils.Utils.dateToYYYYMMDD(ddate)); - } - catch(Exception ex) - { -// ErrorLogger.logException( ex ); - } - - stFuncao.setText(a.getFuncao()); - rbTurnoManha.setSelected(null); - rbTurnoTarde.setSelected(null); - rbTurnoNoite.setSelected(null); - 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)); - } - - txtNomeSuperior.setText(a.getNome_superior_hierarquico()); - txtEmailSuperior.setText(a.getEmail_superior_hierarquico()); - - } - - private void fillAcidentadoView(Acidentado a) - { - stNomeAcidentado.setText(a.getNome()); - stEstabelecimentoOrigem1.setText(a.getEstabelecimento_origem()); - //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) - { -// ErrorLogger.logException( 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) - { - cod_postal1 = ""; - } - try - { - cod_postal2 = a.getCod_postal().substring(5, 8); - } - catch(Exception ex) - { - cod_postal2 = ""; - } - - //String cod_postal1 = a.getCod_postal().substring(0, 4); - //String cod_postal2 = a.getCod_postal().substring(5, 8); - if(a.getLocalidade() == null) - { - a.setLocalidade(""); - } - 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) - { -// ErrorLogger.logException( ex ); - } - - stFuncao1.setText(a.getFuncao()); - String turno_str = ""; - if(a.getTurno() != null) - { - 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); - stNomeSuperior.setText(a.getNome_superior_hierarquico()); - stEmailSuperior.setText(a.getEmail_superior_hierarquico()); - } - - private void fillDadosAcidenteSeg(AnaliseAcidente a) - { - //stDataAcidente.setText(a.getData_acidente()); -// try -// { -// java.util.Date ddate = new java.util.Date(a.getData_acidente().getTime()); -// stDataAcidente.setText(utils.Utils.dateToYYYYMMDD(ddate)); -// } -// catch(Exception ex){}; - if(a.getAveriguador() == null) - { - txtAveriguador.setText(getSessionBean1().getCurrentUser().getNome()); - } - else - { - txtAveriguador.setText(a.getAveriguador()); - } - - if(a.getData_acidente() != null) - { - java.util.Date ddate = new java.util.Date(a.getData_acidente().getTime()); - calDataOcorrencia.setValue( ddate ); - } - - Calendar cal = Calendar.getInstance(); - - // set the calendar to have your time - try - { - cal.setTimeInMillis(a.getHora_acidente().getTime()); - - int hour = cal.get(Calendar.HOUR_OF_DAY); - int minutes = cal.get(Calendar.MINUTE); - drpHours.setSelected(new Integer(hour)); - drpMinutes.setSelected(new Integer(minutes)); - } - catch(Exception ex) - { -// ErrorLogger.logException( ex ); - } - - if(a.getHoras_turno() != null) - { - txtHorasTurno.setText(a.getHoras_turno().toString()); - } - - ////txtSeccao.setText(a.getSeccao()); - -// AnalisesDataProvider adp = new AnalisesDataProvider(); - drpDepartamento.setSelected(a.getDepartamento_id()); - try - { - AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); - if(a.getDepartamento_id().intValue() == 0) - { - getSessionBean1().setSeccaoOptions(adp.getSeccoesList(null)); - drpSeccao.setSelected(new Integer(0)); - } - else - { - getSessionBean1().setSeccaoOptions(adp.getSeccoesList(a.getDepartamento_id())); - drpSeccao.setSelected(a.getSeccao_id()); - } - } - catch(Exception ex) - { -// ErrorLogger.logException( ex ); - } - - 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()); - - drpCausas.setSelected(a.getCausas()); - txtDescricao.setText(a.getDescricao()); - txtConclusoes.setText(a.getConclusoes()); - txtAccoes.setText(a.getAccoes()); - - if(a.getAveriguacao_posterior().matches("y")) - { - chkAveriguacaoPosterior.setSelected(new Boolean(true)); - } - - txtAveriguacaoObs.setText(a.getAveriguacao_obs()); - - //fill images - if(gridImages.getChildren().size() > 0) - { - gridImages.getChildren().clear(); - } - String folderName = getSessionBean1().getCurrentAnalise().getAnalise_nr().substring(0,2) + getSessionBean1().getCurrentAnalise().getAnalise_nr().substring(3); - ServletContext theApplicationsServletContext = - (ServletContext) this.getExternalContext().getContext(); - - File apacheAnaliseFolder = new File(theApplicationsServletContext.getRealPath( Global.RESOURCES_IMAGE_FOLDER ) + "/analises/" + folderName); - if(apacheAnaliseFolder.exists()) - { - Global global = new Global(); - global.deleteFolderFiles(apacheAnaliseFolder); - } - else - { - apacheAnaliseFolder.mkdir(); - } - - -// String imageFileFolder = theApplicationsServletContext.getRealPath(Global.IMAGE_FOLDER + "/" + folderName); - String imageFileFolder = Global.IMAGE_FOLDER + "/" + folderName; - try - { - File f = new File(imageFileFolder); - - if(f.exists()) - { - File images[] = f.listFiles(); - Arrays.sort(images); - for(int i=0;i 0) - { - gridImages.getChildren().clear(); - } - String folderName = a.getAnalise_nr().substring(0,2) + a.getAnalise_nr().substring(3); - ServletContext theApplicationsServletContext = - (ServletContext) this.getExternalContext().getContext(); -// String imageFileFolder = theApplicationsServletContext.getRealPath(Global.IMAGE_FOLDER + "/" + folderName); - - File apacheAnaliseFolder = new File(theApplicationsServletContext.getRealPath( Global.RESOURCES_IMAGE_FOLDER ) + "/analises/" + folderName); - if(apacheAnaliseFolder.exists()) - { - Global global = new Global(); - global.deleteFolderFiles(apacheAnaliseFolder); - System.out.println("FILES DELETED"); - } - else - { - apacheAnaliseFolder.mkdir(); - } - - - String imageFileFolder = Global.IMAGE_FOLDER + "/" + folderName; - try - { - File f = new File(imageFileFolder); - - if(f.exists()) - { - File images[] = f.listFiles(); - Arrays.sort(images); - 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 if( a.getOutros_acidentes_com_colaborador().matches("n") ) - { - st1.setText("Não se verificaram outras ocorrências/incidências no mesmo posto de trabalho com o colaborador acidentado."); - gridColaborador.getChildren().add(st1); - } - else //t - { - gridColaborador.setRendered(false); - } - - 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 if( a.getAcidentes_outros_colaboradores().matches("n") ) - { - st2.setText("Não se verificaram ocorrências/incidentes com outros colaboradores."); - gridColaboradores.getChildren().add(st2); - } - else //t - { - gridColaboradores.setRendered(false); - } - } - - private void fillRecomendacoesHs(AnaliseAcidente a) - { -// AnalisesDataProvider adp = new AnalisesDataProvider(); - try - { - AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); - 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) - { - ErrorLogger.logException( ex ); - } - } - - private void fillRecomendacoesViewHs(AnaliseAcidente a) - { -// AnalisesDataProvider adp = new AnalisesDataProvider(); - try - { - AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); - - 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) - { - ErrorLogger.logException( ex ); - } - } - - private void fillMedidasRh(AnaliseAcidente a) - { -// AnalisesDataProvider adp = new AnalisesDataProvider(); - try - { - AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); - - 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) - { - ErrorLogger.logException( ex ); - } - } - - private void fillMedidasViewRh(AnaliseAcidente a) - { - try - { - AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); - - 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) - { - ErrorLogger.logException( ex ); - } - } - - 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); - lblEspecif1.setVisible(true); - txtEspecif1.setVisible(true); - - txtEspecif1.setText(a.getEspecif1()); - } - else - { - //lblEspecif1.setRendered(false); - //txtEspecif1.setRendered(false); - lblEspecif1.setVisible(false); - txtEspecif1.setVisible(false); - - } - - if(a.getLesao_membro_sup_esq().matches("y")) - { - chkMembroSupEsq.setSelected(new Boolean(true)); -// lblEspecif2.setRendered(true); -// txtEspecif2.setRendered(true); - lblEspecif2.setVisible(true); - txtEspecif2.setVisible(true); - txtEspecif2.setText(a.getEspecif2()); - } - else - { - lblEspecif2.setVisible(false); - txtEspecif2.setVisible(false); - } - - if(a.getLesao_membro_inf_dir().matches("y")) - { - chkMembroInfDir.setSelected(new Boolean(true)); - lblEspecif3.setVisible(true); - txtEspecif3.setVisible(true); - txtEspecif3.setText(a.getEspecif3()); - } - else - { - lblEspecif3.setVisible(false); - txtEspecif3.setVisible(false); - } - - if(a.getLesao_membro_inf_esq().matches("y")) - { - chkMembroInfEsq.setSelected(new Boolean(true)); - lblEspecif4.setVisible(true); - txtEspecif4.setVisible(true); - txtEspecif4.setText(a.getEspecif4()); - } - else - { - lblEspecif4.setVisible(false); - txtEspecif4.setVisible(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)); - } - else - { - rbIncapacidadeNone.setSelected(null); - rbIncapacidadeTemp.setSelected(null); - rbIncapacidadePerm.setSelected(null); - } - - if(a.getCoef_incapacidade() == null) - { - txtCoefIncapacidade.setText(""); - } - else - { - 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); - if(a.getEspecif1() != null) - { - if(a.getEspecif1().trim().length() > 0) - { - 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); - if(a.getEspecif2() != null) - { - if(a.getEspecif2().trim().length() > 0) - { - 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); - if(a.getEspecif3() != null) - { - if(a.getEspecif3().trim().length() > 0) - { - 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); - if(a.getEspecif4() != null) - { - if(a.getEspecif4().trim().length() > 0) - { - 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.setStyle("font-weight: bold"); - 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.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) - { - gridIncapacidade2.getChildren().add(pg); - } - - pg = new PanelGroup(); - if(a.getData_aval_incapacidade() != null) - { - - 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) - { -// ErrorLogger.logException( ex ); - } - pg.getChildren().add(st); - } - - - if(a.getData_rev_incapacidade() != null) - { - 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) - { -// ErrorLogger.logException( ex ); - } - pg.getChildren().add(st); - } - - - if(pg.getChildren().size() > 0) - { - gridIncapacidade2.getChildren().add(pg); - } - - - pg = new PanelGroup(); - - if(a.getPeriodo_incapacidade_de() != null || a.getPeriodo_incapacidade_a() != null) - { - - 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) - { -// ErrorLogger.logException( 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) - { -// ErrorLogger.logException( ex ); - } - pg.getChildren().add(st); - - } - - if(pg.getChildren().size() > 0) - { - gridIncapacidade2.getChildren().add(pg); - } - - - //RESTRICOES - // if(a.getImg_flexao().matches("y")) // { // grd = new HtmlPanelGrid(); @@ -9866,1837 +10539,1836 @@ public class AnaliseAcidenteTrabalho extends AbstractPageBean { // // 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); +// 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; +// } + private void fillVerificacao( AnaliseAcidente a ) + { + int estado = a.getEstado().intValue(); + switch ( estado ) + { + case Global.ESTADO_ASSINATURA_SEG: + if ( a.getAss_resp_seg().matches( "y" ) ) + { + chkVerRespSeg.setSelected( new Boolean( true ) ); + chkVerRespSeg.setDisabled( true ); + java.util.Date ddate = new java.util.Date( a.getData_assinatura_seg().getTime() ); + stVerRespSeg.setText( "Tomei conhecimento a " + utils.Utils.dateToYYYYMMDD( ddate ) ); + } + break; + + case Global.ESTADO_ASSINATURA_RH: + if ( a.getAss_resp_rh().matches( "y" ) ) + { + chkVerRespRh.setSelected( new Boolean( true ) ); + chkVerRespRh.setDisabled( true ); + java.util.Date ddate = new java.util.Date( a.getData_assinatura_rh().getTime() ); + stVerRespRh.setText( "Tomei conhecimento a " + utils.Utils.dateToYYYYMMDD( ddate ) ); + } + + break; + } + } + + private void fillVerificacaoView( AnaliseAcidente a ) + { + StaticText st = null; + String txtVer = null; + if ( a.getAveriguador() != null ) + { + if ( a.getAveriguador().trim().length() > 0 ) + { + st = new StaticText(); + st.setId( "stVerificacao1" ); + st.setEscape( false ); + txtVer = "Averiguado por " + a.getAveriguador() + " (Departamento de Segurança) a "; + //txtVer += a.getData_assinatura_seg(); + + try + { + java.util.Date ddate = new java.util.Date( a.getData_inicio_processo().getTime() ); + txtVer += utils.Utils.dateToYYYYMMDD( ddate ) + "."; + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + st.setText( txtVer ); + gridAssinaturasView.getChildren().add( st ); + } + } + + if ( a.getAss_consolidacao().matches( "y" ) ) + { + st = new StaticText(); + st.setId( "stVerificacao2" ); + st.setEscape( false ); + txtVer = "Verificado por " + a.getNome_resp_consolidacao() + " (Técnico de SHST) a "; + //txtVer += a.getData_assinatura_rh(); + try + { + java.util.Date ddate = new java.util.Date( a.getData_consolidacao().getTime() ); + txtVer += utils.Utils.dateToYYYYMMDD( ddate ) + "."; + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + st.setText( txtVer ); + gridAssinaturasView.getChildren().add( st ); + } + + if ( a.getAss_resp_seg().matches( "y" ) ) + { + st = new StaticText(); + st.setId( "stVerificacao3" ); + st.setEscape( false ); + txtVer = "Verificado por " + a.getNome_resp_seg() + " (Responsável de Segurança) a "; + //txtVer += a.getData_assinatura_rh(); + try + { + java.util.Date ddate = new java.util.Date( a.getData_assinatura_seg().getTime() ); + txtVer += utils.Utils.dateToYYYYMMDD( ddate ) + "."; + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + st.setText( txtVer ); + gridAssinaturasView.getChildren().add( st ); + } + + if ( a.getAss_resp_rh().matches( "y" ) ) + { + st = new StaticText(); + st.setId( "stVerificacao4" ); + st.setEscape( false ); + txtVer = "Verificado por " + a.getNome_resp_rh() + " (Responsável de RH) a "; + //txtVer += a.getData_assinatura_rh(); + try + { + java.util.Date ddate = new java.util.Date( a.getData_assinatura_rh().getTime() ); + txtVer += utils.Utils.dateToYYYYMMDD( ddate ) + "."; + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + st.setText( txtVer ); + gridAssinaturasView.getChildren().add( st ); + } + +// AnalisesDataProvider adp = new AnalisesDataProvider(); + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + + Acidentado ac = adp.getAcidentado( a.getAcidentado_id() ); + if ( ac.getNome_superior_hierarquico() != null ) + { + if ( ac.getNome_superior_hierarquico().trim().length() > 0 ) + { + st = new StaticText(); + st.setId( "stVerificacao5" ); + st.setEscape( false ); + txtVer = "Com conhecimento de " + ac.getNome_superior_hierarquico() + " (Responsável hierárquico)"; + + if ( ac.getEmail_superior_hierarquico() != null ) + { + if ( ac.getEmail_superior_hierarquico().trim().length() > 0 ) + { + try + { + java.util.Date ddate = new java.util.Date( ac.getData_email_superior_hierarquico().getTime() ); + txtVer += " a " + utils.Utils.dateToYYYYMMDD( ddate ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + } + } + txtVer += "."; + st.setText( txtVer ); + gridAssinaturasView.getChildren().add( st ); + } + } + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + + HtmlPanelGrid grid = new HtmlPanelGrid(); + grid.setId( "rodape1" ); + grid.setColumns( 1 ); + grid.setStyle( "width: 100%" ); + grid.setColumnClasses( "gridColCenter" ); + st = new StaticText(); + st.setId( "stRodape1" ); + st.setEscape( false ); + st.setText( "- processamento informático - acesso autenticado -" ); + grid.getChildren().add( st ); + gridAssinaturasView.getChildren().add( grid ); + } + + private AnaliseAcidente fillAnaliseFieldsImpressao( AnaliseAcidente a ) + { + a.setAss_superior( "n" ); + if ( chkAssSup.getSelected() != null ) + { + if ( chkAssSup.getSelected().equals( new Boolean( true ) ) ) + { + a.setAss_superior( "y" ); + } + } + + if ( a.getAss_superior().matches( "y" ) ) + { + a.setNome_superior( "" ); + if ( txtAssSup.getText() != null ) + { + a.setNome_superior( ( String ) txtAssSup.getText() ); + } + java.util.Date today = + new java.util.Date(); + java.sql.Date sqlToday = + new java.sql.Date( today.getTime() ); + a.setData_assinatura_superior( sqlToday ); + } + else + { + a.setNome_superior( "" ); + a.setData_assinatura_superior( null ); + } + return a; + } + + private void fillImpressao( AnaliseAcidente a ) + { + if ( a.getAss_superior().matches( "y" ) ) + { + chkAssSup.setSelected( new Boolean( true ) ); + txtAssSup.setText( a.getNome_superior() ); + String txt = ( String ) stAssSup2.getText(); + String nome_acidentado = getSessionBean1().getAcidentado().getNome(); + String stData = ""; + try + { + java.util.Date ddate = new java.util.Date( a.getData_assinatura_superior().getTime() ); + stData += utils.Utils.dateToYYYYMMDD( ddate ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + stAssSup2.setText( txt + nome_acidentado + ", a " + stData ); + } + + } + + private void fillImpressaoView( AnaliseAcidente a ) + { + StaticText st = new StaticText(); + st.setId( "stImpressaoView1" ); + st.setEscape( false ); + String stData = ""; + try + { + java.util.Date ddate = new java.util.Date( a.getData_assinatura_superior().getTime() ); + stData += utils.Utils.dateToYYYYMMDD( ddate ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + + String txt = "Assinado na Ficha de Análise de Acidente em papel por " + a.getNome_superior() + ", superior hierárquico / superior de "; + txt += getSessionBean1().getAcidentado().getNome() + ", a " + stData; + gridAssSupView.getChildren().add( st ); + } + + 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. + getSessionBean1().setIeBug( true ); + 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"); // } -// -// if(a.getImg_ma9().matches("y")) +// if(gridImages.getChildren().size() > 0) // { -// 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); +// gridImages.getChildren().clear(); // } -// -// 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) + ServletContext theApplicationsServletContext = + ( ServletContext ) this.getExternalContext().getContext(); + + + File apacheTmpFolder = new File( theApplicationsServletContext.getRealPath( Global.RESOURCES_IMAGE_FOLDER ) + "/tmp" + getSessionBean1().getCurrentUser().getLogin() ); + if ( apacheTmpFolder.exists() ) + { + Global global = new Global(); + global.deleteFolderFiles( apacheTmpFolder ); + } + else + { + apacheTmpFolder.mkdir(); + } + +// String imageFileFolder = theApplicationsServletContext.getRealPath(Global.IMAGE_FOLDER + "/tmp" + getSessionBean1().getCurrentUser().getLogin()); + String imageFileFolder = Global.IMAGE_FOLDER + "/tmp" + getSessionBean1().getCurrentUser().getLogin(); + try + { + File f = new File( imageFileFolder ); + + if ( f.exists() ) + { + File files[] = f.listFiles(); + //List list = Arrays.asList(files); + Arrays.sort( files ); + for ( int i = 0; i < files.length; i++ ) + { + if ( files[i].isFile() ) + { + String imageName = files[i].getName(); + + File apacheImage = new File( theApplicationsServletContext.getRealPath( Global.RESOURCES_IMAGE_FOLDER ) + "/tmp" + getSessionBean1().getCurrentUser().getLogin() + "/" + imageName ); + Global global = new Global(); + global.copyImage( files[i], apacheImage ); + + ImageComponent newImg = new ImageComponent(); + newImg.setId( "img_comp" + imageName ); + //newImg.setUrl(Global.IMAGE_FOLDER + "/tmp" + getSessionBean1().getCurrentUser().getLogin() + "/" + imageName); + newImg.setUrl( Global.RESOURCES_IMAGE_FOLDER + "/tmp" + getSessionBean1().getCurrentUser().getLogin() + "/" + imageName ); + //System.out.println("IMAGE URL : " + newImg.getUrl()); + newImg.setRendered( true ); + gridImages.getChildren().add( newImg ); + + + Hyperlink ln = new Hyperlink(); + ln.setId( "img" + imageName ); + ln.setText( "Apagar" ); + //ln.setValue(imageName); + Class args[] = + { + javax.faces.event.ActionEvent.class + }; + ApplicationFactory factory = ( ApplicationFactory ) FactoryFinder.getFactory( FactoryFinder.APPLICATION_FACTORY ); + //mb = factory.getApplication().createMethodBinding( "#{EditarQuestionario.lnkGrupo_onClick}", args); + MethodBinding mbAction = ( MethodBinding ) factory.getApplication().createMethodBinding( "#{AnaliseAcidenteTrabalho.lnkDelImageTmp_actionListener}", args ); + ln.setActionListener( mbAction ); + gridImages.getChildren().add( ln ); + } + } + } + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + + } + + 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. + getSessionBean1().setIeBug( true ); + ServletContext theApplicationsServletContext = + ( ServletContext ) this.getExternalContext().getContext(); +// String imageFileFolderTmp = theApplicationsServletContext.getRealPath(Global.IMAGE_FOLDER + "/tmp" + getSessionBean1().getCurrentUser().getLogin()); + String imageFileFolderTmp = Global.IMAGE_FOLDER + "/tmp" + getSessionBean1().getCurrentUser().getLogin(); + + File ftmp = new File( imageFileFolderTmp ); + if ( ftmp.exists() ) + { + File files[] = ftmp.listFiles(); + + for ( int i = 0; i < files.length; i++ ) + { + if ( files[i].isFile() ) + { + files[i].delete(); + } + } + + ftmp.delete(); + } + String navFrom = getSessionBean1().getNavFrom(); + if ( navFrom.matches( "FormSeguranca" ) ) + { + return "form_seguranca"; + } + else if ( navFrom.matches( "FormRH" ) ) + { + return "form_rh"; + } + else if ( navFrom.matches( "FormHS" ) ) + { + return "form_hs"; + } + else if ( navFrom.matches( "FormMedico" ) ) + { + return "form_medico"; + } + 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. + + System.out.println( "BUT GRAVAR" ); + + if ( getSessionBean1().getCurrentAnalise() == null ) //new analise + { + //if(validationOk()) + //{ + if ( validationDepartmentSectionOk() ) + { + AnaliseAcidente a = fillAnaliseFields(); + Acidentado ac = fillAcidentadoFields(); + if ( fieldsLenOk() ) + { + try + { + if ( !getSessionBean1().isGravado() ) + { + getSessionBean1().setGravado( true ); + AnaliseAcidente aa = create( a, ac ); + createImagesFolder( aa ); + getSessionBean1().setMsg( "A Ficha de Análise de Acidente nº " + aa.getAnalise_nr() + " foi gravada na sua área de trabalho." ); + } + else + { + getSessionBean1().setMsg( "A Ficha de Análise de Acidente foi gravada na sua área de trabalho." ); + } + String navFrom = getSessionBean1().getNavFrom(); + if ( navFrom.matches( "FormSeguranca" ) ) + { + return "form_seguranca"; + } + + } + catch ( Exception ex ) + { + getSessionBean1().setMsg( "Erro na inserção da análise !" ); + getSessionBean1().setGravado( false ); + ErrorLogger.logException( ex ); + } + } + + } + else + { + getSessionBean1().setGravado( false ); + } + } + else // edit analise + { + if ( fieldsLenOk() ) + { + + AnaliseAcidente a = fillAnaliseFields(); + Acidentado ac = null; + ArrayList recs = null; + ArrayList meds = null; + int estado = a.getEstado().intValue(); + //if(estado == ESTADO_SEG || estado == ESTADO_RH1) + if ( estado == Global.ESTADO_RH1 ) + { + ac = fillAcidentadoFields(); + } + else if ( estado == Global.ESTADO_HS ) + { + a.setTecnico_saude_id( getSessionBean1().getCurrentUser().getId() ); + recs = fillAnaliseRecomendacoesHs( a ); + } + else if ( estado == Global.ESTADO_RH2 ) + { + meds = fillAnaliseMedidasRh( a ); + a.setRh_fase4( getSessionBean1().getCurrentUser().getId() ); + } + try + { + if ( !getSessionBean1().isGravado() ) + { + getSessionBean1().setGravado( true ); + update( a, ac, recs, meds ); + //createImagesFolder(analiseId.toString()); + updateImagesFolder( a ); + getSessionBean1().setMsg( "A Ficha de Análise de Acidente nº " + a.getAnalise_nr() + " foi gravada na sua área de trabalho." ); + } + else + { + getSessionBean1().setMsg( "A Ficha de Análise de Acidente nº " + a.getAnalise_nr() + " foi gravada na sua área de trabalho." ); + } + + if ( estado != Global.ESTADO_ASSINATURA_RH ) + { + String navFrom = getSessionBean1().getNavFrom(); + if ( navFrom.matches( "FormSeguranca" ) ) + { + return "form_seguranca"; + } + else if ( navFrom.matches( "FormRH" ) ) + { + return "form_rh"; + } + else if ( navFrom.matches( "FormHS" ) ) + { + return "form_hs"; + } + else if ( navFrom.matches( "FormMedico" ) ) + { + return "form_medico"; + } + } + else + { + chkVerRespRh.setDisabled( true ); + // IMPRIMIR HERE + } + + + } + catch ( Exception ex ) + { + getSessionBean1().setMsg( "Erro na actualização da análise !" ); + getSessionBean1().setGravado( false ); + ErrorLogger.logException( ex ); + } + } + } + + + return null; + } + + public String butEnviar_action() + { + System.out.println( "BUT ENVIAR 1" ); + + //IE bugs + if ( getSessionBean1().isIeBug() ) + { + return null; + } + if ( getSessionBean1().isGravado() ) + { + getSessionBean1().setSubmetido( true ); + } + + if ( getSessionBean1().getCurrentAnalise() == null ) //new analise + { + if ( validationOk() ) + { + AnaliseAcidente a = fillAnaliseFields(); + Acidentado ac = fillAcidentadoFields(); + //int novo_estado = a.getEstado().intValue(); + a.setEstado( new Integer( Global.ESTADO_RH1 ) ); + try + { + if ( !getSessionBean1().isSubmetido() ) + { + getSessionBean1().setSubmetido( true ); + AnaliseAcidente aa = create( a, ac ); + createImagesFolder( aa ); + String errorMessage = ""; + errorMessage += sendMailToNextUser( a, new Integer( Global.ESTADO_RH1 ) ); + if ( "".equals( errorMessage.trim() ) ) + { + getSessionBean1().setMsg( "A Ficha de Análise de Acidente nº " + aa.getAnalise_nr() + " foi enviada para a fase seguinte." ); + } + else + { + getSessionBean1().setMsg( errorMessage ); + } + } + else + { + getSessionBean1().setMsg( "A Ficha de Análise de Acidente foi enviada para a fase seguinte." ); + } + String navFrom = getSessionBean1().getNavFrom(); + if ( navFrom.matches( "FormSeguranca" ) ) + { + return "form_seguranca"; + } + } + catch ( Exception ex ) + { + getSessionBean1().setMsg( "Erro no envio da análise !" ); + getSessionBean1().setSubmetido( false ); + ErrorLogger.logException( ex ); + } + } + else + { + getSessionBean1().setSubmetido( false ); + } + } + else // edit analise + { + if ( validationOk() ) + { + AnaliseAcidente a = fillAnaliseFields(); + Acidentado ac = null; + ArrayList recs = null; + ArrayList meds = null; + int estado = a.getEstado().intValue(); + //if(estado == ESTADO_SEG || estado == ESTADO_RH1) + if ( estado == Global.ESTADO_RH1 ) + { + ac = fillAcidentadoFields(); + } + else if ( estado == Global.ESTADO_HS ) + { + a.setTecnico_saude_id( getSessionBean1().getCurrentUser().getId() ); + recs = fillAnaliseRecomendacoesHs( a ); + } + else if ( estado == Global.ESTADO_RH2 ) + { + meds = fillAnaliseMedidasRh( a ); + a.setRh_fase4( getSessionBean1().getCurrentUser().getId() ); + } + int novo_estado = a.getEstado().intValue(); + + if ( a.getCorrecao().matches( "y" ) ) + { + a.setCorrecao( "n" ); + a.setEstado( a.getEstado_antes_correcao() ); + novo_estado = a.getEstado_antes_correcao().intValue(); + a.setEstado_antes_correcao( null ); + a.setObservacoes_correcao( "" ); + //sendMailToNextUser(a, new Integer(novo_estado)); + } + else + { + if ( novo_estado < Global.ESTADO_CONCLUIDO ) + { + if ( !getSessionBean1().isSubmetido() ) + { + novo_estado++; + } + + // if(novo_estado == ESTADO_MEDICO) + // { + // novo_estado++; //skip medico + // } +// if(novo_estado == Global.ESTADO_ASSINATURA_SEG || novo_estado == Global.ESTADO_ASSINATURA_RH) +// { +// //a.setEstado_assinatura(new Integer(ESTADO_ASSINATURA_1)); +// notifyNextSignature(new Integer(novo_estado)); +// } + } + a.setEstado( new Integer( novo_estado ) ); + } + + try + { + if ( !getSessionBean1().isSubmetido() ) + { + getSessionBean1().setSubmetido( true ); + update( a, ac, recs, meds ); + //createImagesFolder(analiseId.toString()); + updateImagesFolder( a ); + String errorMessage = ""; + errorMessage += sendMailToNextUser( a, new Integer( novo_estado ) ); + //envia email para responsavel hierarquico ao passar da Consolidacao para a Verificacao + if ( a.getEstado().intValue() == Global.ESTADO_ASSINATURA_SEG ) + { + errorMessage += sendEmailResponsavelHierarquico( a ); + } + else if ( a.getEstado().intValue() == Global.ESTADO_CONCLUIDO ) + { + errorMessage += sendEmailFimProcesso( a ); + errorMessage += sendEmailToRhFase4( a ); + } + + if ( "".equals( errorMessage.trim() ) ) + { + getSessionBean1().setMsg( "A Ficha de Análise de Acidente nº " + a.getAnalise_nr() + " foi enviada para a fase seguinte." ); + } + else + { + getSessionBean1().setMsg( errorMessage ); + } + } + else + { + getSessionBean1().setMsg( "A Ficha de Análise de Acidente nº " + a.getAnalise_nr() + " foi enviada para a fase seguinte." ); + } + String navFrom = getSessionBean1().getNavFrom(); + if ( navFrom.matches( "FormSeguranca" ) ) + { + return "form_seguranca"; + } + else if ( navFrom.matches( "FormRH" ) ) + { + return "form_rh"; + } + else if ( navFrom.matches( "FormHS" ) ) + { + return "form_hs"; + } + else if ( navFrom.matches( "FormMedico" ) ) + { + return "form_medico"; + } + } + catch ( Exception ex ) + { + getSessionBean1().setMsg( "Erro na actualização da análise !" ); + getSessionBean1().setSubmetido( false ); + ErrorLogger.logException( ex ); + } + } + else + { + getSessionBean1().setSubmetido( false ); + } + } + return null; + } + + private AnaliseAcidente create( AnaliseAcidente a, Acidentado ac ) throws Exception + { +// AnalisesDataProvider adp = new AnalisesDataProvider(); + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + + Integer acidentado_id = adp.createAcidentado( ac ); + a.setAcidentado_id( acidentado_id ); + AnaliseAcidente aa = adp.createAnalise( a ); + + + return aa; + } + + private void update( AnaliseAcidente a, Acidentado ac, ArrayList recs, ArrayList meds ) throws Exception + { +// AnalisesDataProvider adp = new AnalisesDataProvider(); + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + + if ( ac != null ) + { + adp.updateAcidentado( ac ); + } + if ( recs != null ) + { + //remove recs form analise + try + { + adp.deleteRecomendacoesByAnalise( a.getId() ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + ListIterator iter = recs.listIterator(); + while ( iter.hasNext() ) + { + Recomendacao r = ( Recomendacao ) iter.next(); + adp.createRecomendacao( r ); + } + } + else if ( meds != null ) + { + //remove meds form analise + try + { + adp.deleteMedidasByAnalise( a.getId() ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + ListIterator iter = meds.listIterator(); + while ( iter.hasNext() ) + { + Medida m = ( Medida ) iter.next(); + adp.createMedida( m ); + } + } + adp.updateAnalise( a ); + } + + private Acidentado fillAcidentadoFields() + { + Acidentado a = getSessionBean1().getAcidentado(); + a.setBilhete_identidade( "" ); + if ( txtBI.getText() != null ) + { + String bi = ( String ) txtBI.getText(); + if ( bi.trim().length() > 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( "v" ); // null + if ( rbTurnoManha.getValue() != null ) + { + if ( rbTurnoManha.getValue().equals( new Boolean( true ) ) ) + { + a.setTurno( "m" ); + } + } + if ( rbTurnoTarde.getValue() != null ) + { + if ( rbTurnoTarde.getValue().equals( new Boolean( true ) ) ) + { + a.setTurno( "t" ); + } + } + if ( rbTurnoNoite.getValue() != null ) + { + if ( rbTurnoNoite.getValue().equals( new Boolean( true ) ) ) + { + a.setTurno( "n" ); + } + } + + if ( txtNomeSuperior.getText() != null ) + { + a.setNome_superior_hierarquico( ( String ) txtNomeSuperior.getText() ); + } + + if ( txtEmailSuperior.getText() != null ) + { + a.setEmail_superior_hierarquico( ( String ) txtEmailSuperior.getText() ); + java.util.Date today = + new java.util.Date(); + java.sql.Date sqlToday = + new java.sql.Date( today.getTime() ); + a.setData_email_superior_hierarquico( sqlToday ); + } + + 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 = Global.ESTADO_SEG; + a.setEstado( new Integer( estado ) ); + } + else + { + a = getSessionBean1().getCurrentAnalise(); + estado = a.getEstado().intValue(); + } + + + //averiguacao posterior +// if(estado < Global.ESTADO_ASSINATURAS) + if ( estado <= Global.ESTADO_ASSINATURA_SEG ) + { + if ( getSessionBean1().getCurrentUser().getTipo().intValue() == 1 ) //seguranca + { + if ( a.getAveriguacao_posterior().matches( "y" ) ) + { + if ( txtAveriguacaoObs1.getText() != null ) + { + a.setAveriguacao_obs( ( String ) txtAveriguacaoObs1.getText() ); + } + } + } + } + + switch ( estado ) + { + case Global.ESTADO_SEG: + a = fillAnaliseFieldsSeg( a ); + break; + case Global.ESTADO_RH1: + //a = fillAnaliseFieldsSeg(a); + a = fillAnaliseFieldsRH1( a ); + break; + case Global.ESTADO_HS: + //a = fillAnaliseFieldsHS(a); + break; + case Global.ESTADO_RH2: + a = fillAnaliseFieldsMedico( a ); + //a = fillAnaliseFieldsRH2(a); + break; +// case Global.ESTADO_MEDICINA: +// a = fillAnaliseFieldsMedico(a); +// break; + case Global.ESTADO_CONSOLIDACAO: + a = fillAnaliseFieldsConsolidacao( a ); + break; +// case Global.ESTADO_ASSINATURAS: + case Global.ESTADO_ASSINATURA_SEG: + a = fillAnaliseAssinaturas( a ); + break; + case Global.ESTADO_ASSINATURA_RH: + a = fillAnaliseAssinaturas( a ); + break; + + } + + return a; + } + + private AnaliseAcidente fillAnaliseFieldsSeg( AnaliseAcidente a ) + { + if ( txtAveriguador.getText() != null ) + { + a.setAveriguador( ( String ) txtAveriguador.getText() ); + } + + java.util.Date today = new java.util.Date(); + java.sql.Date sqlToday = new java.sql.Date( today.getTime() ); + //if(a.getData_acidente() == null) + //{ + // a.setData_acidente(sqlToday); + //} + //else + //{ + DateFormat formatador = new SimpleDateFormat( "yyyy-MM-dd" ); + + java.util.Date ddate = ( java.util.Date ) calDataOcorrencia.getValue(); + try + { + String ddate_str = formatador.format( ddate ); + java.sql.Date ddate_sql = new java.sql.Date( formatador.parse( ddate_str ).getTime() ); + a.setData_acidente( ddate_sql ); + } + catch ( Exception ex ) + { + a.setData_acidente( null ); + } + //} + + if ( a.getData_inicio_processo() == null ) + { + a.setData_inicio_processo( sqlToday ); + } + + Integer hhInt = ( Integer ) drpHours.getSelected(); + Integer mmInt = ( Integer ) drpMinutes.getSelected(); + + if ( hhInt.intValue() == -1 || mmInt.intValue() == -1 ) + { + a.setHora_acidente( null ); + } + else + { +// String hh = drpHours.getSelected().toString(); +// String mm = drpMinutes.getSelected().toString(); + String hh = hhInt.toString(); + String mm = mmInt.toString(); + SimpleDateFormat formatter = new SimpleDateFormat( "HH:mm" ); + try + { + Time horaAcidente = new Time( formatter.parse( hh + ":" + mm ).getTime() ); + a.setHora_acidente( horaAcidente ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + + } + + + + 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(); + Medico m = getSessionBean1().getMedico(); + if ( m != null ) + { + Integer medico_id = m.getId(); + if ( medico_id.intValue() > 0 ) + { + a.setMedico_id( medico_id ); + } + + } + + Integer horas_turno = null; + try + { + String horas_turno_str = ( String ) txtHorasTurno.getText(); + horas_turno = new Integer( Integer.parseInt( horas_turno_str ) ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + a.setHoras_turno( horas_turno ); + + a.setDepartamento_id( ( Integer ) drpDepartamento.getSelected() ); + a.setSeccao_id( ( Integer ) drpSeccao.getSelected() ); + + try + { + if ( txtLocal.getText() != null ) + { + a.setLocal_trabalho( ( String ) txtLocal.getText() ); + } + else + { + a.setLocal_trabalho( "" ); + } + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + + try + { + if ( txtTarefa.getText() != null ) + { + a.setTarefa( ( String ) txtTarefa.getText() ); + } + else + { + a.setTarefa( "" ); + } + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + + try + { + if ( txtSubstancias.getText() != null ) + { + a.setSubstancias( ( String ) txtSubstancias.getText() ); + } + else + { + a.setSubstancias( "" ); + } + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + +// try // { -// if(a.getRestricao_carga().intValue() > 0) +// if(txtSuperior.getText() != null) // { -// 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); +// a.setSuperior_hierarquico( (String) txtSuperior.getText() ); // } -// -// if(a.getRestricao_motricidade().matches("y")) +// else // { -// st = new StaticText(); -// st.setId("stRestricaoMotricidadeLbl"); -// st.setEscape(false); -// st.setText("Operações que requeiram motricidade fina."); -// gridOutrasRestricoes.getChildren().add(st); +// a.setSuperior_hierarquico(""); // } -// -// 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) +// } +// catch(Exception ex) +// { +// ErrorLogger.logException( ex ); +// } + + try + { + if ( txtCondicoes.getText() != null ) + { + a.setCondicoes( ( String ) txtCondicoes.getText() ); + } + else + { + a.setCondicoes( "" ); + } + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + + try + { + if ( txtTestemunhas.getText() != null ) + { + a.setTestemunhas( ( String ) txtTestemunhas.getText() ); + } + else + { + a.setTestemunhas( "" ); + } + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + +// try +// { +// if(txtCausas.getText() != null) // { -// st = new StaticText(); -// st.setId("stRestricaoOutras"); -// st.setEscape(false); -// st.setText(a.getRestricao_outras()); -// gridOutrasRestricoes.getChildren().add(st); +// a.setCausas( (String) txtCausas.getText() ); // } -// -// if(a.getMed_observ().trim().length() > 0) +// else // { -// stObservacoes.setText(a.getMed_observ()); +// a.setCausas(""); // } // } - - } -// 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) +// catch(Exception ex) // { -// gridTrabalhadores.setRendered(false); -// } -// -// return null; -// } +// ErrorLogger.logException( ex ); +// } -// 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; -// } - - private void fillVerificacao(AnaliseAcidente a) - { - int estado = a.getEstado().intValue(); - switch(estado) - { - case Global.ESTADO_ASSINATURA_SEG: - if(a.getAss_resp_seg().matches("y")) - { - chkVerRespSeg.setSelected(new Boolean(true)); - chkVerRespSeg.setDisabled(true); - java.util.Date ddate = new java.util.Date(a.getData_assinatura_seg().getTime()); - stVerRespSeg.setText("Tomei conhecimento a " + utils.Utils.dateToYYYYMMDD(ddate)); - } - break; - - case Global.ESTADO_ASSINATURA_RH: - if(a.getAss_resp_rh().matches("y")) - { - chkVerRespRh.setSelected(new Boolean(true)); - chkVerRespRh.setDisabled(true); - java.util.Date ddate = new java.util.Date(a.getData_assinatura_rh().getTime()); - stVerRespRh.setText("Tomei conhecimento a " + utils.Utils.dateToYYYYMMDD(ddate)); - } - - break; - } - } - - private void fillVerificacaoView(AnaliseAcidente a) - { - StaticText st = null; - String txtVer = null; - if(a.getAveriguador() != null) - { - if(a.getAveriguador().trim().length() > 0) - { - st = new StaticText(); - st.setId("stVerificacao1"); - st.setEscape(false); - txtVer = "Averiguado por " + a.getAveriguador() + " (Departamento de Segurança) a "; - //txtVer += a.getData_assinatura_seg(); - - try - { - java.util.Date ddate = new java.util.Date(a.getData_inicio_processo().getTime()); - txtVer += utils.Utils.dateToYYYYMMDD(ddate) + "."; - } - catch(Exception ex) + a.setCausas( ( Integer ) drpCausas.getSelected() ); + + try + { + if ( txtDescricao.getText() != null ) + { + a.setDescricao( ( String ) txtDescricao.getText() ); + } + else + { + a.setDescricao( "" ); + } + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + + try + { + if ( txtConclusoes.getText() != null ) + { + a.setConclusoes( ( String ) txtConclusoes.getText() ); + } + else + { + a.setConclusoes( "" ); + } + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + + try + { + if ( txtAccoes.getText() != null ) + { + a.setAccoes( ( String ) txtAccoes.getText() ); + } + else + { + a.setAccoes( "" ); + } + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + + a.setAveriguacao_posterior( "n" ); + if ( chkAveriguacaoPosterior.getSelected() != null ) + { + if ( chkAveriguacaoPosterior.getSelected().equals( new Boolean( true ) ) ) + { + a.setAveriguacao_posterior( "y" ); + } + } + + if ( txtAveriguacaoObs.getText() != null ) + { + a.setAveriguacao_obs( ( String ) txtAveriguacaoObs.getText() ); + } + return a; + } + + private AnaliseAcidente fillAnaliseFieldsRH1( AnaliseAcidente a ) + { + boolean booFormacaoSHST = false; + if ( rbFormacaoSHSTY.getSelected() != null ) + { + Boolean f = ( Boolean ) rbFormacaoSHSTY.getSelected(); + if ( f.equals( new Boolean( true ) ) ) + { + a.setFormacao_shst( "y" ); + booFormacaoSHST = true; + } + } + + if ( !booFormacaoSHST ) + { + if ( rbFormacaoSHSTN.getSelected() != null ) + { + Boolean f = ( Boolean ) rbFormacaoSHSTN.getSelected(); + if ( f.equals( new Boolean( true ) ) ) + { + a.setFormacao_shst( "n" ); + a.setFormacao_shst_nao_porque( "" ); + if ( txtFormacaoSHSTNWhy.getText() != null ) + { + String s = ( String ) txtFormacaoSHSTNWhy.getText(); + if ( s.trim().length() > 0 ) + { + a.setFormacao_shst_nao_porque( s ); + } + } + } + } + else + { + a.setFormacao_shst( "t" ); + } + } + + boolean booAcidentesColaborador = false; + a.setOutros_acidentes_com_colaborador( "n" ); + if ( rbAcidentesColaboradorY.getSelected() != null ) + { + Boolean f = ( Boolean ) rbAcidentesColaboradorY.getSelected(); + if ( f.equals( new Boolean( true ) ) ) + { + a.setOutros_acidentes_com_colaborador( "y" ); + booAcidentesColaborador = true; + if ( txtNrAcidentesColaborador.getText() != null ) + { + String nr_str = ( String ) txtNrAcidentesColaborador.getText(); + if ( nr_str.trim().length() > 0 ) + { + try + { + Integer nr = new Integer( Integer.parseInt( nr_str ) ); + a.setNr_acidentes_com_colaborador( nr ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + } + } + + if ( txtNrRelatorioAcidentesColaborador1.getText() != null ) + { + 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 ) + { + ErrorLogger.logException( ex ); + } + } + } + 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 ) + { + ErrorLogger.logException( ex ); + } + } + } + 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 ) + { + ErrorLogger.logException( ex ); + } + } + } + if ( txtNrRelatorioAcidentesColaborador4.getText() != null ) { - ErrorLogger.logException( ex ); + 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 ) + { + ErrorLogger.logException( ex ); + } + } } - st.setText(txtVer); - gridAssinaturasView.getChildren().add(st); - } - } - - if(a.getAss_consolidacao().matches("y")) - { - st = new StaticText(); - st.setId("stVerificacao2"); - st.setEscape(false); - txtVer = "Verificado por " + a.getNome_resp_consolidacao() + " (Técnico de SHST) a "; - //txtVer += a.getData_assinatura_rh(); - try - { - java.util.Date ddate = new java.util.Date(a.getData_consolidacao().getTime()); - txtVer += utils.Utils.dateToYYYYMMDD(ddate) + "."; - } - catch(Exception ex) - { - ErrorLogger.logException( ex ); } - st.setText(txtVer); - gridAssinaturasView.getChildren().add(st); - } - - if(a.getAss_resp_seg().matches("y")) - { - st = new StaticText(); - st.setId("stVerificacao3"); - st.setEscape(false); - txtVer = "Verificado por " + a.getNome_resp_seg() + " (Responsável de Segurança) a "; - //txtVer += a.getData_assinatura_rh(); - try - { - java.util.Date ddate = new java.util.Date(a.getData_assinatura_seg().getTime()); - txtVer += utils.Utils.dateToYYYYMMDD(ddate) + "."; - } - catch(Exception ex) - { - ErrorLogger.logException( ex ); - } - st.setText(txtVer); - gridAssinaturasView.getChildren().add(st); - } - - if(a.getAss_resp_rh().matches("y")) - { - st = new StaticText(); - st.setId("stVerificacao4"); - st.setEscape(false); - txtVer = "Verificado por " + a.getNome_resp_rh() + " (Responsável de RH) a "; - //txtVer += a.getData_assinatura_rh(); - try - { - java.util.Date ddate = new java.util.Date(a.getData_assinatura_rh().getTime()); - txtVer += utils.Utils.dateToYYYYMMDD(ddate) + "."; - } - catch(Exception ex) + } + + if ( !booAcidentesColaborador ) + { + if ( rbAcidentesColaboradorN.getSelected() != null ) { - ErrorLogger.logException( ex ); + Boolean f = ( Boolean ) rbAcidentesColaboradorN.getSelected(); + if ( f.equals( new Boolean( true ) ) ) + { + a.setOutros_acidentes_com_colaborador( "n" ); + } } - st.setText(txtVer); - gridAssinaturasView.getChildren().add(st); - } - -// AnalisesDataProvider adp = new AnalisesDataProvider(); - try - { - AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); - - Acidentado ac = adp.getAcidentado(a.getAcidentado_id()); - if(ac.getNome_superior_hierarquico() != null) - { - if(ac.getNome_superior_hierarquico().trim().length() > 0) - { - st = new StaticText(); - st.setId("stVerificacao5"); - st.setEscape(false); - txtVer = "Com conhecimento de " + ac.getNome_superior_hierarquico() + " (Responsável hierárquico)"; - - if(ac.getEmail_superior_hierarquico() != null) - { - if(ac.getEmail_superior_hierarquico().trim().length() > 0) - { - try - { - java.util.Date ddate = new java.util.Date(ac.getData_email_superior_hierarquico().getTime()); - txtVer += " a " + utils.Utils.dateToYYYYMMDD(ddate); - } - catch(Exception ex) - { - ErrorLogger.logException( ex ); - } - } - } - txtVer += "."; - st.setText(txtVer); - gridAssinaturasView.getChildren().add(st); - } - } - } - catch(Exception ex) - { - ErrorLogger.logException( ex ); - } - - HtmlPanelGrid grid = new HtmlPanelGrid(); - grid.setId("rodape1"); - grid.setColumns(1); - grid.setStyle("width: 100%"); - grid.setColumnClasses("gridColCenter"); - st = new StaticText(); - st.setId("stRodape1"); - st.setEscape(false); - st.setText("- processamento informático - acesso autenticado -"); - grid.getChildren().add(st); - gridAssinaturasView.getChildren().add(grid); - } - - - private AnaliseAcidente fillAnaliseFieldsImpressao(AnaliseAcidente a) - { - a.setAss_superior("n"); - if(chkAssSup.getSelected() != null) - { - if(chkAssSup.getSelected().equals(new Boolean(true))) - { - a.setAss_superior("y"); - } - } - - if(a.getAss_superior().matches("y")) - { - a.setNome_superior(""); - if(txtAssSup.getText() != null) - { - a.setNome_superior( (String) txtAssSup.getText()); - } - java.util.Date today = - new java.util.Date(); - java.sql.Date sqlToday = - new java.sql.Date(today.getTime()); - a.setData_assinatura_superior(sqlToday); - } - else - { - a.setNome_superior(""); - a.setData_assinatura_superior(null); - } - return a; - } - - private void fillImpressao(AnaliseAcidente a) - { - if(a.getAss_superior().matches("y")) - { - chkAssSup.setSelected(new Boolean(true)); - txtAssSup.setText(a.getNome_superior()); - String txt = (String) stAssSup2.getText(); - String nome_acidentado = getSessionBean1().getAcidentado().getNome(); - String stData = ""; - try - { - java.util.Date ddate = new java.util.Date(a.getData_assinatura_superior().getTime()); - stData += utils.Utils.dateToYYYYMMDD(ddate); - } - catch(Exception ex) + else { - ErrorLogger.logException( ex ); + a.setOutros_acidentes_com_colaborador( "t" ); } - stAssSup2.setText(txt + nome_acidentado + ", a " + stData); - } - - } - - private void fillImpressaoView(AnaliseAcidente a) - { - StaticText st = new StaticText(); - st.setId("stImpressaoView1"); - st.setEscape(false); - String stData = ""; - try - { - java.util.Date ddate = new java.util.Date(a.getData_assinatura_superior().getTime()); - stData += utils.Utils.dateToYYYYMMDD(ddate); - } - catch(Exception ex) - { - ErrorLogger.logException( ex ); } - - String txt = "Assinado na Ficha de Análise de Acidente em papel por " + a.getNome_superior() + ", superior hierárquico / superior de "; - txt += getSessionBean1().getAcidentado().getNome() + ", a " + stData; - gridAssSupView.getChildren().add(st); - } - - 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. - getSessionBean1().setIeBug(true); - 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"); -// } -// if(gridImages.getChildren().size() > 0) -// { -// gridImages.getChildren().clear(); -// } - ServletContext theApplicationsServletContext = - (ServletContext) this.getExternalContext().getContext(); - - - File apacheTmpFolder = new File(theApplicationsServletContext.getRealPath( Global.RESOURCES_IMAGE_FOLDER ) + "/tmp" + getSessionBean1().getCurrentUser().getLogin()); - if(apacheTmpFolder.exists()) - { - Global global = new Global(); - global.deleteFolderFiles(apacheTmpFolder); - } - else - { - apacheTmpFolder.mkdir(); - } - -// String imageFileFolder = theApplicationsServletContext.getRealPath(Global.IMAGE_FOLDER + "/tmp" + getSessionBean1().getCurrentUser().getLogin()); - String imageFileFolder = Global.IMAGE_FOLDER + "/tmp" + getSessionBean1().getCurrentUser().getLogin(); - try - { - File f = new File(imageFileFolder); - - if(f.exists()) - { - File files[] = f.listFiles(); - //List list = Arrays.asList(files); - Arrays.sort(files); - for(int i=0;i 0 ) + { + try { - getSessionBean1().setMsg( "A Ficha de Análise de Acidente nº " + aa.getAnalise_nr() + " foi enviada para a fase seguinte." ); + Integer nr = new Integer( Integer.parseInt( nr_str ) ); + a.setNr_acidentes_outros_colaboradores( nr ); } - else + catch ( Exception ex ) { - getSessionBean1().setMsg( errorMessage ); + ErrorLogger.logException( ex ); } - } - else - { - getSessionBean1().setMsg( "A Ficha de Análise de Acidente foi enviada para a fase seguinte." ); - } - String navFrom = getSessionBean1().getNavFrom(); - if ( navFrom.matches( "FormSeguranca" ) ) - { - return "form_seguranca"; - } - } - catch ( Exception ex ) - { - getSessionBean1().setMsg( "Erro no envio da análise !" ); - getSessionBean1().setSubmetido( false ); - ErrorLogger.logException( ex ); - } - } - else - { - getSessionBean1().setSubmetido( false ); - } - } - else // edit analise - { - if ( validationOk() ) - { - AnaliseAcidente a = fillAnaliseFields(); - Acidentado ac = null; - ArrayList recs = null; - ArrayList meds = null; - int estado = a.getEstado().intValue(); - //if(estado == ESTADO_SEG || estado == ESTADO_RH1) - if ( estado == Global.ESTADO_RH1 ) - { - ac = fillAcidentadoFields(); - } - else if ( estado == Global.ESTADO_HS ) - { - a.setTecnico_saude_id( getSessionBean1().getCurrentUser().getId() ); - recs = fillAnaliseRecomendacoesHs( a ); - } - else if ( estado == Global.ESTADO_RH2 ) - { - meds = fillAnaliseMedidasRh( a ); - a.setRh_fase4( getSessionBean1().getCurrentUser().getId() ); - } - int novo_estado = a.getEstado().intValue(); - - if ( a.getCorrecao().matches( "y" ) ) - { - a.setCorrecao( "n" ); - a.setEstado( a.getEstado_antes_correcao() ); - novo_estado = a.getEstado_antes_correcao().intValue(); - a.setEstado_antes_correcao( null ); - a.setObservacoes_correcao( "" ); - //sendMailToNextUser(a, new Integer(novo_estado)); - } - else - { - if ( novo_estado < Global.ESTADO_CONCLUIDO ) - { - if ( ! getSessionBean1().isSubmetido() ) - { - novo_estado++; - } - - // if(novo_estado == ESTADO_MEDICO) - // { - // novo_estado++; //skip medico - // } -// if(novo_estado == Global.ESTADO_ASSINATURA_SEG || novo_estado == Global.ESTADO_ASSINATURA_RH) -// { -// //a.setEstado_assinatura(new Integer(ESTADO_ASSINATURA_1)); -// notifyNextSignature(new Integer(novo_estado)); -// } - } - a.setEstado( new Integer( novo_estado ) ); - } - - try - { - if ( ! getSessionBean1().isSubmetido() ) - { - getSessionBean1().setSubmetido( true ); - update( a, ac, recs, meds ); - //createImagesFolder(analiseId.toString()); - updateImagesFolder( a ); - String errorMessage = ""; - errorMessage += sendMailToNextUser( a, new Integer( novo_estado ) ); - //envia email para responsavel hierarquico ao passar da Consolidacao para a Verificacao - if ( a.getEstado().intValue() == Global.ESTADO_ASSINATURA_SEG ) + } + } + + if ( txtNrRelatorioAcidentesColaboradores1.getText() != null ) + { + String nr_str = ( String ) txtNrRelatorioAcidentesColaboradores1.getText(); + if ( nr_str.trim().length() > 0 ) + { + try { - errorMessage += sendEmailResponsavelHierarquico( a ); + Integer nr = new Integer( Integer.parseInt( nr_str ) ); + a.setNr_relatorio_acidente_outros_colaboradores1( nr ); } - else if ( a.getEstado().intValue() == Global.ESTADO_CONCLUIDO ) + catch ( Exception ex ) { - errorMessage += sendEmailFimProcesso( a ); - errorMessage += sendEmailToRhFase4( a ); - } - - if ( "".equals( errorMessage.trim() ) ) + ErrorLogger.logException( ex ); + } + } + } + if ( txtNrRelatorioAcidentesColaboradores2.getText() != null ) + { + String nr_str = ( String ) txtNrRelatorioAcidentesColaboradores2.getText(); + if ( nr_str.trim().length() > 0 ) + { + try { - getSessionBean1().setMsg( "A Ficha de Análise de Acidente nº " + a.getAnalise_nr() + " foi enviada para a fase seguinte." ); + Integer nr = new Integer( Integer.parseInt( nr_str ) ); + a.setNr_relatorio_acidente_outros_colaboradores2( nr ); } - else + catch ( Exception ex ) { - getSessionBean1().setMsg( errorMessage ); + ErrorLogger.logException( ex ); } - } - else - { - getSessionBean1().setMsg( "A Ficha de Análise de Acidente nº " + a.getAnalise_nr() + " foi enviada para a fase seguinte." ); - } - String navFrom = getSessionBean1().getNavFrom(); - if ( navFrom.matches( "FormSeguranca" ) ) - { - return "form_seguranca"; - } - else if ( navFrom.matches( "FormRH" ) ) - { - return "form_rh"; - } - else if ( navFrom.matches( "FormHS" ) ) - { - return "form_hs"; - } - else if ( navFrom.matches( "FormMedico" ) ) - { - return "form_medico"; - } - } - catch ( Exception ex ) - { - getSessionBean1().setMsg( "Erro na actualização da análise !" ); - getSessionBean1().setSubmetido( false ); - ErrorLogger.logException( ex ); - } - } - else - { - getSessionBean1().setSubmetido( false ); - } - } - return null; - } - - - private AnaliseAcidente create(AnaliseAcidente a, Acidentado ac) throws Exception - { -// AnalisesDataProvider adp = new AnalisesDataProvider(); - AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); - - Integer acidentado_id = adp.createAcidentado(ac); - a.setAcidentado_id(acidentado_id); - AnaliseAcidente aa = adp.createAnalise(a); - - - return aa; - } - - private void update(AnaliseAcidente a, Acidentado ac, ArrayList recs, ArrayList meds) throws Exception - { -// AnalisesDataProvider adp = new AnalisesDataProvider(); - AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); - - if(ac != null) - { - adp.updateAcidentado(ac); - } - if(recs != null) - { - //remove recs form analise - try - { - adp.deleteRecomendacoesByAnalise(a.getId()); - } - catch(Exception ex) - { - ErrorLogger.logException( ex ); - } - ListIterator iter = recs.listIterator(); - while(iter.hasNext()) - { - Recomendacao r = (Recomendacao)iter.next(); - adp.createRecomendacao(r); - } - } - else if(meds != null) - { - //remove meds form analise - try - { - adp.deleteMedidasByAnalise(a.getId()); - } - catch(Exception ex) - { - ErrorLogger.logException( ex ); - } - ListIterator iter = meds.listIterator(); - while(iter.hasNext()) - { - Medida m = (Medida)iter.next(); - adp.createMedida(m); - } - } - adp.updateAnalise(a); - } - - private Acidentado fillAcidentadoFields() - { - Acidentado a = getSessionBean1().getAcidentado(); - a.setBilhete_identidade(""); - if(txtBI.getText() != null) - { - String bi = (String) txtBI.getText(); - if(bi.trim().length() > 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("v"); // null - if(rbTurnoManha.getValue() != null) - { - if(rbTurnoManha.getValue().equals(new Boolean(true))) - { - a.setTurno("m"); - } - } - if(rbTurnoTarde.getValue() != null) - { - if(rbTurnoTarde.getValue().equals(new Boolean(true))) - { - a.setTurno("t"); - } - } - if(rbTurnoNoite.getValue() != null) - { - if(rbTurnoNoite.getValue().equals(new Boolean(true))) - { - a.setTurno("n"); - } - } - - if(txtNomeSuperior.getText() != null) - { - a.setNome_superior_hierarquico((String) txtNomeSuperior.getText()); - } - - if(txtEmailSuperior.getText() != null) - { - a.setEmail_superior_hierarquico((String) txtEmailSuperior.getText()); - java.util.Date today = - new java.util.Date(); - java.sql.Date sqlToday = - new java.sql.Date(today.getTime()); - a.setData_email_superior_hierarquico(sqlToday); - } - - 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 = Global.ESTADO_SEG; - a.setEstado(new Integer(estado)); - } - else - { - a = getSessionBean1().getCurrentAnalise(); - estado = a.getEstado().intValue(); - } - - - //averiguacao posterior -// if(estado < Global.ESTADO_ASSINATURAS) - if(estado <= Global.ESTADO_ASSINATURA_SEG) - { - if(getSessionBean1().getCurrentUser().getTipo().intValue() == 1) //seguranca - { - if(a.getAveriguacao_posterior().matches("y")) - { - if(txtAveriguacaoObs1.getText() != null) - { - a.setAveriguacao_obs((String) txtAveriguacaoObs1.getText()); - } - } - } - } - - switch(estado) - { - case Global.ESTADO_SEG: - a = fillAnaliseFieldsSeg(a); - break; - case Global.ESTADO_RH1: - //a = fillAnaliseFieldsSeg(a); - a = fillAnaliseFieldsRH1(a); - break; - case Global.ESTADO_HS: - //a = fillAnaliseFieldsHS(a); - break; - case Global.ESTADO_RH2: - a = fillAnaliseFieldsMedico(a); - //a = fillAnaliseFieldsRH2(a); - break; -// case Global.ESTADO_MEDICINA: -// a = fillAnaliseFieldsMedico(a); -// break; - case Global.ESTADO_CONSOLIDACAO: - a = fillAnaliseFieldsConsolidacao(a); - break; -// case Global.ESTADO_ASSINATURAS: - case Global.ESTADO_ASSINATURA_SEG: - a = fillAnaliseAssinaturas(a); - break; - case Global.ESTADO_ASSINATURA_RH: - a = fillAnaliseAssinaturas(a); - break; - - } - - return a; - } - - private AnaliseAcidente fillAnaliseFieldsSeg(AnaliseAcidente a) - { - if(txtAveriguador.getText() != null) - { - a.setAveriguador((String) txtAveriguador.getText()); - } - - java.util.Date today = new java.util.Date(); - java.sql.Date sqlToday = new java.sql.Date(today.getTime()); - //if(a.getData_acidente() == null) - //{ - // a.setData_acidente(sqlToday); - //} - //else - //{ - DateFormat formatador = new SimpleDateFormat("yyyy-MM-dd"); - - java.util.Date ddate = (java.util.Date) calDataOcorrencia.getValue(); - try - { - String ddate_str = formatador.format(ddate); - java.sql.Date ddate_sql = new java.sql.Date(formatador.parse(ddate_str).getTime()); - a.setData_acidente(ddate_sql); - } - catch(Exception ex) - { - a.setData_acidente(null); - } - //} - - if(a.getData_inicio_processo() == null) - { - a.setData_inicio_processo(sqlToday); - } - - Integer hhInt = (Integer) drpHours.getSelected(); - Integer mmInt = (Integer) drpMinutes.getSelected(); - - if(hhInt.intValue() == -1 || mmInt.intValue() == -1) - { - a.setHora_acidente(null); - } - else - { -// String hh = drpHours.getSelected().toString(); -// String mm = drpMinutes.getSelected().toString(); - String hh = hhInt.toString(); - String mm = mmInt.toString(); - SimpleDateFormat formatter = new SimpleDateFormat ( "HH:mm" ); - try - { - Time horaAcidente = new Time(formatter.parse( hh + ":" + mm ).getTime()); - a.setHora_acidente(horaAcidente); - } - catch(Exception ex) - { - ErrorLogger.logException( ex ); - } - - } - - - - if(getSessionBean1().getCurrentAnalise() == null) // new - { - a.setEmpresa_id(getSessionBean1().getCurrentUser().getEmpresa_id()); - a.setEstabelecimento_id(getSessionBean1().getCurrentUser().getEstabelecimento_id()); - } + } + } + 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 ) + { + ErrorLogger.logException( ex ); + } + } + } + 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 ) + { + ErrorLogger.logException( ex ); + } + } + } -// Integer medico_id = (Integer) drpMedicos.getSelected(); - Medico m = getSessionBean1().getMedico(); - if(m != null) - { - Integer medico_id = m.getId(); - if(medico_id.intValue() > 0) - { - a.setMedico_id(medico_id); - } - - } - - Integer horas_turno = null; - try - { - String horas_turno_str = (String) txtHorasTurno.getText(); - horas_turno = new Integer( Integer.parseInt(horas_turno_str) ); - } - catch(Exception ex) - { - ErrorLogger.logException( ex ); - } - a.setHoras_turno(horas_turno); - - a.setDepartamento_id(( Integer ) drpDepartamento.getSelected()); - a.setSeccao_id((Integer) drpSeccao.getSelected()); - - try - { - if(txtLocal.getText() != null) - { - a.setLocal_trabalho( (String) txtLocal.getText() ); - } - else - { - a.setLocal_trabalho(""); - } - } - catch(Exception ex) - { - ErrorLogger.logException( ex ); - } - - try - { - if(txtTarefa.getText() != null) - { - a.setTarefa( (String) txtTarefa.getText() ); - } - else - { - a.setTarefa(""); - } - } - catch(Exception ex) - { - ErrorLogger.logException( ex ); - } - - try - { - if(txtSubstancias.getText() != null) - { - a.setSubstancias( (String) txtSubstancias.getText() ); - } - else - { - a.setSubstancias(""); - } - } - catch(Exception ex) - { - ErrorLogger.logException( ex ); - } + } + } -// try -// { -// if(txtSuperior.getText() != null) -// { -// a.setSuperior_hierarquico( (String) txtSuperior.getText() ); -// } -// else -// { -// a.setSuperior_hierarquico(""); -// } -// } -// catch(Exception ex) -// { -// ErrorLogger.logException( ex ); -// } + if ( !booAcidentesColaboradores ) + { + if ( rbAcidentesColaboradoresN.getSelected() != null ) + { + Boolean f = ( Boolean ) rbAcidentesColaboradoresN.getSelected(); + if ( f.equals( new Boolean( true ) ) ) + { + a.setAcidentes_outros_colaboradores( "n" ); + } + } + else + { + a.setAcidentes_outros_colaboradores( "t" ); + } + } - try - { - if(txtCondicoes.getText() != null) - { - a.setCondicoes( (String) txtCondicoes.getText() ); - } - else - { - a.setCondicoes(""); - } - } - catch(Exception ex) - { - ErrorLogger.logException( ex ); - } - - try - { - if(txtTestemunhas.getText() != null) - { - a.setTestemunhas( (String) txtTestemunhas.getText() ); - } - else - { - a.setTestemunhas(""); - } - } - catch(Exception ex) - { - ErrorLogger.logException( ex ); - } + return a; + } -// try -// { -// if(txtCausas.getText() != null) -// { -// a.setCausas( (String) txtCausas.getText() ); -// } -// else -// { -// a.setCausas(""); -// } -// } -// catch(Exception ex) -// { -// ErrorLogger.logException( ex ); -// } - - a.setCausas((Integer) drpCausas.getSelected()); - - try - { - if(txtDescricao.getText() != null) - { - a.setDescricao( (String) txtDescricao.getText() ); - } - else - { - a.setDescricao(""); - } - } - catch(Exception ex) - { - ErrorLogger.logException( ex ); - } - - try - { - if(txtConclusoes.getText() != null) - { - a.setConclusoes( (String) txtConclusoes.getText() ); - } - else - { - a.setConclusoes(""); - } - } - catch(Exception ex) - { - ErrorLogger.logException( ex ); - } - - try - { - if(txtAccoes.getText() != null) - { - a.setAccoes( (String) txtAccoes.getText() ); - } - else - { - a.setAccoes(""); - } - } - catch(Exception ex) - { - ErrorLogger.logException( ex ); - } - - a.setAveriguacao_posterior("n"); - if(chkAveriguacaoPosterior.getSelected() != null) - { - if(chkAveriguacaoPosterior.getSelected().equals(new Boolean(true))) - { - a.setAveriguacao_posterior("y"); - } - } - - if(txtAveriguacaoObs.getText() != null) - { - a.setAveriguacao_obs((String) txtAveriguacaoObs.getText()); - } - return a; - } - - private AnaliseAcidente fillAnaliseFieldsRH1(AnaliseAcidente a) - { - boolean booFormacaoSHST = false; - if(rbFormacaoSHSTY.getSelected() != null) - { - Boolean f = (Boolean) rbFormacaoSHSTY.getSelected(); - if(f.equals(new Boolean(true))) - { - a.setFormacao_shst("y"); - booFormacaoSHST = true; - } - } - - if(!booFormacaoSHST) - { - if(rbFormacaoSHSTN.getSelected() != null) - { - Boolean f = (Boolean) rbFormacaoSHSTN.getSelected(); - if(f.equals(new Boolean(true))) - { - a.setFormacao_shst("n"); - a.setFormacao_shst_nao_porque(""); - if(txtFormacaoSHSTNWhy.getText() != null) - { - String s = (String) txtFormacaoSHSTNWhy.getText(); - if(s.trim().length() > 0 ) - { - a.setFormacao_shst_nao_porque( s ); - } - } - } - } - else - { - a.setFormacao_shst("t"); - } - } - - boolean booAcidentesColaborador = false; - a.setOutros_acidentes_com_colaborador("n"); - if(rbAcidentesColaboradorY.getSelected() != null) - { - Boolean f = (Boolean) rbAcidentesColaboradorY.getSelected(); - if(f.equals(new Boolean(true))) - { - a.setOutros_acidentes_com_colaborador("y"); - booAcidentesColaborador = true; - if(txtNrAcidentesColaborador.getText() != null) - { - String nr_str = (String) txtNrAcidentesColaborador.getText(); - if(nr_str.trim().length() > 0) - { - try - { - Integer nr = new Integer(Integer.parseInt(nr_str)); - a.setNr_acidentes_com_colaborador(nr); - } - catch(Exception ex) - { - ErrorLogger.logException( ex ); - } - } - } - - if(txtNrRelatorioAcidentesColaborador1.getText() != null) - { - 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) - { - ErrorLogger.logException( ex ); - } - } - } - 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) - { - ErrorLogger.logException( ex ); - } - } - } - 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) - { - ErrorLogger.logException( ex ); - } - } - } - 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) - { - ErrorLogger.logException( ex ); - } - } - } - } - } - - if(!booAcidentesColaborador) - { - if(rbAcidentesColaboradorN.getSelected() != null) - { - Boolean f = (Boolean) rbAcidentesColaboradorN.getSelected(); - if(f.equals(new Boolean(true))) - { - a.setOutros_acidentes_com_colaborador("n"); - } - } - else - { - a.setOutros_acidentes_com_colaborador("t"); - } - } - - boolean booAcidentesColaboradores = false; - if(rbAcidentesColaboradoresY.getSelected() != null) - { - Boolean f = (Boolean) rbAcidentesColaboradoresY.getSelected(); - if(f.equals(new Boolean(true))) - { - a.setAcidentes_outros_colaboradores("y"); - booAcidentesColaboradores = true; - if(txtNrAcidentesColaboradores.getText() != null) - { - String nr_str = (String) txtNrAcidentesColaboradores.getText(); - if(nr_str.trim().length() > 0) - { - try - { - Integer nr = new Integer(Integer.parseInt(nr_str)); - a.setNr_acidentes_outros_colaboradores(nr); - } - catch(Exception ex) - { - ErrorLogger.logException( ex ); - } - } - } - - if(txtNrRelatorioAcidentesColaboradores1.getText() != null) - { - 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) - { - ErrorLogger.logException( ex ); - } - } - } - 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) - { - ErrorLogger.logException( ex ); - } - } - } - 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) - { - ErrorLogger.logException( ex ); - } - } - } - 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) - { - ErrorLogger.logException( ex ); - } - } - } - - } - } - - if(!booAcidentesColaboradores) - { - if(rbAcidentesColaboradoresN.getSelected() != null) - { - Boolean f = (Boolean) rbAcidentesColaboradoresN.getSelected(); - if(f.equals(new Boolean(true))) - { - a.setAcidentes_outros_colaboradores("n"); - } - } - else - { - a.setAcidentes_outros_colaboradores("t"); - } - } - - return a; - } - - private ArrayList fillAnaliseRecomendacoesHs(AnaliseAcidente a) - { - System.out.println("FILL RECOMENDACOES"); - 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) - { - Recomendacao r = new Recomendacao(); - r.setAnalise_id(a.getId()); - r.setRecomendacao(txt); - list.add(r); - } - } - } - return list; - } - - private ArrayList fillAnaliseMedidasRh(AnaliseAcidente a) - { - 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 AnaliseAcidente fillAnaliseFieldsRH2(AnaliseAcidente a) - { - return a; - } - - private AnaliseAcidente fillAnaliseFieldsMedico(AnaliseAcidente a) - { - a.setLesao_cabeca("n"); - if(chkCabeca.getSelected() != null) - { - if(chkCabeca.getSelected().equals(new Boolean(true))) - { - a.setLesao_cabeca("y"); - } - } - - a.setLesao_pescoco("n"); - if(chkPescoco.getSelected() != null) - { - 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()); - } - } - } - - a.setLesao_membro_sup_esq("n"); - if(chkMembroSupEsq.getSelected() != null) - { - 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.setTipo_incapacidade("v"); - if(rbIncapacidadeNone.getSelected() != null) - { - if(rbIncapacidadeNone.getSelected().equals(new Boolean(true))) - { - a.setTipo_incapacidade("n"); - } - } - 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"); - } - } - - if(txtCoefIncapacidade.getText() != null) - { - String coef_str = txtCoefIncapacidade.getText().toString(); - if ( coef_str != null && ! "".equals( coef_str.trim() ) ) + private ArrayList fillAnaliseRecomendacoesHs( AnaliseAcidente a ) + { + System.out.println( "FILL RECOMENDACOES" ); + 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 ) + { + Recomendacao r = new Recomendacao(); + r.setAnalise_id( a.getId() ); + r.setRecomendacao( txt ); + list.add( r ); + } + } + } + return list; + } + + private ArrayList fillAnaliseMedidasRh( AnaliseAcidente a ) + { + 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 AnaliseAcidente fillAnaliseFieldsRH2( AnaliseAcidente a ) + { + return a; + } + + private AnaliseAcidente fillAnaliseFieldsMedico( AnaliseAcidente a ) + { + a.setLesao_cabeca( "n" ); + if ( chkCabeca.getSelected() != null ) + { + if ( chkCabeca.getSelected().equals( new Boolean( true ) ) ) + { + a.setLesao_cabeca( "y" ); + } + } + + a.setLesao_pescoco( "n" ); + if ( chkPescoco.getSelected() != null ) + { + 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() ); + } + } + } + + a.setLesao_membro_sup_esq( "n" ); + if ( chkMembroSupEsq.getSelected() != null ) + { + 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.setTipo_incapacidade( "v" ); + if ( rbIncapacidadeNone.getSelected() != null ) + { + if ( rbIncapacidadeNone.getSelected().equals( new Boolean( true ) ) ) + { + a.setTipo_incapacidade( "n" ); + } + } + 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" ); + } + } + + if ( txtCoefIncapacidade.getText() != null ) + { + String coef_str = txtCoefIncapacidade.getText().toString(); + if ( coef_str != null && !"".equals( coef_str.trim() ) ) { try { @@ -11708,59 +12380,59 @@ public class AnaliseAcidenteTrabalho extends AbstractPageBean { ErrorLogger.logException( ex ); } } - } - - DateFormat formatador = new SimpleDateFormat("yyyy-MM-dd"); - - java.util.Date ddate = (java.util.Date) calAvaliacaoIncap.getValue(); - try - { - 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) - { - a.setData_aval_incapacidade(null); - } - - ddate = (java.util.Date) calRevisaoIncap.getValue(); - - try - { - 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) - { - 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 - { - 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); - } - + } + + DateFormat formatador = new SimpleDateFormat( "yyyy-MM-dd" ); + + java.util.Date ddate = ( java.util.Date ) calAvaliacaoIncap.getValue(); + try + { + 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 ) + { + a.setData_aval_incapacidade( null ); + } + + ddate = ( java.util.Date ) calRevisaoIncap.getValue(); + + try + { + 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 ) + { + 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 + { + 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) // { @@ -12025,234 +12697,234 @@ public class AnaliseAcidenteTrabalho extends AbstractPageBean { // { // a.setMed_observ( (String) txtObservacoes.getText() ); // } - - return a; - } - - private AnaliseAcidente fillAnaliseFieldsConsolidacao(AnaliseAcidente a) - { - String nome_resp_consolidacao = getSessionBean1().getCurrentUser().getNome(); - a.setNome_resp_consolidacao(nome_resp_consolidacao); - java.util.Date today = new java.util.Date(); - java.sql.Date sqlToday = new java.sql.Date(today.getTime()); - a.setData_consolidacao(sqlToday); - a.setAss_consolidacao("y"); - return a; - } - - private AnaliseAcidente fillAnaliseAssinaturas(AnaliseAcidente a) - { + + return a; + } + + private AnaliseAcidente fillAnaliseFieldsConsolidacao( AnaliseAcidente a ) + { + String nome_resp_consolidacao = getSessionBean1().getCurrentUser().getNome(); + a.setNome_resp_consolidacao( nome_resp_consolidacao ); + java.util.Date today = new java.util.Date(); + java.sql.Date sqlToday = new java.sql.Date( today.getTime() ); + a.setData_consolidacao( sqlToday ); + a.setAss_consolidacao( "y" ); + return a; + } + + private AnaliseAcidente fillAnaliseAssinaturas( AnaliseAcidente a ) + { // UtilizadoresDataProvider udp = new UtilizadoresDataProvider(); - java.util.Date today = new java.util.Date(); - java.sql.Date sqlToday = new java.sql.Date(today.getTime()); - int estado = a.getEstado().intValue(); - switch(estado) - { - case Global.ESTADO_ASSINATURA_SEG: - //notifyNextSignature(new Integer(Global.ESTADO_ASSINATURA_RH)); - a.setData_assinatura_seg(sqlToday); - a.setAss_resp_seg("y"); - a.setNome_resp_seg( getSessionBean1().getCurrentUser().getNome() ); - break; - case Global.ESTADO_ASSINATURA_RH: - a.setData_assinatura_rh(sqlToday); - a.setAss_resp_rh("y"); - a.setNome_resp_rh(getSessionBean1().getCurrentUser().getNome()); - break; - } - - return a; - } - - private boolean validationDepartmentSectionOk() - { - Integer departmentId = (Integer) drpDepartamento.getSelected(); - if(departmentId.intValue() == 0) - { - getSessionBean1().setMsg("Falta departamento!"); - return false; - } - Integer seccaoId = (Integer) drpSeccao.getSelected(); - if(seccaoId.intValue() == 0) - { - getSessionBean1().setMsg("Falta secção!"); - return false; - } - - return true; - } - - private boolean fieldsLenOk() - { - //System.out.println("VALIDATION GRAVAR OK"); + java.util.Date today = new java.util.Date(); + java.sql.Date sqlToday = new java.sql.Date( today.getTime() ); + int estado = a.getEstado().intValue(); + switch ( estado ) + { + case Global.ESTADO_ASSINATURA_SEG: + //notifyNextSignature(new Integer(Global.ESTADO_ASSINATURA_RH)); + a.setData_assinatura_seg( sqlToday ); + a.setAss_resp_seg( "y" ); + a.setNome_resp_seg( getSessionBean1().getCurrentUser().getNome() ); + break; + case Global.ESTADO_ASSINATURA_RH: + a.setData_assinatura_rh( sqlToday ); + a.setAss_resp_rh( "y" ); + a.setNome_resp_rh( getSessionBean1().getCurrentUser().getNome() ); + break; + } + + return a; + } + + private boolean validationDepartmentSectionOk() + { + Integer departmentId = ( Integer ) drpDepartamento.getSelected(); + if ( departmentId.intValue() == 0 ) + { + getSessionBean1().setMsg( "Falta departamento!" ); + return false; + } + Integer seccaoId = ( Integer ) drpSeccao.getSelected(); + if ( seccaoId.intValue() == 0 ) + { + getSessionBean1().setMsg( "Falta secção!" ); + return false; + } + + return true; + } + + private boolean fieldsLenOk() + { + //System.out.println("VALIDATION GRAVAR OK"); // AnalisesDataProvider adp = new AnalisesDataProvider(); - HashMap meta = new HashMap(); - HashMap meta_ac = new HashMap(); - try - { - AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); - - meta = adp.getMetaData("analises_acidentes"); - meta_ac = adp.getMetaData("acidentados"); - } - catch(Exception ex) - { - ErrorLogger.logException( ex ); - meta = null; - meta_ac = null; - } - - if(meta == null || meta_ac == null) - { - getSessionBean1().setMsg("Erro na aquisição da metadata!"); - return false; - } - - int estado = 0; - if(getSessionBean1().getCurrentAnalise() == null) //null - { - estado = Global.ESTADO_SEG; - } - else - { - AnaliseAcidente a = getSessionBean1().getCurrentAnalise(); - estado = a.getEstado().intValue(); - } - - if(estado == Global.ESTADO_SEG) - { - if(txtAveriguador.getText() != null) - { - String averiguador = txtAveriguador.getText().toString(); - int len = ((Integer)meta.get("averiguador")).intValue(); - System.out.println("Averiguador : " + len); - if(averiguador.length() > len) - { - getSessionBean1().setMsg("O campo Averiguador não pode exceder " + len + " caracteres!"); - return false; - } - } - - if(txtLocal.getText() != null) - { - String local = txtLocal.getText().toString(); - int len = ((Integer)meta.get("local_trabalho")).intValue(); - System.out.println("Local : " + len); - if(local.length() > len) - { - getSessionBean1().setMsg("O campo Local não pode exceder " + len + " caracteres!"); - return false; - } - } - - if(txtTarefa.getText() != null) - { - String tarefa = txtTarefa.getText().toString(); - int len = ((Integer)meta.get("tarefa")).intValue(); - System.out.println("Tarefa : " + len); - if(tarefa.length() > len) - { - getSessionBean1().setMsg("O campo Tarefa não pode exceder " + len + " caracteres!"); - return false; - } - } - - if(txtSubstancias.getText() != null) - { - String substancias = txtSubstancias.getText().toString(); - int len = ((Integer)meta.get("substancias")).intValue(); - System.out.println("Substancias : " + len); - if(substancias.length() > len) - { - getSessionBean1().setMsg("O campo Substancias não pode exceder " + len + " caracteres!"); - return false; - } - } - - if(txtTestemunhas.getText() != null) - { - String testemunhas = txtTestemunhas.getText().toString(); - int len = ((Integer)meta.get("testemunhas")).intValue(); - System.out.println("Testemunhas : " + len); - if(testemunhas.length() > len) - { - getSessionBean1().setMsg("O campo Testemunhas não pode exceder " + len + " caracteres!"); - return false; - } - } - - if(txtDescricao.getText() != null) - { - String descricao = txtDescricao.getText().toString(); - int len = ((Integer)meta.get("descricao")).intValue(); - System.out.println("Descricao : " + len); - if(descricao.length() > len) - { - getSessionBean1().setMsg("O campo Descrição não pode exceder " + len + " caracteres!"); - return false; - } - } - - if(txtConclusoes.getText() != null) - { - String conclusoes = txtConclusoes.getText().toString(); - int len = ((Integer)meta.get("conclusoes")).intValue(); - System.out.println("Conclusoes : " + len); - if(conclusoes.length() > len) - { - getSessionBean1().setMsg("O campo Conclusões não pode exceder " + len + " caracteres!"); - return false; - } - } - - if(txtAccoes.getText() != null) - { - String accoes = txtAccoes.getText().toString(); - int len = ((Integer)meta.get("accoes")).intValue(); - System.out.println("Accoes : " + len); - if(accoes.length() > len) - { - getSessionBean1().setMsg("O campo Accões não pode exceder " + len + " caracteres!"); - return false; - } - } - - if(txtCondicoes.getText() != null) - { - String condicoes = txtCondicoes.getText().toString(); - int len = ((Integer)meta.get("condicoes")).intValue(); - System.out.println("Condicoes : " + len); - if(condicoes.length() > len) - { - getSessionBean1().setMsg("O campo Condições não pode exceder " + len + " caracteres!"); - return false; - } - } - - if(txtAveriguacaoObs.getText() != null) - { - String averiguacao_obs = txtAveriguacaoObs.getText().toString(); - int len = ((Integer)meta.get("averiguacao_obs")).intValue(); - System.out.println("Observacoes : " + len); - if(averiguacao_obs.length() > len) - { - getSessionBean1().setMsg("O campo Observações não pode exceder " + len + " caracteres!"); - return false; - } - } - } - else if(estado == Global.ESTADO_RH1) - { - if(txtBI.getText() != null) - { - String bi = (String) txtBI.getText(); - int len = ((Integer)meta_ac.get("bilhete_identidade")).intValue(); - System.out.println("BI : " + len); - if(bi.length() > len) - { - getSessionBean1().setMsg("Campo Bilhete Identidade não pode exceder " + len + " caracteres!"); - return false; - } + HashMap meta = new HashMap(); + HashMap meta_ac = new HashMap(); + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + + meta = adp.getMetaData( "analises_acidentes" ); + meta_ac = adp.getMetaData( "acidentados" ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + meta = null; + meta_ac = null; + } + + if ( meta == null || meta_ac == null ) + { + getSessionBean1().setMsg( "Erro na aquisição da metadata!" ); + return false; + } + + int estado = 0; + if ( getSessionBean1().getCurrentAnalise() == null ) //null + { + estado = Global.ESTADO_SEG; + } + else + { + AnaliseAcidente a = getSessionBean1().getCurrentAnalise(); + estado = a.getEstado().intValue(); + } + + if ( estado == Global.ESTADO_SEG ) + { + if ( txtAveriguador.getText() != null ) + { + String averiguador = txtAveriguador.getText().toString(); + int len = ( ( Integer ) meta.get( "averiguador" ) ).intValue(); + System.out.println( "Averiguador : " + len ); + if ( averiguador.length() > len ) + { + getSessionBean1().setMsg( "O campo Averiguador não pode exceder " + len + " caracteres!" ); + return false; + } + } + + if ( txtLocal.getText() != null ) + { + String local = txtLocal.getText().toString(); + int len = ( ( Integer ) meta.get( "local_trabalho" ) ).intValue(); + System.out.println( "Local : " + len ); + if ( local.length() > len ) + { + getSessionBean1().setMsg( "O campo Local não pode exceder " + len + " caracteres!" ); + return false; + } + } + + if ( txtTarefa.getText() != null ) + { + String tarefa = txtTarefa.getText().toString(); + int len = ( ( Integer ) meta.get( "tarefa" ) ).intValue(); + System.out.println( "Tarefa : " + len ); + if ( tarefa.length() > len ) + { + getSessionBean1().setMsg( "O campo Tarefa não pode exceder " + len + " caracteres!" ); + return false; + } + } + + if ( txtSubstancias.getText() != null ) + { + String substancias = txtSubstancias.getText().toString(); + int len = ( ( Integer ) meta.get( "substancias" ) ).intValue(); + System.out.println( "Substancias : " + len ); + if ( substancias.length() > len ) + { + getSessionBean1().setMsg( "O campo Substancias não pode exceder " + len + " caracteres!" ); + return false; + } + } + + if ( txtTestemunhas.getText() != null ) + { + String testemunhas = txtTestemunhas.getText().toString(); + int len = ( ( Integer ) meta.get( "testemunhas" ) ).intValue(); + System.out.println( "Testemunhas : " + len ); + if ( testemunhas.length() > len ) + { + getSessionBean1().setMsg( "O campo Testemunhas não pode exceder " + len + " caracteres!" ); + return false; + } + } + + if ( txtDescricao.getText() != null ) + { + String descricao = txtDescricao.getText().toString(); + int len = ( ( Integer ) meta.get( "descricao" ) ).intValue(); + System.out.println( "Descricao : " + len ); + if ( descricao.length() > len ) + { + getSessionBean1().setMsg( "O campo Descrição não pode exceder " + len + " caracteres!" ); + return false; + } + } + + if ( txtConclusoes.getText() != null ) + { + String conclusoes = txtConclusoes.getText().toString(); + int len = ( ( Integer ) meta.get( "conclusoes" ) ).intValue(); + System.out.println( "Conclusoes : " + len ); + if ( conclusoes.length() > len ) + { + getSessionBean1().setMsg( "O campo Conclusões não pode exceder " + len + " caracteres!" ); + return false; + } + } + + if ( txtAccoes.getText() != null ) + { + String accoes = txtAccoes.getText().toString(); + int len = ( ( Integer ) meta.get( "accoes" ) ).intValue(); + System.out.println( "Accoes : " + len ); + if ( accoes.length() > len ) + { + getSessionBean1().setMsg( "O campo Accões não pode exceder " + len + " caracteres!" ); + return false; + } + } + + if ( txtCondicoes.getText() != null ) + { + String condicoes = txtCondicoes.getText().toString(); + int len = ( ( Integer ) meta.get( "condicoes" ) ).intValue(); + System.out.println( "Condicoes : " + len ); + if ( condicoes.length() > len ) + { + getSessionBean1().setMsg( "O campo Condições não pode exceder " + len + " caracteres!" ); + return false; + } + } + + if ( txtAveriguacaoObs.getText() != null ) + { + String averiguacao_obs = txtAveriguacaoObs.getText().toString(); + int len = ( ( Integer ) meta.get( "averiguacao_obs" ) ).intValue(); + System.out.println( "Observacoes : " + len ); + if ( averiguacao_obs.length() > len ) + { + getSessionBean1().setMsg( "O campo Observações não pode exceder " + len + " caracteres!" ); + return false; + } + } + } + else if ( estado == Global.ESTADO_RH1 ) + { + if ( txtBI.getText() != null ) + { + String bi = ( String ) txtBI.getText(); + int len = ( ( Integer ) meta_ac.get( "bilhete_identidade" ) ).intValue(); + System.out.println( "BI : " + len ); + if ( bi.length() > len ) + { + getSessionBean1().setMsg( "Campo Bilhete Identidade não pode exceder " + len + " caracteres!" ); + return false; + } // try // { // int bi_nr = Integer.parseInt(bi); @@ -12262,450 +12934,450 @@ public class AnaliseAcidenteTrabalho extends AbstractPageBean { // getSessionBean1().setMsg("Nº do Bilhete de Identidade tem de ser numérico!"); // return false; // } - } - - if(txtMorada.getText() != null) - { - String morada = txtMorada.getText().toString(); - int len = ((Integer)meta_ac.get("morada")).intValue(); - System.out.println("Morada : " + len); - if(morada.length() > len) - { - getSessionBean1().setMsg("O campo Morada não pode exceder " + len + " caracteres!"); - return false; - } - } - - if(txtLocalidade.getText() != null) - { - String localidade = txtLocalidade.getText().toString(); - int len = ((Integer)meta_ac.get("localidade")).intValue(); - System.out.println("Localidade : " + len); - if(localidade.length() > len) - { - getSessionBean1().setMsg("O campo Localidade não pode exceder " + len + " caracteres!"); - return false; - } - } - - if(txtContactoTelefonico.getText() != null) - { - String contacto_telefonico = txtContactoTelefonico.getText().toString(); - int len = ((Integer)meta_ac.get("contacto_telefonico")).intValue(); - System.out.println("Contacto Telefonico : " + len); - if(contacto_telefonico.length() > len) - { - getSessionBean1().setMsg("O campo Contacto Telefónico não pode exceder " + len + " caracteres!"); - return false; - } - } - - if(txtNomeSuperior.getText() != null) - { - String nome_superior = txtNomeSuperior.getText().toString(); - int len = ((Integer)meta_ac.get("nome_superior_hierarquico")).intValue(); - System.out.println("Nome Superior : " + len); - if(nome_superior.length() > len) - { - getSessionBean1().setMsg("O campo Nome do Superior Hierárquico não pode exceder " + len + " caracteres!"); - return false; - } - } - - if(txtEmailSuperior.getText() != null) - { - String email_superior = txtEmailSuperior.getText().toString(); - int len = ((Integer)meta_ac.get("email_superior_hierarquico")).intValue(); - System.out.println("Email Superior : " + len); - if(email_superior.length() > len) - { - getSessionBean1().setMsg("O campo Email do Superior Hierárquico não pode exceder " + len + " caracteres!"); - return false; - } - } - - if(txtEmailSuperior.getText() != null) - { - String email_superior = (String) txtEmailSuperior.getText(); - if(email_superior.trim().length() > 0) - { - if(! utils.Utils.isValidEmail(email_superior)) - { - getSessionBean1().setMsg("Email do superior hierárquico inválido!"); - return false; - } - } - } - - if(txtFormacaoSHSTNWhy.getText() != null) - { - String why = txtFormacaoSHSTNWhy.getText().toString(); - int len = ((Integer)meta.get("formacao_shst_nao_porque")).intValue(); - System.out.println("Porque Nao Teve Formacao : " + len); - if(why.length() > len) - { - getSessionBean1().setMsg("O campo Porquê o Colaborador Não Teve Formação não pode exceder " + len + " caracteres!"); - return false; - } - } - } - else if(estado == Global.ESTADO_HS) - { - if(!checkRecomendacoesLen()) - { - return false; - } - } - else if(estado == Global.ESTADO_RH2) - { - if(!checkMedidasLen()) - { - return false; - } - - if(txtEspecif1.getText() != null) - { - String especif = txtEspecif1.getText().toString(); - int len = ((Integer)meta.get("especif1")).intValue(); - if(especif.length() > len) - { - getSessionBean1().setMsg("O campo Especifíque não pode exceder " + len + " caracteres!"); - return false; - } - } - - if(txtEspecif2.getText() != null) - { - String especif = txtEspecif2.getText().toString(); - int len = ((Integer)meta.get("especif2")).intValue(); - if(especif.length() > len) - { - getSessionBean1().setMsg("O campo Especifíque não pode exceder " + len + " caracteres!"); - return false; - } - } - - if(txtEspecif3.getText() != null) - { - String especif = txtEspecif3.getText().toString(); - int len = ((Integer)meta.get("especif3")).intValue(); - if(especif.length() > len) - { - getSessionBean1().setMsg("O campo Especifíque não pode exceder " + len + " caracteres!"); - return false; - } - } - - if(txtEspecif4.getText() != null) - { - String especif = txtEspecif4.getText().toString(); - int len = ((Integer)meta.get("especif4")).intValue(); - if(especif.length() > len) - { - getSessionBean1().setMsg("O campo Especifíque não pode exceder " + len + " caracteres!"); - return false; - } - } - - if(txtTipoLesao.getText() != null) - { - String tipo_lesao = txtTipoLesao.getText().toString(); - int len = ((Integer)meta.get("tipo_lesao")).intValue(); - System.out.println("Tipo Lesao : " + len); - if(tipo_lesao.length() > len) - { - getSessionBean1().setMsg("O campo Tipo Lesão não pode exceder " + len + " caracteres!"); - return false; - } - } - } - - return true; - } - - private boolean validationOk() - { - - if(getSessionBean1().isSubmetido() || getSessionBean1().isGravado()) - { - return true; - } - if(getSessionBean1().getAcidentado() == null) - { - getSessionBean1().setMsg("Não seleccionou trabalhador acidentado!"); - return false; - } - - if(!fieldsLenOk()) - { - return false; - } - - int estado = 0; - int estado_assinatura = 0; - if(getSessionBean1().getCurrentAnalise() == null) //null - { - estado = Global.ESTADO_SEG; - } - else - { - AnaliseAcidente a = getSessionBean1().getCurrentAnalise(); - estado = a.getEstado().intValue(); - estado_assinatura = a.getEstado_assinatura().intValue(); - } - - if(estado == Global.ESTADO_SEG) - { - if(txtAveriguador.getText() == null) - { - getSessionBean1().setMsg("Falta averiguador!"); - return false; - } - else - { - String averiguador = (String) txtAveriguador.getText(); - if(averiguador.trim().length() == 0) - { - getSessionBean1().setMsg("Falta averiguador!"); - return false; - } - - } - - if(drpHours.getSelected() == null || drpMinutes.getSelected() == null) - { - getSessionBean1().setMsg("Falta hora acidente!"); - return false; - } - else - { - Integer h = (Integer) drpHours.getSelected(); - Integer m = (Integer) drpMinutes.getSelected(); - if(h.intValue() == -1 || m.intValue() == -1) - { - getSessionBean1().setMsg("Falta hora acidente!"); - return false; - } - - } - - if(txtHorasTurno.getText() != null) - { - String horas_turno = txtHorasTurno.getText().toString(); - if(horas_turno.trim().length() == 0) - { - getSessionBean1().setMsg("Falta nº horas trabalhadas no turno!"); - return false; - } - else - { - 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; - } - } - } - else - { - getSessionBean1().setMsg("Falta nº horas trabalhadas no turno!"); - return false; - } - - - if(drpDepartamento.getSelected() == null) - { - getSessionBean1().setMsg("Falta departamento!"); - return false; - } - else - { - Integer d = (Integer) drpDepartamento.getSelected(); - if(d.intValue() == 0) - { - getSessionBean1().setMsg("Falta departamento!"); - return false; - } - } - - if(drpSeccao.getSelected() == null) - { - getSessionBean1().setMsg("Falta secção!"); - return false; - } - else - { - Integer s = (Integer) drpSeccao.getSelected(); - if(s.intValue() == 0) - { - getSessionBean1().setMsg("Falta secção!"); - return false; - } - } - - if(txtLocal.getText() == null) - { - getSessionBean1().setMsg("Falta local específico!"); - return false; - } - else - { - String local = (String) txtLocal.getText(); - if(local.trim().length() == 0) - { - getSessionBean1().setMsg("Falta local específico!"); - return false; - } - } - - if(txtTarefa.getText() == null) - { - getSessionBean1().setMsg("Falta tarefa!"); - return false; - } - else - { - String tarefa = (String) txtTarefa.getText(); - if(tarefa.trim().length() == 0) - { - getSessionBean1().setMsg("Falta tarefa!"); - return false; - } - } - - if(txtSubstancias.getText() == null) - { - getSessionBean1().setMsg("Falta substâncias!"); - return false; - } - else - { - String substancias = (String) txtSubstancias.getText(); - if(substancias.trim().length() == 0) - { - getSessionBean1().setMsg("Falta substâncias!"); - return false; - } - } - - if(txtCondicoes.getText() == null) - { - getSessionBean1().setMsg("Falta condições!"); - return false; - } - else - { - String condicoes = (String) txtCondicoes.getText(); - if(condicoes.trim().length() == 0) - { - getSessionBean1().setMsg("Falta condições!"); - return false; - } - } - - if(txtTestemunhas.getText() == null) - { - getSessionBean1().setMsg("Falta testemunhas!"); - return false; - } - else - { - String testemunhas = (String) txtTestemunhas.getText(); - if(testemunhas.trim().length() == 0) - { - getSessionBean1().setMsg("Falta testemunhas!"); - return false; - } - } - - if(drpCausas.getSelected() == null) - { - getSessionBean1().setMsg("Falta causa do acidente!"); - return false; - } - else - { - Integer c = (Integer) drpCausas.getSelected(); - if(c.intValue() == 0) - { - getSessionBean1().setMsg("Falta causa do acidente!"); - return false; - } - } - - if(txtDescricao.getText() == null) - { - getSessionBean1().setMsg("Falta descrição do acidente!"); - return false; - } - else - { - String descricao = (String) txtDescricao.getText(); - if(descricao.trim().length() == 0) - { - getSessionBean1().setMsg("Falta descrição do acidente!"); - return false; - } - } - - if(txtConclusoes.getText() == null) - { - getSessionBean1().setMsg("Falta conclusões!"); - return false; - } - else - { - String conclusoes = (String) txtConclusoes.getText(); - if(conclusoes.trim().length() == 0) - { - getSessionBean1().setMsg("Falta conclusões!"); - return false; - } - } - - if(txtAccoes.getText() == null) - { - getSessionBean1().setMsg("Falta acções!"); - return false; - } - else - { - String accoes = (String) txtAccoes.getText(); - if(accoes.trim().length() == 0) - { - getSessionBean1().setMsg("Falta acções!"); - return false; - } - } - - } - - - if(estado == Global.ESTADO_RH1) - { - - if(txtBI.getText() == null) - { - getSessionBean1().setMsg("Falta Nº Bilhete de Identidade!"); - return false; - } - else - { - String bi = (String) txtBI.getText(); - if(bi.trim().length() == 0) - { - getSessionBean1().setMsg("Falta Nº Bilhete de Identidade!"); - return false; - } + } + + if ( txtMorada.getText() != null ) + { + String morada = txtMorada.getText().toString(); + int len = ( ( Integer ) meta_ac.get( "morada" ) ).intValue(); + System.out.println( "Morada : " + len ); + if ( morada.length() > len ) + { + getSessionBean1().setMsg( "O campo Morada não pode exceder " + len + " caracteres!" ); + return false; + } + } + + if ( txtLocalidade.getText() != null ) + { + String localidade = txtLocalidade.getText().toString(); + int len = ( ( Integer ) meta_ac.get( "localidade" ) ).intValue(); + System.out.println( "Localidade : " + len ); + if ( localidade.length() > len ) + { + getSessionBean1().setMsg( "O campo Localidade não pode exceder " + len + " caracteres!" ); + return false; + } + } + + if ( txtContactoTelefonico.getText() != null ) + { + String contacto_telefonico = txtContactoTelefonico.getText().toString(); + int len = ( ( Integer ) meta_ac.get( "contacto_telefonico" ) ).intValue(); + System.out.println( "Contacto Telefonico : " + len ); + if ( contacto_telefonico.length() > len ) + { + getSessionBean1().setMsg( "O campo Contacto Telefónico não pode exceder " + len + " caracteres!" ); + return false; + } + } + + if ( txtNomeSuperior.getText() != null ) + { + String nome_superior = txtNomeSuperior.getText().toString(); + int len = ( ( Integer ) meta_ac.get( "nome_superior_hierarquico" ) ).intValue(); + System.out.println( "Nome Superior : " + len ); + if ( nome_superior.length() > len ) + { + getSessionBean1().setMsg( "O campo Nome do Superior Hierárquico não pode exceder " + len + " caracteres!" ); + return false; + } + } + + if ( txtEmailSuperior.getText() != null ) + { + String email_superior = txtEmailSuperior.getText().toString(); + int len = ( ( Integer ) meta_ac.get( "email_superior_hierarquico" ) ).intValue(); + System.out.println( "Email Superior : " + len ); + if ( email_superior.length() > len ) + { + getSessionBean1().setMsg( "O campo Email do Superior Hierárquico não pode exceder " + len + " caracteres!" ); + return false; + } + } + + if ( txtEmailSuperior.getText() != null ) + { + String email_superior = ( String ) txtEmailSuperior.getText(); + if ( email_superior.trim().length() > 0 ) + { + if ( !utils.Utils.isValidEmail( email_superior ) ) + { + getSessionBean1().setMsg( "Email do superior hierárquico inválido!" ); + return false; + } + } + } + + if ( txtFormacaoSHSTNWhy.getText() != null ) + { + String why = txtFormacaoSHSTNWhy.getText().toString(); + int len = ( ( Integer ) meta.get( "formacao_shst_nao_porque" ) ).intValue(); + System.out.println( "Porque Nao Teve Formacao : " + len ); + if ( why.length() > len ) + { + getSessionBean1().setMsg( "O campo Porquê o Colaborador Não Teve Formação não pode exceder " + len + " caracteres!" ); + return false; + } + } + } + else if ( estado == Global.ESTADO_HS ) + { + if ( !checkRecomendacoesLen() ) + { + return false; + } + } + else if ( estado == Global.ESTADO_RH2 ) + { + if ( !checkMedidasLen() ) + { + return false; + } + + if ( txtEspecif1.getText() != null ) + { + String especif = txtEspecif1.getText().toString(); + int len = ( ( Integer ) meta.get( "especif1" ) ).intValue(); + if ( especif.length() > len ) + { + getSessionBean1().setMsg( "O campo Especifíque não pode exceder " + len + " caracteres!" ); + return false; + } + } + + if ( txtEspecif2.getText() != null ) + { + String especif = txtEspecif2.getText().toString(); + int len = ( ( Integer ) meta.get( "especif2" ) ).intValue(); + if ( especif.length() > len ) + { + getSessionBean1().setMsg( "O campo Especifíque não pode exceder " + len + " caracteres!" ); + return false; + } + } + + if ( txtEspecif3.getText() != null ) + { + String especif = txtEspecif3.getText().toString(); + int len = ( ( Integer ) meta.get( "especif3" ) ).intValue(); + if ( especif.length() > len ) + { + getSessionBean1().setMsg( "O campo Especifíque não pode exceder " + len + " caracteres!" ); + return false; + } + } + + if ( txtEspecif4.getText() != null ) + { + String especif = txtEspecif4.getText().toString(); + int len = ( ( Integer ) meta.get( "especif4" ) ).intValue(); + if ( especif.length() > len ) + { + getSessionBean1().setMsg( "O campo Especifíque não pode exceder " + len + " caracteres!" ); + return false; + } + } + + if ( txtTipoLesao.getText() != null ) + { + String tipo_lesao = txtTipoLesao.getText().toString(); + int len = ( ( Integer ) meta.get( "tipo_lesao" ) ).intValue(); + System.out.println( "Tipo Lesao : " + len ); + if ( tipo_lesao.length() > len ) + { + getSessionBean1().setMsg( "O campo Tipo Lesão não pode exceder " + len + " caracteres!" ); + return false; + } + } + } + + return true; + } + + private boolean validationOk() + { + + if ( getSessionBean1().isSubmetido() || getSessionBean1().isGravado() ) + { + return true; + } + if ( getSessionBean1().getAcidentado() == null ) + { + getSessionBean1().setMsg( "Não seleccionou trabalhador acidentado!" ); + return false; + } + + if ( !fieldsLenOk() ) + { + return false; + } + + int estado = 0; + int estado_assinatura = 0; + if ( getSessionBean1().getCurrentAnalise() == null ) //null + { + estado = Global.ESTADO_SEG; + } + else + { + AnaliseAcidente a = getSessionBean1().getCurrentAnalise(); + estado = a.getEstado().intValue(); + estado_assinatura = a.getEstado_assinatura().intValue(); + } + + if ( estado == Global.ESTADO_SEG ) + { + if ( txtAveriguador.getText() == null ) + { + getSessionBean1().setMsg( "Falta averiguador!" ); + return false; + } + else + { + String averiguador = ( String ) txtAveriguador.getText(); + if ( averiguador.trim().length() == 0 ) + { + getSessionBean1().setMsg( "Falta averiguador!" ); + return false; + } + + } + + if ( drpHours.getSelected() == null || drpMinutes.getSelected() == null ) + { + getSessionBean1().setMsg( "Falta hora acidente!" ); + return false; + } + else + { + Integer h = ( Integer ) drpHours.getSelected(); + Integer m = ( Integer ) drpMinutes.getSelected(); + if ( h.intValue() == -1 || m.intValue() == -1 ) + { + getSessionBean1().setMsg( "Falta hora acidente!" ); + return false; + } + + } + + if ( txtHorasTurno.getText() != null ) + { + String horas_turno = txtHorasTurno.getText().toString(); + if ( horas_turno.trim().length() == 0 ) + { + getSessionBean1().setMsg( "Falta nº horas trabalhadas no turno!" ); + return false; + } + else + { + 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; + } + } + } + else + { + getSessionBean1().setMsg( "Falta nº horas trabalhadas no turno!" ); + return false; + } + + + if ( drpDepartamento.getSelected() == null ) + { + getSessionBean1().setMsg( "Falta departamento!" ); + return false; + } + else + { + Integer d = ( Integer ) drpDepartamento.getSelected(); + if ( d.intValue() == 0 ) + { + getSessionBean1().setMsg( "Falta departamento!" ); + return false; + } + } + + if ( drpSeccao.getSelected() == null ) + { + getSessionBean1().setMsg( "Falta secção!" ); + return false; + } + else + { + Integer s = ( Integer ) drpSeccao.getSelected(); + if ( s.intValue() == 0 ) + { + getSessionBean1().setMsg( "Falta secção!" ); + return false; + } + } + + if ( txtLocal.getText() == null ) + { + getSessionBean1().setMsg( "Falta local específico!" ); + return false; + } + else + { + String local = ( String ) txtLocal.getText(); + if ( local.trim().length() == 0 ) + { + getSessionBean1().setMsg( "Falta local específico!" ); + return false; + } + } + + if ( txtTarefa.getText() == null ) + { + getSessionBean1().setMsg( "Falta tarefa!" ); + return false; + } + else + { + String tarefa = ( String ) txtTarefa.getText(); + if ( tarefa.trim().length() == 0 ) + { + getSessionBean1().setMsg( "Falta tarefa!" ); + return false; + } + } + + if ( txtSubstancias.getText() == null ) + { + getSessionBean1().setMsg( "Falta substâncias!" ); + return false; + } + else + { + String substancias = ( String ) txtSubstancias.getText(); + if ( substancias.trim().length() == 0 ) + { + getSessionBean1().setMsg( "Falta substâncias!" ); + return false; + } + } + + if ( txtCondicoes.getText() == null ) + { + getSessionBean1().setMsg( "Falta condições!" ); + return false; + } + else + { + String condicoes = ( String ) txtCondicoes.getText(); + if ( condicoes.trim().length() == 0 ) + { + getSessionBean1().setMsg( "Falta condições!" ); + return false; + } + } + + if ( txtTestemunhas.getText() == null ) + { + getSessionBean1().setMsg( "Falta testemunhas!" ); + return false; + } + else + { + String testemunhas = ( String ) txtTestemunhas.getText(); + if ( testemunhas.trim().length() == 0 ) + { + getSessionBean1().setMsg( "Falta testemunhas!" ); + return false; + } + } + + if ( drpCausas.getSelected() == null ) + { + getSessionBean1().setMsg( "Falta causa do acidente!" ); + return false; + } + else + { + Integer c = ( Integer ) drpCausas.getSelected(); + if ( c.intValue() == 0 ) + { + getSessionBean1().setMsg( "Falta causa do acidente!" ); + return false; + } + } + + if ( txtDescricao.getText() == null ) + { + getSessionBean1().setMsg( "Falta descrição do acidente!" ); + return false; + } + else + { + String descricao = ( String ) txtDescricao.getText(); + if ( descricao.trim().length() == 0 ) + { + getSessionBean1().setMsg( "Falta descrição do acidente!" ); + return false; + } + } + + if ( txtConclusoes.getText() == null ) + { + getSessionBean1().setMsg( "Falta conclusões!" ); + return false; + } + else + { + String conclusoes = ( String ) txtConclusoes.getText(); + if ( conclusoes.trim().length() == 0 ) + { + getSessionBean1().setMsg( "Falta conclusões!" ); + return false; + } + } + + if ( txtAccoes.getText() == null ) + { + getSessionBean1().setMsg( "Falta acções!" ); + return false; + } + else + { + String accoes = ( String ) txtAccoes.getText(); + if ( accoes.trim().length() == 0 ) + { + getSessionBean1().setMsg( "Falta acções!" ); + return false; + } + } + + } + + + if ( estado == Global.ESTADO_RH1 ) + { + + if ( txtBI.getText() == null ) + { + getSessionBean1().setMsg( "Falta Nº Bilhete de Identidade!" ); + return false; + } + else + { + String bi = ( String ) txtBI.getText(); + if ( bi.trim().length() == 0 ) + { + getSessionBean1().setMsg( "Falta Nº Bilhete de Identidade!" ); + return false; + } // else // { // try @@ -12718,665 +13390,661 @@ public class AnaliseAcidenteTrabalho extends AbstractPageBean { // return false; // } // } - } - - if(txtMorada.getText() == null) - { - getSessionBean1().setMsg("Falta morada!"); - return false; - } - else - { - String morada = (String) txtMorada.getText(); - if(morada.trim().length() == 0) - { - getSessionBean1().setMsg("Falta morada!"); - return false; - } - } - - String cod_postal1 = ""; - String cod_postal2 = ""; - if(txtCodPostal1.getText() == null || txtCodPostal2.getText() == null) - { - getSessionBean1().setMsg("Falta código postal!"); - return false; - } - else - { - cod_postal1 = (String) txtCodPostal1.getText(); - cod_postal2 = (String) txtCodPostal2.getText(); - - if(cod_postal1.trim().length() == 0 || cod_postal2.trim().length() == 0) - { - getSessionBean1().setMsg("Falta código postal!"); - return false; - } - } - - if(txtCodPostal1.getText() != null) - { - 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) - { - 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(txtLocalidade.getText() == null) - { - getSessionBean1().setMsg("Falta localidade!"); - return false; - } - else - { - String localidade = (String) txtLocalidade.getText(); - if(localidade.trim().length() == 0) - { - getSessionBean1().setMsg("Falta localidade!"); - return false; - } - } - - if(txtContactoTelefonico.getText() == null) - { - getSessionBean1().setMsg("Falta contacto telefónico!"); - return false; - } - else - { - String contacto_telefonico = (String) txtContactoTelefonico.getText(); - if(contacto_telefonico.trim().length() == 0) - { - getSessionBean1().setMsg("Falta contacto telefónico!"); - return false; - } - } - - if(rbTurnoManha.getSelected() == null && rbTurnoTarde.getSelected() == null && rbTurnoNoite.getSelected() == null ) - { - getSessionBean1().setMsg("Falta turno de trabalho!"); - return false; - } - - if(txtNomeSuperior.getText() == null) - { - getSessionBean1().setMsg("Falta nome do superior hierárquico!"); - return false; - } - else - { - String nome_superior = (String) txtNomeSuperior.getText(); - if(nome_superior.trim().length() == 0) - { - getSessionBean1().setMsg("Falta nome do superior hierárquico!"); - return false; - } - } - - if(txtEmailSuperior.getText() != null) - { - String email_superior = (String) txtEmailSuperior.getText(); - if(email_superior.trim().length() > 0) - { - if(! utils.Utils.isValidEmail(email_superior)) - { - getSessionBean1().setMsg("Email do superior hierárquico inválido!"); - return false; - } - } - else - { - getSessionBean1().setMsg("Falta email do superior hierárquico!"); - return false; - } - } - else - { - getSessionBean1().setMsg("Falta email do superior hierárquico!"); - return false; - } - } - - if(estado == Global.ESTADO_RH1) - { - - if(rbFormacaoSHSTY.getSelected() == null && rbFormacaoSHSTN.getSelected() == null) - { - getSessionBean1().setMsg("Falta indicar se o colaborador teve formação em SHST!"); - return false; - } - else - { - if(rbFormacaoSHSTY.getSelected() != null) - { - if(rbFormacaoSHSTY.getSelected().equals(new Boolean(false))) - { - if(rbFormacaoSHSTN.getSelected() != null) - { - if(rbFormacaoSHSTN.getSelected().equals(new Boolean(false))) - { - getSessionBean1().setMsg("Falta indicar se o colaborador teve formação em SHST!"); - return false; - } - } - } - } - } - - if(rbFormacaoSHSTN.getSelected() != null) - { - if(rbFormacaoSHSTN.getSelected().equals(new Boolean(true))) - { - if(txtFormacaoSHSTNWhy.getText() == null) - { - getSessionBean1().setMsg("Falta indicar a razão porque o colaborador não teve formação em SHST!"); - return false; - } - else - { - String why = (String) txtFormacaoSHSTNWhy.getText(); - if(why.trim().length() == 0) - { - getSessionBean1().setMsg("Falta indicar a razão porque o colaborador não teve formação em SHST!"); - return false; - } - } - } - - } - - if(rbAcidentesColaboradorY.getSelected() == null && rbAcidentesColaboradorN.getSelected() == null) - { - getSessionBean1().setMsg("Falta indicar se o colaborador teve outras ocorrências, ou não!"); - return false; - } - else - { - if(rbAcidentesColaboradorY.getSelected() != null) - { - if(rbAcidentesColaboradorY.getSelected().equals(new Boolean(false))) - { - if(rbAcidentesColaboradorN.getSelected() != null) - { - if(rbAcidentesColaboradorN.getSelected().equals(new Boolean(false))) - { - getSessionBean1().setMsg("Falta indicar se o colaborador teve outras ocorrências, ou não!"); - return false; - } - } - } - } - } - - if(rbAcidentesColaboradorY.getSelected() != null) - { - - if(rbAcidentesColaboradorY.getSelected().equals(new Boolean(true))) - { - if(txtNrAcidentesColaborador.getText() != null) - { - String nr_str = txtNrAcidentesColaborador.getText().toString(); - if(nr_str.trim().length() > 0) - { - try - { - int nr = Integer.parseInt(nr_str); - } - catch(Exception ex) - { - getSessionBean1().setMsg("O º de acidentes do colaborador deve ser um valor numérico!"); - return false; - } - } - else - { - getSessionBean1().setMsg("Falta indicar o º de ocorrências do colaborador!"); - return false; - } - } - else - { - getSessionBean1().setMsg("Falta indicar o º de ocorrências do colaborador!"); - return false; - } - - if( - txtNrRelatorioAcidentesColaborador1.getText() == null && - txtNrRelatorioAcidentesColaborador2.getText() == null && - txtNrRelatorioAcidentesColaborador3.getText() == null && - txtNrRelatorioAcidentesColaborador1.getText() == null - ) - { - getSessionBean1().setMsg("Falta indicar o(s) º(s) do(s) relatório(s) de acidente do colaborador!"); - return false; - } - else - { - String nr_relatorio1 = ""; - String nr_relatorio2 = ""; - String nr_relatorio3 = ""; - String nr_relatorio4 = ""; - if(txtNrRelatorioAcidentesColaborador1.getText() != null) - { - nr_relatorio1 = (String) txtNrRelatorioAcidentesColaborador1.getText(); - } - if(txtNrRelatorioAcidentesColaborador2.getText() != null) - { - nr_relatorio2 = (String) txtNrRelatorioAcidentesColaborador2.getText(); - } - if(txtNrRelatorioAcidentesColaborador3.getText() != null) - { - nr_relatorio3 = (String) txtNrRelatorioAcidentesColaborador3.getText(); - } - if(txtNrRelatorioAcidentesColaborador4.getText() != null) - { - nr_relatorio4 = (String) txtNrRelatorioAcidentesColaborador4.getText(); - } - - if(nr_relatorio1.trim().length() == 0 && nr_relatorio2.trim().length() == 0 && nr_relatorio3.trim().length() == 0 && nr_relatorio4.trim().length() == 0) - { - getSessionBean1().setMsg("Falta indicar o(s) º(s) do(s) relatório(s) de acidente do colaborador!"); - return false; - } - } - }// - - } - - - - if(rbAcidentesColaboradoresY.getSelected() == null && rbAcidentesColaboradoresN.getSelected() == null) - { - getSessionBean1().setMsg("Falta indicar se houve outras ocorrências com outros colaboradores!"); - return false; - } - else - { - if(rbAcidentesColaboradoresY.getSelected() != null) - { - if(rbAcidentesColaboradoresY.getSelected().equals(new Boolean(false))) - { - if(rbAcidentesColaboradoresN.getSelected() != null) - { - if(rbAcidentesColaboradoresN.getSelected().equals(new Boolean(false))) - { - getSessionBean1().setMsg("Falta indicar se houve outras ocorrências com outros colaboradores!"); - return false; - } - } - } - } - } - - if(rbAcidentesColaboradoresY.getSelected() != null) - { - - if(rbAcidentesColaboradoresY.getSelected().equals(new Boolean(true))) - { - if(txtNrAcidentesColaboradores.getText() != null) - { - String nr_str = txtNrAcidentesColaboradores.getText().toString(); - if(nr_str.trim().length() > 0) - { - try - { - int nr = Integer.parseInt(nr_str); - } - catch(Exception ex) - { - getSessionBean1().setMsg("O º de acidentes dos colaboradores deve ser um valor numérico!"); - return false; - } - } - else - { - getSessionBean1().setMsg("Falta indicar o º de ocorrências com outros colaboradores!"); - return false; - } - } - else - { - getSessionBean1().setMsg("Falta indicar o º de ocorrências com outros colaboradores!"); - return false; - } - - if( - txtNrRelatorioAcidentesColaboradores1.getText() == null && - txtNrRelatorioAcidentesColaboradores2.getText() == null && - txtNrRelatorioAcidentesColaboradores3.getText() == null && - txtNrRelatorioAcidentesColaboradores1.getText() == null - ) - { - getSessionBean1().setMsg("Falta indicar o(s) º(s) do(s) relatório(s) de acidente com outros colaboradores!"); - return false; - } - else - { - String nr_relatorio1 = ""; - String nr_relatorio2 = ""; - String nr_relatorio3 = ""; - String nr_relatorio4 = ""; - if(txtNrRelatorioAcidentesColaboradores1.getText() != null) - { - nr_relatorio1 = (String) txtNrRelatorioAcidentesColaboradores1.getText(); - } - if(txtNrRelatorioAcidentesColaboradores2.getText() != null) - { - nr_relatorio2 = (String) txtNrRelatorioAcidentesColaboradores2.getText(); - } - if(txtNrRelatorioAcidentesColaboradores3.getText() != null) - { - nr_relatorio3 = (String) txtNrRelatorioAcidentesColaboradores3.getText(); - } - if(txtNrRelatorioAcidentesColaboradores4.getText() != null) - { - nr_relatorio4 = (String) txtNrRelatorioAcidentesColaboradores4.getText(); - } - - if(nr_relatorio1.trim().length() == 0 && nr_relatorio2.trim().length() == 0 && nr_relatorio3.trim().length() == 0 && nr_relatorio4.trim().length() == 0) - { - getSessionBean1().setMsg("Falta indicar o(s) º(s) do(s) relatório(s) de acidente com outros colaboradores!"); - return false; - } - } - }// - - } - - } - } - else if(estado == Global.ESTADO_HS) //recomendacoes - { - if(isRecomendacoesEmpty()) - { - getSessionBean1().setMsg("Tem de preencher pelo menos uma recomendação!"); - return false; - } - } - else if(estado == Global.ESTADO_RH2) //medidas - { - if(isMedidasEmpty()) - { - getSessionBean1().setMsg("Tem de preencher pelo menos uma medida!"); - return false; - } + } + + if ( txtMorada.getText() == null ) + { + getSessionBean1().setMsg( "Falta morada!" ); + return false; + } + else + { + String morada = ( String ) txtMorada.getText(); + if ( morada.trim().length() == 0 ) + { + getSessionBean1().setMsg( "Falta morada!" ); + return false; + } + } + + String cod_postal1 = ""; + String cod_postal2 = ""; + if ( txtCodPostal1.getText() == null || txtCodPostal2.getText() == null ) + { + getSessionBean1().setMsg( "Falta código postal!" ); + return false; + } + else + { + cod_postal1 = ( String ) txtCodPostal1.getText(); + cod_postal2 = ( String ) txtCodPostal2.getText(); + + if ( cod_postal1.trim().length() == 0 || cod_postal2.trim().length() == 0 ) + { + getSessionBean1().setMsg( "Falta código postal!" ); + return false; + } + } + + if ( txtCodPostal1.getText() != null ) + { + 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 ) + { + 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 ( txtLocalidade.getText() == null ) + { + getSessionBean1().setMsg( "Falta localidade!" ); + return false; + } + else + { + String localidade = ( String ) txtLocalidade.getText(); + if ( localidade.trim().length() == 0 ) + { + getSessionBean1().setMsg( "Falta localidade!" ); + return false; + } + } + + if ( txtContactoTelefonico.getText() == null ) + { + getSessionBean1().setMsg( "Falta contacto telefónico!" ); + return false; + } + else + { + String contacto_telefonico = ( String ) txtContactoTelefonico.getText(); + if ( contacto_telefonico.trim().length() == 0 ) + { + getSessionBean1().setMsg( "Falta contacto telefónico!" ); + return false; + } + } + + if ( rbTurnoManha.getSelected() == null && rbTurnoTarde.getSelected() == null && rbTurnoNoite.getSelected() == null ) + { + getSessionBean1().setMsg( "Falta turno de trabalho!" ); + return false; + } + + if ( txtNomeSuperior.getText() == null ) + { + getSessionBean1().setMsg( "Falta nome do superior hierárquico!" ); + return false; + } + else + { + String nome_superior = ( String ) txtNomeSuperior.getText(); + if ( nome_superior.trim().length() == 0 ) + { + getSessionBean1().setMsg( "Falta nome do superior hierárquico!" ); + return false; + } + } + + if ( txtEmailSuperior.getText() != null ) + { + String email_superior = ( String ) txtEmailSuperior.getText(); + if ( email_superior.trim().length() > 0 ) + { + if ( !utils.Utils.isValidEmail( email_superior ) ) + { + getSessionBean1().setMsg( "Email do superior hierárquico inválido!" ); + return false; + } + } + else + { + getSessionBean1().setMsg( "Falta email do superior hierárquico!" ); + return false; + } + } + else + { + getSessionBean1().setMsg( "Falta email do superior hierárquico!" ); + return false; + } + } + + if ( estado == Global.ESTADO_RH1 ) + { + + if ( rbFormacaoSHSTY.getSelected() == null && rbFormacaoSHSTN.getSelected() == null ) + { + getSessionBean1().setMsg( "Falta indicar se o colaborador teve formação em SHST!" ); + return false; + } + else + { + if ( rbFormacaoSHSTY.getSelected() != null ) + { + if ( rbFormacaoSHSTY.getSelected().equals( new Boolean( false ) ) ) + { + if ( rbFormacaoSHSTN.getSelected() != null ) + { + if ( rbFormacaoSHSTN.getSelected().equals( new Boolean( false ) ) ) + { + getSessionBean1().setMsg( "Falta indicar se o colaborador teve formação em SHST!" ); + return false; + } + } + } + } + } + + if ( rbFormacaoSHSTN.getSelected() != null ) + { + if ( rbFormacaoSHSTN.getSelected().equals( new Boolean( true ) ) ) + { + if ( txtFormacaoSHSTNWhy.getText() == null ) + { + getSessionBean1().setMsg( "Falta indicar a razão porque o colaborador não teve formação em SHST!" ); + return false; + } + else + { + String why = ( String ) txtFormacaoSHSTNWhy.getText(); + if ( why.trim().length() == 0 ) + { + getSessionBean1().setMsg( "Falta indicar a razão porque o colaborador não teve formação em SHST!" ); + return false; + } + } + } + + } + + if ( rbAcidentesColaboradorY.getSelected() == null && rbAcidentesColaboradorN.getSelected() == null ) + { + getSessionBean1().setMsg( "Falta indicar se o colaborador teve outras ocorrências, ou não!" ); + return false; + } + else + { + if ( rbAcidentesColaboradorY.getSelected() != null ) + { + if ( rbAcidentesColaboradorY.getSelected().equals( new Boolean( false ) ) ) + { + if ( rbAcidentesColaboradorN.getSelected() != null ) + { + if ( rbAcidentesColaboradorN.getSelected().equals( new Boolean( false ) ) ) + { + getSessionBean1().setMsg( "Falta indicar se o colaborador teve outras ocorrências, ou não!" ); + return false; + } + } + } + } + } + + if ( rbAcidentesColaboradorY.getSelected() != null ) + { + + if ( rbAcidentesColaboradorY.getSelected().equals( new Boolean( true ) ) ) + { + if ( txtNrAcidentesColaborador.getText() != null ) + { + String nr_str = txtNrAcidentesColaborador.getText().toString(); + if ( nr_str.trim().length() > 0 ) + { + try + { + int nr = Integer.parseInt( nr_str ); + } + catch ( Exception ex ) + { + getSessionBean1().setMsg( "O º de acidentes do colaborador deve ser um valor numérico!" ); + return false; + } + } + else + { + getSessionBean1().setMsg( "Falta indicar o º de ocorrências do colaborador!" ); + return false; + } + } + else + { + getSessionBean1().setMsg( "Falta indicar o º de ocorrências do colaborador!" ); + return false; + } + + if ( txtNrRelatorioAcidentesColaborador1.getText() == null && + txtNrRelatorioAcidentesColaborador2.getText() == null && + txtNrRelatorioAcidentesColaborador3.getText() == null && + txtNrRelatorioAcidentesColaborador1.getText() == null ) + { + getSessionBean1().setMsg( "Falta indicar o(s) º(s) do(s) relatório(s) de acidente do colaborador!" ); + return false; + } + else + { + String nr_relatorio1 = ""; + String nr_relatorio2 = ""; + String nr_relatorio3 = ""; + String nr_relatorio4 = ""; + if ( txtNrRelatorioAcidentesColaborador1.getText() != null ) + { + nr_relatorio1 = ( String ) txtNrRelatorioAcidentesColaborador1.getText(); + } + if ( txtNrRelatorioAcidentesColaborador2.getText() != null ) + { + nr_relatorio2 = ( String ) txtNrRelatorioAcidentesColaborador2.getText(); + } + if ( txtNrRelatorioAcidentesColaborador3.getText() != null ) + { + nr_relatorio3 = ( String ) txtNrRelatorioAcidentesColaborador3.getText(); + } + if ( txtNrRelatorioAcidentesColaborador4.getText() != null ) + { + nr_relatorio4 = ( String ) txtNrRelatorioAcidentesColaborador4.getText(); + } + + if ( nr_relatorio1.trim().length() == 0 && nr_relatorio2.trim().length() == 0 && nr_relatorio3.trim().length() == 0 && nr_relatorio4.trim().length() == 0 ) + { + getSessionBean1().setMsg( "Falta indicar o(s) º(s) do(s) relatório(s) de acidente do colaborador!" ); + return false; + } + } + }// + + } + + + + if ( rbAcidentesColaboradoresY.getSelected() == null && rbAcidentesColaboradoresN.getSelected() == null ) + { + getSessionBean1().setMsg( "Falta indicar se houve outras ocorrências com outros colaboradores!" ); + return false; + } + else + { + if ( rbAcidentesColaboradoresY.getSelected() != null ) + { + if ( rbAcidentesColaboradoresY.getSelected().equals( new Boolean( false ) ) ) + { + if ( rbAcidentesColaboradoresN.getSelected() != null ) + { + if ( rbAcidentesColaboradoresN.getSelected().equals( new Boolean( false ) ) ) + { + getSessionBean1().setMsg( "Falta indicar se houve outras ocorrências com outros colaboradores!" ); + return false; + } + } + } + } + } + + if ( rbAcidentesColaboradoresY.getSelected() != null ) + { + + if ( rbAcidentesColaboradoresY.getSelected().equals( new Boolean( true ) ) ) + { + if ( txtNrAcidentesColaboradores.getText() != null ) + { + String nr_str = txtNrAcidentesColaboradores.getText().toString(); + if ( nr_str.trim().length() > 0 ) + { + try + { + int nr = Integer.parseInt( nr_str ); + } + catch ( Exception ex ) + { + getSessionBean1().setMsg( "O º de acidentes dos colaboradores deve ser um valor numérico!" ); + return false; + } + } + else + { + getSessionBean1().setMsg( "Falta indicar o º de ocorrências com outros colaboradores!" ); + return false; + } + } + else + { + getSessionBean1().setMsg( "Falta indicar o º de ocorrências com outros colaboradores!" ); + return false; + } + + if ( txtNrRelatorioAcidentesColaboradores1.getText() == null && + txtNrRelatorioAcidentesColaboradores2.getText() == null && + txtNrRelatorioAcidentesColaboradores3.getText() == null && + txtNrRelatorioAcidentesColaboradores1.getText() == null ) + { + getSessionBean1().setMsg( "Falta indicar o(s) º(s) do(s) relatório(s) de acidente com outros colaboradores!" ); + return false; + } + else + { + String nr_relatorio1 = ""; + String nr_relatorio2 = ""; + String nr_relatorio3 = ""; + String nr_relatorio4 = ""; + if ( txtNrRelatorioAcidentesColaboradores1.getText() != null ) + { + nr_relatorio1 = ( String ) txtNrRelatorioAcidentesColaboradores1.getText(); + } + if ( txtNrRelatorioAcidentesColaboradores2.getText() != null ) + { + nr_relatorio2 = ( String ) txtNrRelatorioAcidentesColaboradores2.getText(); + } + if ( txtNrRelatorioAcidentesColaboradores3.getText() != null ) + { + nr_relatorio3 = ( String ) txtNrRelatorioAcidentesColaboradores3.getText(); + } + if ( txtNrRelatorioAcidentesColaboradores4.getText() != null ) + { + nr_relatorio4 = ( String ) txtNrRelatorioAcidentesColaboradores4.getText(); + } + + if ( nr_relatorio1.trim().length() == 0 && nr_relatorio2.trim().length() == 0 && nr_relatorio3.trim().length() == 0 && nr_relatorio4.trim().length() == 0 ) + { + getSessionBean1().setMsg( "Falta indicar o(s) º(s) do(s) relatório(s) de acidente com outros colaboradores!" ); + return false; + } + } + }// + + } + + } + } + else if ( estado == Global.ESTADO_HS ) //recomendacoes + { + if ( isRecomendacoesEmpty() ) + { + getSessionBean1().setMsg( "Tem de preencher pelo menos uma recomendação!" ); + return false; + } + } + else if ( estado == Global.ESTADO_RH2 ) //medidas + { + if ( isMedidasEmpty() ) + { + getSessionBean1().setMsg( "Tem de preencher pelo menos uma medida!" ); + return false; + } // } // //else if(estado == Global.ESTADO_MEDICINA) // else if(estado == Global.ESTADO_RH2) // { - if(rbIncapacidadeNone.getSelected() == null && rbIncapacidadeTemp.getSelected() == null && rbIncapacidadePerm.getSelected() == null) - { - getSessionBean1().setMsg("Falta indicar o tipo de incapacidade!"); - return false; - } - else - { - if(rbIncapacidadeNone.getSelected() != null) - { - if(rbIncapacidadeNone.getSelected().equals(new Boolean(false))) - { - if(rbIncapacidadeTemp.getSelected() != null) - { - if(rbIncapacidadeTemp.getSelected().equals(new Boolean(false))) - { - if(rbIncapacidadePerm.getSelected() != null) - { - if(rbIncapacidadePerm.getSelected().equals(new Boolean(false))) - { - getSessionBean1().setMsg("Falta indicar o tipo de incapacidade!"); - return false; - } - } - } - } - } - } - } - - if(txtCoefIncapacidade.getText() != null) - { - String coef_str = txtCoefIncapacidade.getText().toString(); - if(coef_str.trim().length() > 0) - { - try - { - int nr = Integer.parseInt(coef_str); - } - catch(Exception ex) - { - getSessionBean1().setMsg("O coeficiente de incapacidade deve ser um valor numérico!"); - return false; - } - } - else - { - getSessionBean1().setMsg("Falta coeficiente de incapacidade!"); - return false; - } - } - else - { - getSessionBean1().setMsg("Falta coeficiente de incapacidade!"); - 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; - } - } - } - } - } - else if(estado == Global.ESTADO_CONSOLIDACAO) - { - if(chkVerHs.getSelected() == null) - { - getSessionBean1().setMsg("Falta assinatura!"); - return false; - } - else if(chkVerHs.getSelected().equals(new Boolean(false))) - { - getSessionBean1().setMsg("Falta assinatura!"); - return false; - } - } - else if(estado == Global.ESTADO_ASSINATURA_SEG) - { - if(chkVerRespSeg.getSelected() == null) - { - getSessionBean1().setMsg("Falta assinatura!"); - return false; - } - else if(chkVerRespSeg.getSelected().equals(new Boolean(false))) - { - getSessionBean1().setMsg("Falta assinatura!"); - return false; - } - } - else if(estado == Global.ESTADO_ASSINATURA_RH) - { - if(chkVerRespRh.getSelected() == null) - { - getSessionBean1().setMsg("Falta assinatura!"); - return false; - } - else if(chkVerRespRh.getSelected().equals(new Boolean(false))) - { - getSessionBean1().setMsg("Falta assinatura!"); - return false; - } - } - - - return true; - } - - private void createImagesFolder(AnaliseAcidente a) - //private void createImagesFolder(String folderName) - { - String folderName = a.getAnalise_nr().substring(0,2) + a.getAnalise_nr().substring(3); - - ServletContext theApplicationsServletContext = - (ServletContext) this.getExternalContext().getContext(); + if ( rbIncapacidadeNone.getSelected() == null && rbIncapacidadeTemp.getSelected() == null && rbIncapacidadePerm.getSelected() == null ) + { + getSessionBean1().setMsg( "Falta indicar o tipo de incapacidade!" ); + return false; + } + else + { + if ( rbIncapacidadeNone.getSelected() != null ) + { + if ( rbIncapacidadeNone.getSelected().equals( new Boolean( false ) ) ) + { + if ( rbIncapacidadeTemp.getSelected() != null ) + { + if ( rbIncapacidadeTemp.getSelected().equals( new Boolean( false ) ) ) + { + if ( rbIncapacidadePerm.getSelected() != null ) + { + if ( rbIncapacidadePerm.getSelected().equals( new Boolean( false ) ) ) + { + getSessionBean1().setMsg( "Falta indicar o tipo de incapacidade!" ); + return false; + } + } + } + } + } + } + } + + if ( txtCoefIncapacidade.getText() != null ) + { + String coef_str = txtCoefIncapacidade.getText().toString(); + if ( coef_str.trim().length() > 0 ) + { + try + { + int nr = Integer.parseInt( coef_str ); + } + catch ( Exception ex ) + { + getSessionBean1().setMsg( "O coeficiente de incapacidade deve ser um valor numérico!" ); + return false; + } + } + else + { + getSessionBean1().setMsg( "Falta coeficiente de incapacidade!" ); + return false; + } + } + else + { + getSessionBean1().setMsg( "Falta coeficiente de incapacidade!" ); + 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; + } + } + } + } + } + else if ( estado == Global.ESTADO_CONSOLIDACAO ) + { + if ( chkVerHs.getSelected() == null ) + { + getSessionBean1().setMsg( "Falta assinatura!" ); + return false; + } + else if ( chkVerHs.getSelected().equals( new Boolean( false ) ) ) + { + getSessionBean1().setMsg( "Falta assinatura!" ); + return false; + } + } + else if ( estado == Global.ESTADO_ASSINATURA_SEG ) + { + if ( chkVerRespSeg.getSelected() == null ) + { + getSessionBean1().setMsg( "Falta assinatura!" ); + return false; + } + else if ( chkVerRespSeg.getSelected().equals( new Boolean( false ) ) ) + { + getSessionBean1().setMsg( "Falta assinatura!" ); + return false; + } + } + else if ( estado == Global.ESTADO_ASSINATURA_RH ) + { + if ( chkVerRespRh.getSelected() == null ) + { + getSessionBean1().setMsg( "Falta assinatura!" ); + return false; + } + else if ( chkVerRespRh.getSelected().equals( new Boolean( false ) ) ) + { + getSessionBean1().setMsg( "Falta assinatura!" ); + return false; + } + } + + + return true; + } + + private void createImagesFolder( AnaliseAcidente a ) + //private void createImagesFolder(String folderName) + { + String folderName = a.getAnalise_nr().substring( 0, 2 ) + a.getAnalise_nr().substring( 3 ); + + ServletContext theApplicationsServletContext = + ( ServletContext ) this.getExternalContext().getContext(); // String imageFileFolder = theApplicationsServletContext.getRealPath(Global.IMAGE_FOLDER + "/" + folderName); - String imageFileFolder = Global.IMAGE_FOLDER + "/" + folderName; - try - { + String imageFileFolder = Global.IMAGE_FOLDER + "/" + folderName; + try + { // String imageFileFolderTmp = theApplicationsServletContext.getRealPath(Global.IMAGE_FOLDER + "/tmp" + getSessionBean1().getCurrentUser().getLogin()); - String imageFileFolderTmp = Global.IMAGE_FOLDER + "/tmp" + getSessionBean1().getCurrentUser().getLogin(); - File f = new File(imageFileFolderTmp); - if( f.exists() ) - { - File folder = new File(imageFileFolder); - folder.mkdir(); - - File files[] = f.listFiles(); - - for(int i=0;i 0) - { - gridImages.getChildren().clear(); - } - ServletContext theApplicationsServletContext = - (ServletContext) this.getExternalContext().getContext(); + drpCausas.setSelected( a.getCausas() ); + txtDescricao.setText( a.getDescricao() ); + txtConclusoes.setText( a.getConclusoes() ); + txtAccoes.setText( a.getAccoes() ); + chkAveriguacaoPosterior.setSelected( new Boolean( false ) ); + if ( a.getAveriguacao_posterior().matches( "y" ) ) + { + chkAveriguacaoPosterior.setSelected( new Boolean( true ) ); + } + txtAveriguacaoObs.setText( a.getAveriguacao_obs() ); + + if ( getSessionBean1().getCurrentAnalise() != null ) + { + String folderName = getSessionBean1().getCurrentAnalise().getAnalise_nr().substring( 0, 2 ) + getSessionBean1().getCurrentAnalise().getAnalise_nr().substring( 3 ); + //fill images + if ( gridImages.getChildren().size() > 0 ) + { + gridImages.getChildren().clear(); + } + ServletContext theApplicationsServletContext = + ( ServletContext ) this.getExternalContext().getContext(); // String imageFileFolder = theApplicationsServletContext.getRealPath(Global.IMAGE_FOLDER + "/" + folderName); - - - File apacheAnaliseFolder = new File(theApplicationsServletContext.getRealPath( Global.RESOURCES_IMAGE_FOLDER ) + "/analises/" + folderName); - if(apacheAnaliseFolder.exists()) - { - Global global = new Global(); - global.deleteFolderFiles(apacheAnaliseFolder); - System.out.println("FILES DELETED"); - } - else - { - apacheAnaliseFolder.mkdir(); - } - - - - String imageFileFolder = Global.IMAGE_FOLDER + "/" + folderName; - try - { - File f = new File(imageFileFolder); - - if(f.exists()) - { - File images[] = f.listFiles(); - Arrays.sort(images); - for(int i=0;i"; - - System.out.println( "Sending mail to next user." ); - - String responsavel_loja = "n"; - switch ( estado.intValue() ) - { - case Global.ESTADO_RH1: - tipo = new Integer( Global.TIPO_UTILIZADOR_RH ); - break; - case Global.ESTADO_HS: - tipo = new Integer( Global.TIPO_UTILIZADOR_HS ); - break; - case Global.ESTADO_RH2: - tipo = new Integer( Global.TIPO_UTILIZADOR_RH ); - break; - case Global.ESTADO_CONSOLIDACAO: - tipo = new Integer( Global.TIPO_UTILIZADOR_HS ); - break; - case Global.ESTADO_ASSINATURA_SEG: - tipo =new Integer( Global.TIPO_UTILIZADOR_SEGURANCA ); - responsavel_loja = "y"; - break; - case Global.ESTADO_ASSINATURA_RH: - tipo = new Integer( Global.TIPO_UTILIZADOR_RH ); - responsavel_loja = "y"; - break; - case Global.ESTADO_FECHAR: - tipo = new Integer( Global.TIPO_UTILIZADOR_HS ); - break; - } + Integer tipo = null; + + String assunto = "Comunicação de Análise de Acidentes de Trabalho"; + + String texto_email = "

Esta é uma mensagem automática da equipa da SIPRP:

"; + texto_email += "

Recebeu um novo processo de análise de acidente de trabalho para tratar.

"; + texto_email += "

Por favor, aceda a www.siprp.pt, separador colaboradores em 'Acesso à Gestão de Análises de Acidentes de Trabalho' e prossiga com a gestão do processo " + a.getAnalise_nr() + ".

"; + + System.out.println( "Sending mail to next user." ); + + String responsavel_loja = "n"; + switch ( estado.intValue() ) + { + case Global.ESTADO_RH1: + tipo = new Integer( Global.TIPO_UTILIZADOR_RH ); + break; + case Global.ESTADO_HS: + tipo = new Integer( Global.TIPO_UTILIZADOR_HS ); + break; + case Global.ESTADO_RH2: + tipo = new Integer( Global.TIPO_UTILIZADOR_RH ); + break; + case Global.ESTADO_CONSOLIDACAO: + tipo = new Integer( Global.TIPO_UTILIZADOR_HS ); + break; + case Global.ESTADO_ASSINATURA_SEG: + tipo = new Integer( Global.TIPO_UTILIZADOR_SEGURANCA ); + responsavel_loja = "y"; + break; + case Global.ESTADO_ASSINATURA_RH: + tipo = new Integer( Global.TIPO_UTILIZADOR_RH ); + responsavel_loja = "y"; + break; + case Global.ESTADO_FECHAR: + tipo = new Integer( Global.TIPO_UTILIZADOR_HS ); + break; + } // if(estado.intValue() == Global.ESTADO_FECHAR) // { @@ -14185,91 +14860,91 @@ public class AnaliseAcidenteTrabalho extends AbstractPageBean { // { // tipo = estado; // } - + // UtilizadoresDataProvider udp = new UtilizadoresDataProvider(); - try - { - UtilizadoresDataProvider udp = UtilizadoresDataProvider.getInstance(); - - ArrayList list = udp.getUtilizadoresListByTipo( tipo, responsavel_loja, a.getEstabelecimento_id() ); - ListIterator iter = list.listIterator(); - while ( iter.hasNext() ) - { - Utilizador u = ( Utilizador ) iter.next(); - System.out.println( "USER MAIL NEXT FASE : " + u.getLogin() + " ; " + u.getEmail() ); - try - { - //sendEmail(u.getEmail(), Global.ENDERECO_ENVIO, assunto, texto_email); + try + { + UtilizadoresDataProvider udp = UtilizadoresDataProvider.getInstance(); + + ArrayList list = udp.getUtilizadoresListByTipo( tipo, responsavel_loja, a.getEstabelecimento_id() ); + ListIterator iter = list.listIterator(); + while ( iter.hasNext() ) + { + Utilizador u = ( Utilizador ) iter.next(); + System.out.println( "USER MAIL NEXT FASE : " + u.getLogin() + " ; " + u.getEmail() ); + try + { + //sendEmail(u.getEmail(), Global.ENDERECO_ENVIO, assunto, texto_email); sendEmailWithPdf( a, u.getEmail(), Global.ENDERECO_ENVIO, assunto, texto_email ); - } - catch ( Exception ex1 ) - { + } + catch ( Exception ex1 ) + { errorMessage += "Erro a enviar email para " + u.getEmail(); boolean isValid = EmailValidator.getInstance().isValid( u.getEmail() ); - if ( ! isValid ) + if ( !isValid ) { errorMessage += " : email inválido."; } errorMessage += "
"; - ErrorLogger.logException( ex1 ); - System.out.println("MAIL ERROR : " + ex1.getMessage()); - } + ErrorLogger.logException( ex1 ); + System.out.println( "MAIL ERROR : " + ex1.getMessage() ); + } - } - } - catch ( Exception ex ) - { - ErrorLogger.logException( ex ); - } + } + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } return errorMessage; - } - + } + private String sendEmailResponsavelHierarquico( AnaliseAcidente a ) { String errorMessage = ""; - Acidentado ac = getSessionBean1().getAcidentado(); - String assunto = "Comunicação de Análise de Acidentes de Trabalho de " + ac.getNome(); - - String data_acidente = ""; - try - { - java.util.Date ddate = new java.util.Date( a.getData_acidente().getTime() ); - data_acidente = utils.Utils.dateToYYYYMMDD( ddate ); - } - catch ( Exception ex ) + Acidentado ac = getSessionBean1().getAcidentado(); + String assunto = "Comunicação de Análise de Acidentes de Trabalho de " + ac.getNome(); + + String data_acidente = ""; + try + { + java.util.Date ddate = new java.util.Date( a.getData_acidente().getTime() ); + data_acidente = utils.Utils.dateToYYYYMMDD( ddate ); + } + catch ( Exception ex ) { // ErrorLogger.logException( ex ); } - - String texto_email = "

Caro(a) Colega,

"; - texto_email += "

Na sequência do acidente de trabalho do colaborador "; - texto_email += ac.getNome(); - texto_email += " no dia " + data_acidente; - texto_email += ", vimos pelo presente remeter cópia da análise do acidente " + a.getAnalise_nr() + " que se encontra em processo de averiguação pelo departamento de Segurança, Recursos Humanos e pela SIPRP para seu conhecimento. Caso tenha qualquer informação importante sobre o processo ou pretenda esclarecimentos adicionais contacte, por favor, a secção de Recursos Humanos.

"; - texto_email += "

Cumprimentos.

"; - try - { + + String texto_email = "

Caro(a) Colega,

"; + texto_email += "

Na sequência do acidente de trabalho do colaborador "; + texto_email += ac.getNome(); + texto_email += " no dia " + data_acidente; + texto_email += ", vimos pelo presente remeter cópia da análise do acidente " + a.getAnalise_nr() + " que se encontra em processo de averiguação pelo departamento de Segurança, Recursos Humanos e pela SIPRP para seu conhecimento. Caso tenha qualquer informação importante sobre o processo ou pretenda esclarecimentos adicionais contacte, por favor, a secção de Recursos Humanos.

"; + texto_email += "

Cumprimentos.

"; + try + { sendEmailWithPdf( a, ac.getEmail_superior_hierarquico(), Global.ENDERECO_ENVIO, assunto, texto_email ); - //sendEmail(ac.getEmail_superior_hierarquico(), Global.ENDERECO_ENVIO, assunto, texto_email); - } - catch ( Exception ex ) - { + //sendEmail(ac.getEmail_superior_hierarquico(), Global.ENDERECO_ENVIO, assunto, texto_email); + } + catch ( Exception ex ) + { errorMessage += "Error a enviar email para " + ac.getEmail_superior_hierarquico(); boolean isValid = EmailValidator.getInstance().isValid( ac.getEmail_superior_hierarquico() ); - if ( ! isValid ) + if ( !isValid ) { errorMessage += " : email inválido."; } errorMessage += "
"; - ErrorLogger.logException( ex ); - } + ErrorLogger.logException( ex ); + } return errorMessage; - } - + } + private String sendEmailFimProcesso( AnaliseAcidente a ) { String errorMessage = ""; @@ -14277,64 +14952,64 @@ public class AnaliseAcidenteTrabalho extends AbstractPageBean { Acidentado ac = getSessionBean1().getAcidentado(); String assunto = "Fecho do Processo de Análise de Acidente de Trabalho de " + ac.getNome(); - try - { - UtilizadoresDataProvider udp = UtilizadoresDataProvider.getInstance(); - - ArrayList responsavelRh_list = udp.getResponsavelRhList(a.getEstabelecimento_id()); - if ( responsavelRh_list != null ) - { - ListIterator iter = responsavelRh_list.listIterator(); - while ( iter.hasNext() ) - { - Utilizador u = ( Utilizador ) iter.next(); - String texto_email = "

Exmo. (a) Senhor(a), " + u.getNome() + "

"; - texto_email += "

Informamos que o processo de análise de acidente de trabalho nº " + a.getAnalise_nr() + " se encontra finalizado, "; - texto_email += "pelo que solicitamos a sua impressão e arquivamento em pasta própria, juntamente com a participação de sinistro à seguradora.

"; - texto_email += "

Caso pretenda qualquer esclarecimento, contacte-nos, por favor, através de acidentes.auchan@siprp.pt ou pelo telefone 213 504 540.

"; - texto_email += "

Os melhores cumprimentos.

"; - texto_email += "

SIPRP

"; - try - { - //sendEmail(u.getEmail(), Global.ENDERECO_ENVIO, assunto, texto_email); - sendEmailWithPdf(a, u.getEmail(), Global.ENDERECO_ENVIO, assunto, texto_email); - } - catch ( Exception ex ) - { - errorMessage += "Erro a enviar email para " + u.getEmail(); - boolean isValid = EmailValidator.getInstance().isValid( u.getEmail() ); - if ( ! isValid ) - { - errorMessage += " : email inválido."; - } - errorMessage += "
"; - ErrorLogger.logException( ex ); - } - } - } - } - catch ( Exception e ) - { - ErrorLogger.logException( e ); - } + try + { + UtilizadoresDataProvider udp = UtilizadoresDataProvider.getInstance(); + + ArrayList responsavelRh_list = udp.getResponsavelRhList( a.getEstabelecimento_id() ); + if ( responsavelRh_list != null ) + { + ListIterator iter = responsavelRh_list.listIterator(); + while ( iter.hasNext() ) + { + Utilizador u = ( Utilizador ) iter.next(); + String texto_email = "

Exmo. (a) Senhor(a), " + u.getNome() + "

"; + texto_email += "

Informamos que o processo de análise de acidente de trabalho nº " + a.getAnalise_nr() + " se encontra finalizado, "; + texto_email += "pelo que solicitamos a sua impressão e arquivamento em pasta própria, juntamente com a participação de sinistro à seguradora.

"; + texto_email += "

Caso pretenda qualquer esclarecimento, contacte-nos, por favor, através de acidentes.auchan@siprp.pt ou pelo telefone 213 504 540.

"; + texto_email += "

Os melhores cumprimentos.

"; + texto_email += "

SIPRP

"; + try + { + //sendEmail(u.getEmail(), Global.ENDERECO_ENVIO, assunto, texto_email); + sendEmailWithPdf( a, u.getEmail(), Global.ENDERECO_ENVIO, assunto, texto_email ); + } + catch ( Exception ex ) + { + errorMessage += "Erro a enviar email para " + u.getEmail(); + boolean isValid = EmailValidator.getInstance().isValid( u.getEmail() ); + if ( !isValid ) + { + errorMessage += " : email inválido."; + } + errorMessage += "
"; + ErrorLogger.logException( ex ); + } + } + } + } + catch ( Exception e ) + { + ErrorLogger.logException( e ); + } return errorMessage; } - - private String sendEmailToRhFase4(AnaliseAcidente a) + + private String sendEmailToRhFase4( AnaliseAcidente a ) { String errorMessage = ""; - System.out.println("SEND EMAIL TO RH FASE 4"); + System.out.println( "SEND EMAIL TO RH FASE 4" ); Acidentado ac = getSessionBean1().getAcidentado(); //String assunto = "SIPRP ¯ Fecho do Processo de Análise de Acidente de Trabalho nº " + a.getAnalise_nr() + " ¯ Ficheiro para Impressão"; String assunto = "SIPRP - Fecho do Processo de Análise de Acidente de Trabalho nº " + a.getAnalise_nr() + " - Ficheiro para Impressão"; // UtilizadoresDataProvider udp = new UtilizadoresDataProvider(); - try - { - UtilizadoresDataProvider udp = UtilizadoresDataProvider.getInstance(); - - Utilizador urh = udp.getUtilizador(a.getRh_fase4()); + try + { + UtilizadoresDataProvider udp = UtilizadoresDataProvider.getInstance(); + + Utilizador urh = udp.getUtilizador( a.getRh_fase4() ); String texto_email = "

Exmo. (a) Senhor(a),

"; texto_email += "

Confirmamos que o processo de Análise de Acidente de Trabalho nº " + a.getAnalise_nr() + " se encontra encerrado após o preenchimento e validação de todos os intervenientes.

"; texto_email += "

Sugerimos que imprima o ficheiro que enviamos em anexo e o junte à Participação de Sinistro à Seguradora para dar conhecimento ao Médico do Trabalho do seu estabelecimento. Após o seu conhecimento, aconselhamos que entregue uma cópia da Ficha de Análise de Acidente de Trabalho à equipa de Saúde Ocupacional, para que esta a arquive no processo clínico do trabalhador antes de juntar toda a documentação no processo individual do colaborador nos Recursos Humanos.

"; @@ -14343,27 +15018,28 @@ public class AnaliseAcidenteTrabalho extends AbstractPageBean { texto_email += "

A equipa da SIPRP

"; try { - sendEmailWithPdf(a, urh.getEmail(), Global.ENDERECO_ENVIO, assunto, texto_email); + sendEmailWithPdf( a, urh.getEmail(), Global.ENDERECO_ENVIO, assunto, texto_email ); } - catch (Exception ex) + catch ( Exception ex ) { errorMessage += "Erro a enviar email para " + urh.getEmail(); boolean isValid = EmailValidator.getInstance().isValid( urh.getEmail() ); - if ( ! isValid ) + if ( !isValid ) { errorMessage += " : email inválido."; } errorMessage += "
"; - ErrorLogger.logException(ex); - System.out.println("EMAIL FASE 4 ERROR : " + ex.getMessage()); + ErrorLogger.logException( ex ); + System.out.println( "EMAIL FASE 4 ERROR : " + ex.getMessage() ); } - } catch (Exception ex) { - ErrorLogger.logException(ex); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); } return errorMessage; } - // private void sendEmail(String emailTo, String emailFrom, String assunto, String texto_email) throws Exception // { // Properties props = new Properties(); @@ -14401,15 +15077,12 @@ public class AnaliseAcidenteTrabalho extends AbstractPageBean { //// } // // } - - private final String SMTP_HOST = "mail2.evolute.pt"; - private final int SMTP_PORT = 587; - - private final String mail_username = "acidentes.auchan@siprp.pt"; - private final String mail_password = "EghRzS2l"; - - private final String mail_bcc = "acidentes.auchan@siprp.pt"; - private final String mail_bcc2 = "siprp.aat@evolute.pt"; + private final String SMTP_HOST = "mail2.evolute.pt"; + private final int SMTP_PORT = 587; + private final String mail_username = "acidentes.auchan@siprp.pt"; + private final String mail_password = "EghRzS2l"; + private final String mail_bcc = "acidentes.auchan@siprp.pt"; + private final String mail_bcc2 = "siprp.aat@evolute.pt"; // private void sendEmail(String emailTo, String emailFrom, String assunto, String texto_email) // throws Exception @@ -14456,101 +15129,103 @@ public class AnaliseAcidenteTrabalho extends AbstractPageBean { // t.close(); // System.out.println("Email Enviado !!!!" ); // } - - private void sendEmailWithPdf(AnaliseAcidente a, String emailTo, String emailFrom, String assunto, String texto_email) - throws Exception - { - System.out.println("\nSEND EMAIL WITH PDF"); - - System.out.println( "\temailTo : " + emailTo ); - System.out.println( "\temailFrom : " + emailFrom ); - System.out.println( "\tAnaliseAcidente : " + ( a == null ? "null" : a.getId() ) ); - System.out.println( "\t\tTecnicoSaudeID : " + (a == null ? "a null" : "" + a.getTecnico_saude_id()) ); - System.out.println( "\t\tMedicoID : " + (a == null ? "a null" : "" + a.getMedico_id() ) ); - - UtilizadoresDataProvider udp = UtilizadoresDataProvider.getInstance(); - - Utilizador ut = udp.getUtilizador(a.getTecnico_saude_id()); - Utilizador um = udp.getUtilizador(a.getMedico_id()); + private void sendEmailWithPdf( AnaliseAcidente a, String emailTo, String emailFrom, String assunto, String texto_email ) + throws Exception + { + System.out.println( "\nSEND EMAIL WITH PDF" ); + + System.out.println( "\temailTo : " + emailTo ); + System.out.println( "\temailFrom : " + emailFrom ); + System.out.println( "\tAnaliseAcidente : " + ( a == null ? "null" : a.getId() ) ); + System.out.println( "\t\tTecnicoSaudeID : " + ( a == null ? "a null" : "" + a.getTecnico_saude_id() ) ); + System.out.println( "\t\tMedicoID : " + ( a == null ? "a null" : "" + a.getMedico_id() ) ); + + UtilizadoresDataProvider udp = UtilizadoresDataProvider.getInstance(); + + Utilizador ut = udp.getUtilizador( a.getTecnico_saude_id() ); + Utilizador um = udp.getUtilizador( a.getMedico_id() ); // AnalisesDataProvider adp = new AnalisesDataProvider(); - AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); - - Acidentado ac = adp.getAcidentado(a.getAcidentado_id()); - Estabelecimento e = new Estabelecimento(); - e.setId(a.getEstabelecimento_id()); - e.setNome(adp.getEstabelecimentoNome(a.getEstabelecimento_id())); - Seccao s = adp.getSeccao(a.getSeccao_id()); - Causa c = adp.getCausa(a.getCausas()); - ArrayList recList = adp.getRecomendacoesByAnalise(a.getId()); - Recomendacao[] recArray = new Recomendacao[recList.size()]; - ListIterator iter = recList.listIterator(); - int i = 0; - while(iter.hasNext()) - { - Recomendacao rec = (Recomendacao) iter.next(); - recArray[i] = rec; - i++; - } - //Recomendacao recArray[] = (Recomendacao)recList.toArray(); - ArrayList medList = adp.getMedidasByAnalise(a.getId()); - //Medida medArray[] = (Medida)medList.toArray(); - Medida[] medArray = new Medida[medList.size()]; - iter = medList.listIterator(); - i = 0; - while(iter.hasNext()) - { - Medida med = (Medida) iter.next(); - medArray[i] = med; - i++; - } - - PdfGenerator pdf = new PdfGenerator(Global.IMAGE_FOLDER, e, ut, um, a, ac, s, recArray, medArray, c); - - ByteArrayDataSource ds = new ByteArrayDataSource( pdf.generatePdf(), "application/pdf" ); - Properties props = new Properties(); - //props.put("mail.transport.protocol", "smtp"); - props.put("mail.smtp.host", SMTP_HOST ); - props.put("mail.from", emailFrom); - props.put("mail.smtp.auth", "true"); - props.put("mail.smtp.user", mail_username ); - props.put("mail.smtp.password", mail_password ); + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + + Acidentado ac = adp.getAcidentado( a.getAcidentado_id() ); + Estabelecimento e = new Estabelecimento(); + e.setId( a.getEstabelecimento_id() ); + e.setNome( adp.getEstabelecimentoNome( a.getEstabelecimento_id() ) ); + Seccao s = adp.getSeccao( a.getSeccao_id() ); + Causa c = adp.getCausa( a.getCausas() ); + ArrayList recList = adp.getRecomendacoesByAnalise( a.getId() ); + Recomendacao[] recArray = new Recomendacao[ recList.size() ]; + ListIterator iter = recList.listIterator(); + int i = 0; + while ( iter.hasNext() ) + { + Recomendacao rec = ( Recomendacao ) iter.next(); + recArray[i] = rec; + i++; + } + //Recomendacao recArray[] = (Recomendacao)recList.toArray(); + ArrayList medList = adp.getMedidasByAnalise( a.getId() ); + //Medida medArray[] = (Medida)medList.toArray(); + Medida[] medArray = new Medida[ medList.size() ]; + iter = medList.listIterator(); + i = 0; + while ( iter.hasNext() ) + { + Medida med = ( Medida ) iter.next(); + medArray[i] = med; + i++; + } + + PdfGenerator pdf = new PdfGenerator( Global.IMAGE_FOLDER, e, ut, um, a, ac, s, recArray, medArray, c ); + + ByteArrayDataSource ds = new ByteArrayDataSource( pdf.generatePdf(), "application/pdf" ); + Properties props = new Properties(); + //props.put("mail.transport.protocol", "smtp"); + props.put( "mail.smtp.host", SMTP_HOST ); + props.put( "mail.from", emailFrom ); + props.put( "mail.smtp.auth", "true" ); + props.put( "mail.smtp.user", mail_username ); + props.put( "mail.smtp.password", mail_password ); // Authenticator auth = new SMTPAuthenticator(); // Session session = Session.getDefaultInstance(props, auth); Session session = Session.getDefaultInstance( props ); - - Message msg = new MimeMessage(session); - msg.setFrom(new InternetAddress(emailFrom)); - InternetAddress[] address = {new InternetAddress(emailTo)}; - msg.setRecipients(Message.RecipientType.TO, address); + + Message msg = new MimeMessage( session ); + msg.setFrom( new InternetAddress( emailFrom ) ); + InternetAddress[] address = + { + new InternetAddress( emailTo ) + }; + msg.setRecipients( Message.RecipientType.TO, address ); InternetAddress[] addressBCC = new InternetAddress[ 2 ]; - addressBCC[ 0 ] = new InternetAddress( mail_bcc ); - addressBCC[ 1 ] = new InternetAddress( mail_bcc2 ); - msg.setRecipients( Message.RecipientType.BCC, addressBCC ); - - ((MimeMessage)msg).setSubject(assunto, "UTF-8"); - msg.setSentDate(new Date()); - Multipart multipart = new MimeMultipart(); - BodyPart msgBodyPart = new MimeBodyPart(); - String html; - html=" "; - html+=""; - html+= "
" + texto_email + "
"; - html+=""; - msgBodyPart.setContent(html, "text/html"); - multipart.addBodyPart(msgBodyPart); - - MimeBodyPart pdfPart = new MimeBodyPart(); - //pdfPart.setContent(ds,"application/pdf"); - pdfPart.setDataHandler(new DataHandler(ds)); - pdfPart.setHeader("Content-Transfer-Encoding","base64"); - pdfPart.setHeader("Content-Disposition","attachment"); - String pdfname = "Analise" + a.getAnalise_nr(); - pdfPart.setFileName(pdfname); - multipart.addBodyPart(pdfPart,1); - - msg.setContent( multipart ); + addressBCC[ 0] = new InternetAddress( mail_bcc ); + addressBCC[ 1] = new InternetAddress( mail_bcc2 ); + msg.setRecipients( Message.RecipientType.BCC, addressBCC ); + + ( ( MimeMessage ) msg ).setSubject( assunto, "UTF-8" ); + msg.setSentDate( new Date() ); + Multipart multipart = new MimeMultipart(); + BodyPart msgBodyPart = new MimeBodyPart(); + String html; + html = " "; + html += ""; + html += "
" + texto_email + "
"; + html += ""; + msgBodyPart.setContent( html, "text/html" ); + multipart.addBodyPart( msgBodyPart ); + + MimeBodyPart pdfPart = new MimeBodyPart(); + //pdfPart.setContent(ds,"application/pdf"); + pdfPart.setDataHandler( new DataHandler( ds ) ); + pdfPart.setHeader( "Content-Transfer-Encoding", "base64" ); + pdfPart.setHeader( "Content-Disposition", "attachment" ); + String pdfname = "Analise" + a.getAnalise_nr(); + pdfPart.setFileName( pdfname ); + multipart.addBodyPart( pdfPart, 1 ); + + msg.setContent( multipart ); Transport t; t = session.getTransport( "smtp" ); @@ -14559,10 +15234,10 @@ public class AnaliseAcidenteTrabalho extends AbstractPageBean { t.sendMessage( msg, msg.getAllRecipients() ); t.close(); - System.out.println("Email Pdf Enviado !!!! " + emailTo); - } + System.out.println( "Email Pdf Enviado !!!! " + emailTo ); + } - public String butImprimir_action() + public String butImprimir_action() { // AnaliseAcidente a = getSessionBean1().getCurrentAnalise(); // if(a.getEstado().intValue() == ESTADO_IMPRESSAO) @@ -14570,15 +15245,15 @@ public class AnaliseAcidenteTrabalho extends AbstractPageBean { // Pdf pdf = new Pdf(); // pdf.generatePdf(a); // } - - if(validationOk()) - { - AnaliseAcidente a = fillAnaliseFields(); - Acidentado ac = null; - ArrayList recs = null; - ArrayList meds = null; - int estado = a.getEstado().intValue(); - //if(estado == ESTADO_SEG || estado == ESTADO_RH1) + + if ( validationOk() ) + { + AnaliseAcidente a = fillAnaliseFields(); + Acidentado ac = null; + ArrayList recs = null; + ArrayList meds = null; + int estado = a.getEstado().intValue(); + //if(estado == ESTADO_SEG || estado == ESTADO_RH1) // if(estado == Global.ESTADO_RH1) // { // ac = fillAcidentadoFields(); @@ -14619,11 +15294,11 @@ public class AnaliseAcidenteTrabalho extends AbstractPageBean { // a.setEstado(new Integer(novo_estado)); // } - try - { - update(a, ac, recs, meds); - chkVerRespRh.setDisabled(true); - //createImagesFolder(analiseId.toString()); + try + { + update( a, ac, recs, meds ); + chkVerRespRh.setDisabled( true ); + //createImagesFolder(analiseId.toString()); // updateImagesFolder(a.getId().toString()); // sendMailToNextUser(new Integer(novo_estado)); // String navFrom = getSessionBean1().getNavFrom(); @@ -14643,17 +15318,17 @@ public class AnaliseAcidenteTrabalho extends AbstractPageBean { // { // return "form_medico"; // } - } - catch(Exception ex) - { - getSessionBean1().setMsg("Erro na actualização da análise !"); - ErrorLogger.logException( ex ); - } - } - - return null; - } - + } + catch ( Exception ex ) + { + getSessionBean1().setMsg( "Erro na actualização da análise !" ); + ErrorLogger.logException( ex ); + } + } + + return null; + } + // private void buildPdf(AnaliseAcidente a) // { // @@ -14666,8 +15341,6 @@ public class AnaliseAcidenteTrabalho extends AbstractPageBean { // pdf.generatePdf(pdf_folder, a); // } // } - - // private String createPdfFolder(String folderName) // { // ServletContext theApplicationsServletContext = @@ -14704,252 +15377,257 @@ public class AnaliseAcidenteTrabalho extends AbstractPageBean { // } // // } + public String butProcurarTrab_action() + { + boolean booNrOk = false; + boolean booNomeOk = false; + String nr_mecano = null; + String nome = null; + if ( txtNrMecanografico.getText() != null ) + { + nr_mecano = ( String ) txtNrMecanografico.getText(); + if ( nr_mecano.trim().length() > 0 ) + { + booNrOk = true; + } + else + { + nr_mecano = null; + } + } + + if ( txtNomeTrabalhador.getText() != null ) + { + nome = ( String ) txtNomeTrabalhador.getText(); + if ( nome.trim().length() > 0 ) + { + booNomeOk = true; + } + else + { + nome = null; + } + } + + if ( !booNrOk && !booNomeOk ) + { + getSessionBean1().setMsg( "Tem de preencher Numero Mecanográfico ou Nome" ); + return null; + } - public String butProcurarTrab_action() - { - boolean booNrOk = false; - boolean booNomeOk = false; - String nr_mecano = null; - String nome = null; - if(txtNrMecanografico.getText() != null) - { - nr_mecano = (String) txtNrMecanografico.getText(); - if(nr_mecano.trim().length() > 0) - { - booNrOk = true; - } - else - { - nr_mecano = null; - } - } - - if(txtNomeTrabalhador.getText() != null) - { - nome = (String) txtNomeTrabalhador.getText(); - if(nome.trim().length() > 0) - { - booNomeOk = true; - } - else - { - nome = null; - } - } - - if(! booNrOk && !booNomeOk) - { - getSessionBean1().setMsg("Tem de preencher Numero Mecanográfico ou Nome"); - return null; - } - // AnalisesDataProvider adp = new AnalisesDataProvider(); - Trabalhador t = null; - if(nome != null) - { - nome = utils.Utils.textToUnicode( nome.toUpperCase()); - } - try - { - AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); - - ArrayList list = adp.searchTrabalhador(getSessionBean1().getCurrentUser().getEmpresa_id(), getSessionBean1().getCurrentUser().getEstabelecimento_id(), nr_mecano, nome ); - if(list.size() == 1) - { - t = (Trabalhador) list.get(0); - 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()); - a.setNumero_mecanografico(t.getNumero_mecanografico()); - getSessionBean1().setAcidentado(a); - gridSiprp.setRendered(true); - gridDadosAcidenteSeg.setRendered(true); - gridTrabalhadores.setRendered(false); - } - else - { - tblTrabalhadores.setRendered(true); - getSessionBean1().getTrabalhadoresListDataProvider().setList(list); - } - if(getSessionBean1().getCurrentAnalise() != null) // new analise) - { - gridTrabalhadores.setRendered(false); - } - } - catch(Exception ex) - { - getSessionBean1().setMsg("Trabalhador inexistente ! "); - tblTrabalhadores.setRendered(false); - txtTrabalhador.setText(""); - gridSiprp.setRendered(false); - gridDadosAcidenteSeg.setRendered(false); - ErrorLogger.logException( ex ); - } - - return null; - } - - public String lnkPOR_action() { - // TODO: Replace with your code - getSessionBean1().setIeBug(true); - Trabalhador t = getTrabalhadorRowData(); - Acidentado ac = setAcidentado(t); - gridSiprp.setRendered(true); - gridAcidentadoView.setRendered(true); - gridDadosAcidenteSeg.setRendered(true); - gridTrabalhadores.setRendered(false); - fillAcidentadoView(ac); - return null; - } - - public String lnkNomeTrabalhador_action() { - // TODO: Replace with your code - getSessionBean1().setIeBug(true); - Trabalhador t = getTrabalhadorRowData(); - Acidentado ac = setAcidentado(t); - gridSiprp.setRendered(true); - gridAcidentadoView.setRendered(true); - gridDadosAcidenteSeg.setRendered(true); - gridTrabalhadores.setRendered(false); - fillAcidentadoView(ac); - return null; - } - - public String lnkEstabelecimentoTrabalhador_action() { - // TODO: Replace with your code - getSessionBean1().setIeBug(true); - Trabalhador t = getTrabalhadorRowData(); - Acidentado ac = setAcidentado(t); - gridSiprp.setRendered(true); - gridAcidentadoView.setRendered(true); - gridDadosAcidenteSeg.setRendered(true); - gridTrabalhadores.setRendered(false); - fillAcidentadoView(ac); - return null; - } - - private Trabalhador getTrabalhadorRowData() - { - 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); - return t; - } - - private Acidentado setAcidentado(Trabalhador t) - { - 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.setMorada(""); - a.setFuncao(utils.Utils.unicodeToHTML(t.getFuncao())); - a.setData_admissao(t.getData_admissao()); - a.setNumero_mecanografico(t.getNumero_mecanografico()); - a.setEstabelecimento_origem(t.getEstabelecimento()); - getSessionBean1().setAcidentado(a); - return a; - } - - public String butCorrecao_action() { - // TODO: Process the button click action. Return value is a navigation - // case name where null will return to the same page. - getSessionBean1().setIeBug(true); - getSessionBean1().setCorrecao(null); - return "correcao"; - } - - public String lnkNewUser_action() { - // TODO: Replace with your code - - return null; - } - - private boolean isRecomendacoesEmpty() - { - boolean res = true; - - for(int i=0; i < gridRecomendacoes.getChildren().size(); i++) - { - HtmlPanelGrid g = (HtmlPanelGrid) gridRecomendacoes.getChildren().get(i); - TextArea t = (TextArea) g.getChildren().get(1); - if(t.getText() != null) - { - String txt = (String) t.getText(); - if(txt.trim().length() > 0) - { - res = false; - break; - } - } - } - - return res; - } - - private boolean isMedidasEmpty() - { - boolean res = true; - - for(int i=0; i < gridMedidas.getChildren().size(); i++) - { - HtmlPanelGrid g = (HtmlPanelGrid) gridMedidas.getChildren().get(i); - TextArea t = (TextArea) g.getChildren().get(1); - if(t.getText() != null) - { - String txt = (String) t.getText(); - if(txt.trim().length() > 0) - { - res = false; - break; - } - } - } - - return res; - } - - public void drpDepartamento_processValueChange(ValueChangeEvent event) - { - // TODO: Replace with your code - - Integer departamento_id = (Integer) drpDepartamento.getSelected(); - try - { - AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); - - if(departamento_id.intValue()== 0) - { - getSessionBean1().setSeccaoOptions(adp.getSeccoesList(null)); - } - else - { - getSessionBean1().setSeccaoOptions(adp.getSeccoesList(departamento_id)); - } - - drpSeccao.setSelected(new Integer(0)); - } - catch(Exception ex) - { - ErrorLogger.logException( ex ); - } - hidAnchor.setValue("dados"); - } - - public String lnkAjuda_action() { - // TODO: Replace with your code + Trabalhador t = null; + if ( nome != null ) + { + nome = utils.Utils.textToUnicode( nome.toUpperCase() ); + } + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + + ArrayList list = adp.searchTrabalhador( getSessionBean1().getCurrentUser().getEmpresa_id(), getSessionBean1().getCurrentUser().getEstabelecimento_id(), nr_mecano, nome ); + if ( list.size() == 1 ) + { + t = ( Trabalhador ) list.get( 0 ); + 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() ); + a.setNumero_mecanografico( t.getNumero_mecanografico() ); + getSessionBean1().setAcidentado( a ); + gridSiprp.setRendered( true ); + gridDadosAcidenteSeg.setRendered( true ); + gridTrabalhadores.setRendered( false ); + } + else + { + tblTrabalhadores.setRendered( true ); + getSessionBean1().getTrabalhadoresListDataProvider().setList( list ); + } + if ( getSessionBean1().getCurrentAnalise() != null ) // new analise) + { + gridTrabalhadores.setRendered( false ); + } + } + catch ( Exception ex ) + { + getSessionBean1().setMsg( "Trabalhador inexistente ! " ); + tblTrabalhadores.setRendered( false ); + txtTrabalhador.setText( "" ); + gridSiprp.setRendered( false ); + gridDadosAcidenteSeg.setRendered( false ); + ErrorLogger.logException( ex ); + } + + return null; + } + + public String lnkPOR_action() + { + // TODO: Replace with your code + getSessionBean1().setIeBug( true ); + Trabalhador t = getTrabalhadorRowData(); + Acidentado ac = setAcidentado( t ); + gridSiprp.setRendered( true ); + gridAcidentadoView.setRendered( true ); + gridDadosAcidenteSeg.setRendered( true ); + gridTrabalhadores.setRendered( false ); + fillAcidentadoView( ac ); + return null; + } + + public String lnkNomeTrabalhador_action() + { + // TODO: Replace with your code + getSessionBean1().setIeBug( true ); + Trabalhador t = getTrabalhadorRowData(); + Acidentado ac = setAcidentado( t ); + gridSiprp.setRendered( true ); + gridAcidentadoView.setRendered( true ); + gridDadosAcidenteSeg.setRendered( true ); + gridTrabalhadores.setRendered( false ); + fillAcidentadoView( ac ); + return null; + } + + public String lnkEstabelecimentoTrabalhador_action() + { + // TODO: Replace with your code + getSessionBean1().setIeBug( true ); + Trabalhador t = getTrabalhadorRowData(); + Acidentado ac = setAcidentado( t ); + gridSiprp.setRendered( true ); + gridAcidentadoView.setRendered( true ); + gridDadosAcidenteSeg.setRendered( true ); + gridTrabalhadores.setRendered( false ); + fillAcidentadoView( ac ); + return null; + } + + private Trabalhador getTrabalhadorRowData() + { + 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 ); + return t; + } + + private Acidentado setAcidentado( Trabalhador t ) + { + 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.setMorada( "" ); + a.setFuncao( utils.Utils.unicodeToHTML( t.getFuncao() ) ); + a.setData_admissao( t.getData_admissao() ); + a.setNumero_mecanografico( t.getNumero_mecanografico() ); + a.setEstabelecimento_origem( t.getEstabelecimento() ); + getSessionBean1().setAcidentado( a ); + return a; + } + + public String butCorrecao_action() + { + // TODO: Process the button click action. Return value is a navigation + // case name where null will return to the same page. + getSessionBean1().setIeBug( true ); + getSessionBean1().setCorrecao( null ); + return "correcao"; + } + + public String lnkNewUser_action() + { + // TODO: Replace with your code + + return null; + } + + private boolean isRecomendacoesEmpty() + { + boolean res = true; + + for ( int i = 0; i < gridRecomendacoes.getChildren().size(); i++ ) + { + HtmlPanelGrid g = ( HtmlPanelGrid ) gridRecomendacoes.getChildren().get( i ); + TextArea t = ( TextArea ) g.getChildren().get( 1 ); + if ( t.getText() != null ) + { + String txt = ( String ) t.getText(); + if ( txt.trim().length() > 0 ) + { + res = false; + break; + } + } + } + + return res; + } + + private boolean isMedidasEmpty() + { + boolean res = true; + + for ( int i = 0; i < gridMedidas.getChildren().size(); i++ ) + { + HtmlPanelGrid g = ( HtmlPanelGrid ) gridMedidas.getChildren().get( i ); + TextArea t = ( TextArea ) g.getChildren().get( 1 ); + if ( t.getText() != null ) + { + String txt = ( String ) t.getText(); + if ( txt.trim().length() > 0 ) + { + res = false; + break; + } + } + } + + return res; + } + + public void drpDepartamento_processValueChange( ValueChangeEvent event ) + { + // TODO: Replace with your code + + Integer departamento_id = ( Integer ) drpDepartamento.getSelected(); + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + + if ( departamento_id.intValue() == 0 ) + { + getSessionBean1().setSeccaoOptions( adp.getSeccoesList( null ) ); + } + else + { + getSessionBean1().setSeccaoOptions( adp.getSeccoesList( departamento_id ) ); + } + + drpSeccao.setSelected( new Integer( 0 ) ); + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + } + hidAnchor.setValue( "dados" ); + } + + public String lnkAjuda_action() + { + // TODO: Replace with your code // ServletContext theApplicationsServletContext = // (ServletContext) this.getExternalContext().getContext(); // String pdfFolderPath = theApplicationsServletContext.getRealPath(Global.PDF_FOLDER_URL); @@ -14964,91 +15642,91 @@ public class AnaliseAcidenteTrabalho extends AbstractPageBean { // { // ErrorLogger.logException( ex ); // } - getSessionBean1().setIeBug(true); - return null; - } - - private boolean checkRecomendacoesLen() - { + getSessionBean1().setIeBug( true ); + return null; + } + + private boolean checkRecomendacoesLen() + { // AnalisesDataProvider adp = new AnalisesDataProvider(); - HashMap meta = new HashMap(); - try - { - AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); - - meta = adp.getMetaData("recomendacoes"); - 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.length() > 0) - { - int len = ( (Integer) meta.get("recomendacao") ).intValue(); - if(txt.length() > len) - { - getSessionBean1().setMsg("Os Campos Recomendações não podem exceder " + len + " caracteres!"); - return false; - } - } - } - } - } - catch(Exception ex) - { - ErrorLogger.logException( ex ); - return false; - } - return true; - } - - private boolean checkMedidasLen() - { - HashMap meta = new HashMap(); - - try - { - AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); - - meta = adp.getMetaData("medidas"); - 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.length() > 0) - { - int len = ( (Integer) meta.get("medida") ).intValue(); - if(txt.length() > len) - { - getSessionBean1().setMsg("Os Campos Medidas não podem exceder " + len + " caracteres!"); - return false; - } - } - } - } - } - catch(Exception ex) - { - ErrorLogger.logException( ex ); - return false; - } - - return true; - } - - public String lnkPlanosActuacao_action() { - // TODO: Replace with your code - return null; - } + HashMap meta = new HashMap(); + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + + meta = adp.getMetaData( "recomendacoes" ); + 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.length() > 0 ) + { + int len = ( ( Integer ) meta.get( "recomendacao" ) ).intValue(); + if ( txt.length() > len ) + { + getSessionBean1().setMsg( "Os Campos Recomendações não podem exceder " + len + " caracteres!" ); + return false; + } + } + } + } + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + return false; + } + return true; + } + + private boolean checkMedidasLen() + { + HashMap meta = new HashMap(); + + try + { + AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); + + meta = adp.getMetaData( "medidas" ); + 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.length() > 0 ) + { + int len = ( ( Integer ) meta.get( "medida" ) ).intValue(); + if ( txt.length() > len ) + { + getSessionBean1().setMsg( "Os Campos Medidas não podem exceder " + len + " caracteres!" ); + return false; + } + } + } + } + } + catch ( Exception ex ) + { + ErrorLogger.logException( ex ); + return false; + } + return true; + } + + public String lnkPlanosActuacao_action() + { + // TODO: Replace with your code + return null; + } } diff --git a/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Login.java b/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Login.java index cd9e49c7..a45d46ab 100644 --- a/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Login.java +++ b/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Login.java @@ -604,7 +604,7 @@ public class Login extends AbstractPageBean try { AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); - getSessionBean1().setCausasOptions(adp.getCausasList()); + getSessionBean1().setCausasOptions( adp.getCausasAcidente() ); } catch(Exception ex) { diff --git a/trunk/AnaliseAcidentesTrabalho/src/java/db/providers/AnalisesDataProvider.java b/trunk/AnaliseAcidentesTrabalho/src/java/db/providers/AnalisesDataProvider.java index a94eebe1..8d23aad7 100644 --- a/trunk/AnaliseAcidentesTrabalho/src/java/db/providers/AnalisesDataProvider.java +++ b/trunk/AnaliseAcidentesTrabalho/src/java/db/providers/AnalisesDataProvider.java @@ -6,7 +6,6 @@ * To change this template, choose Tools | Template Manager * and open the template in the editor. */ - package db.providers; import beans.Acidentado; @@ -29,6 +28,7 @@ import com.evolute.utils.sql.Field; import com.evolute.utils.sql.Select2; import com.evolute.utils.strings.StringPlainer; import com.sun.rave.web.ui.model.Option; +import db.data.siprp.outer.CausasData; import global.Global; import java.sql.ResultSet; import java.sql.ResultSetMetaData; @@ -53,80 +53,79 @@ import utils.Utils; */ public class AnalisesDataProvider extends GenericDataProvider { - private static AnalisesDataProvider INSTANCE = null; - - - private AnalisesDataProvider() throws Exception - { - super(); - } - - public static synchronized AnalisesDataProvider getInstance() throws Exception - { - if ( INSTANCE == null ) - { - INSTANCE = new AnalisesDataProvider(); - } - return INSTANCE; - } - - public Controle getControle() throws Exception - { - Statement st = createStatement(); - String sql = "SELECT * FROM controle WHERE id = 1"; - ResultSet rs = st.executeQuery(sql); - rs.first(); - Controle c = new Controle(); - c.setId(new Integer( rs.getInt("id") )); - c.setAnalise_year( new Integer( rs.getInt( "analise_year" ) )); - c.setLast_analise_nr( new Integer( rs.getInt( "last_analise_nr" ) ) ); - return c; - } - - public Controle getControloByAno(Integer ano) throws Exception - { - Controle c = null; - Statement st = createStatement(); - String sql = "SELECT * FROM controle WHERE analise_year = " + ano; - ResultSet rs = st.executeQuery(sql); - - if(rs.isBeforeFirst()) - { - rs.first(); - c = new Controle(); - c.setId(new Integer( rs.getInt("id") )); - c.setAnalise_year( new Integer( rs.getInt( "analise_year" ) )); - c.setLast_analise_nr( new Integer( rs.getInt( "last_analise_nr" ) ) ); - } - return c; - } - - public Controle createAnoNumeracao(Integer ano) throws Exception - { - Controle c = new Controle(); - Integer newId = getMaxControleId(); - c.setId(newId); - c.setAnalise_year(ano); - c.setLast_analise_nr(new Integer(0)); - Statement st = createStatement(); - - String sql = "INSERT INTO controle (id, analise_year, last_analise_nr) VALUES ("; - sql += c.getId() + ", "; - sql += c.getAnalise_year() + ", "; - sql += c.getLast_analise_nr() + ")"; - st.execute(sql); - return c; - } - - public void updateControle( Controle c ) throws Exception - { - Statement st = createStatement(); - String sql = "UPDATE controle SET analise_year = " + c.getAnalise_year() + ", "; - sql += "last_analise_nr = " + c.getLast_analise_nr() + " "; - sql += "WHERE id = " + c.getId(); - st.execute(sql); - } - + + private static AnalisesDataProvider INSTANCE = null; + + private AnalisesDataProvider() throws Exception + { + super(); + } + + public static synchronized AnalisesDataProvider getInstance() throws Exception + { + if ( INSTANCE == null ) + { + INSTANCE = new AnalisesDataProvider(); + } + return INSTANCE; + } + + public Controle getControle() throws Exception + { + Statement st = createStatement(); + String sql = "SELECT * FROM controle WHERE id = 1"; + ResultSet rs = st.executeQuery( sql ); + rs.first(); + Controle c = new Controle(); + c.setId( new Integer( rs.getInt( "id" ) ) ); + c.setAnalise_year( new Integer( rs.getInt( "analise_year" ) ) ); + c.setLast_analise_nr( new Integer( rs.getInt( "last_analise_nr" ) ) ); + return c; + } + + public Controle getControloByAno( Integer ano ) throws Exception + { + Controle c = null; + Statement st = createStatement(); + String sql = "SELECT * FROM controle WHERE analise_year = " + ano; + ResultSet rs = st.executeQuery( sql ); + + if ( rs.isBeforeFirst() ) + { + rs.first(); + c = new Controle(); + c.setId( new Integer( rs.getInt( "id" ) ) ); + c.setAnalise_year( new Integer( rs.getInt( "analise_year" ) ) ); + c.setLast_analise_nr( new Integer( rs.getInt( "last_analise_nr" ) ) ); + } + return c; + } + + public Controle createAnoNumeracao( Integer ano ) throws Exception + { + Controle c = new Controle(); + Integer newId = getMaxControleId(); + c.setId( newId ); + c.setAnalise_year( ano ); + c.setLast_analise_nr( new Integer( 0 ) ); + Statement st = createStatement(); + + String sql = "INSERT INTO controle (id, analise_year, last_analise_nr) VALUES ("; + sql += c.getId() + ", "; + sql += c.getAnalise_year() + ", "; + sql += c.getLast_analise_nr() + ")"; + st.execute( sql ); + return c; + } + + public void updateControle( Controle c ) throws Exception + { + Statement st = createStatement(); + String sql = "UPDATE controle SET analise_year = " + c.getAnalise_year() + ", "; + sql += "last_analise_nr = " + c.getLast_analise_nr() + " "; + sql += "WHERE id = " + c.getId(); + st.execute( sql ); + } public String getExpression( String nome, String estabelecimento, String visitaDate, String POR ) { @@ -167,13 +166,10 @@ public class AnalisesDataProvider extends GenericDataProvider return "SELECT * FROM " + tables + " WHERE " + joinConditions + whereExpression + " "; } - - /*************************************************************************/ /********************************* ACTUAIS *******************************/ /*************************************************************************/ - - public ArrayList searchAnalisesActualSeg( Integer estabelecimento_id, + public ArrayList searchAnalisesActualSeg( Integer estabelecimento_id, String nome, String visitaDate, String POR, String responsavel_loja, Integer fromYear ) throws Exception { @@ -185,18 +181,18 @@ public class AnalisesDataProvider extends GenericDataProvider Statement st = createStatement(); String sql = getExpression( nome, null, visitaDate, POR ); - if ( responsavel_loja.matches( "y" ) ) - { - sql += "AND (estado = " + Global.ESTADO_SEG + " OR (averiguacao_posterior = 'y' AND averiguacao_obs = '')" + - " OR estado = " + Global.ESTADO_ASSINATURA_SEG + ")" + " AND estabelecimento_id = " + estabelecimento_id + - " ORDER BY analise_nr"; - } - else - { - sql += "AND (estado = " + Global.ESTADO_SEG + " OR (averiguacao_posterior = 'y' AND averiguacao_obs = ''))" + - " AND estabelecimento_id = " + estabelecimento_id + - " ORDER BY analise_nr"; - } + if ( responsavel_loja.matches( "y" ) ) + { + sql += "AND (estado = " + Global.ESTADO_SEG + " OR (averiguacao_posterior = 'y' AND averiguacao_obs = '')" + + " OR estado = " + Global.ESTADO_ASSINATURA_SEG + ")" + " AND estabelecimento_id = " + estabelecimento_id + + " ORDER BY analise_nr"; + } + else + { + sql += "AND (estado = " + Global.ESTADO_SEG + " OR (averiguacao_posterior = 'y' AND averiguacao_obs = ''))" + + " AND estabelecimento_id = " + estabelecimento_id + + " ORDER BY analise_nr"; + } System.out.println( "SQL: " + sql ); ResultSet rs = st.executeQuery( sql ); @@ -204,9 +200,9 @@ public class AnalisesDataProvider extends GenericDataProvider return list; } - public ArrayList getAnalisesActuaisSegList( Integer estabelecimentoID, String responsavel_loja, Integer fromYear ) + public ArrayList getAnalisesActuaisSegList( Integer estabelecimentoID, String responsavel_loja, Integer fromYear ) throws Exception - { + { Expression where = new Field( "analises_acidentes.apagada" ).isEqual( "n" ); where = where.and( new Field( "analises_acidentes.estabelecimento_id" ).isEqual( estabelecimentoID ) ); if ( fromYear != null ) @@ -214,11 +210,8 @@ public class AnalisesDataProvider extends GenericDataProvider where = where.and( new Field( "EXTRACT( year FROM analises_acidentes.data_acidente )" ).isEqual( fromYear ) ); } - Expression states = new Field( "analises_acidentes.estado" ).isEqual( Global.ESTADO_SEG ) - .or( - new Field( "analises_acidentes.averiguacao_posterior" ).isEqual( "y" ) - .and( new Field( "analises_acidentes.averiguacao_obs" ).isEqual( "" ) ) - ); + Expression states = new Field( "analises_acidentes.estado" ).isEqual( Global.ESTADO_SEG ).or( + new Field( "analises_acidentes.averiguacao_posterior" ).isEqual( "y" ).and( new Field( "analises_acidentes.averiguacao_obs" ).isEqual( "" ) ) ); if ( "y".equals( responsavel_loja ) ) { states = states.or( new Field( "analises_acidentes.estado" ).isEqual( Global.ESTADO_ASSINATURA_SEG ) ); @@ -226,14 +219,26 @@ public class AnalisesDataProvider extends GenericDataProvider where = where.and( states ); Select2 query = new Select2( - new String[] { "analises_acidentes" }, - new Integer[] {}, - new Expression[] {}, - new String[] { "*" }, + new String[] + { + "analises_acidentes" + }, + new Integer[] + { + }, + new Expression[] + { + }, + new String[] + { + "*" + }, where, - new String[] { "analises_acidentes.analise_nr" }, - null, null, null - ); + new String[] + { + "analises_acidentes.analise_nr" + }, + null, null, null ); // String sql = ""; // if ( responsavel_loja.matches( "y" ) ) @@ -259,13 +264,12 @@ public class AnalisesDataProvider extends GenericDataProvider // } Statement st = createStatement(); - ResultSet rs = st.executeQuery( query.toString() ); - ArrayList list = fillAnaliseFields( rs ); - return list; - } - + ResultSet rs = st.executeQuery( query.toString() ); + ArrayList list = fillAnaliseFields( rs ); + return list; + } - public ArrayList searchAnalisesActualRH( Integer estabelecimento_id, + public ArrayList searchAnalisesActualRH( Integer estabelecimento_id, String nome, String visitaDate, String POR, String responsavel_loja, Integer fromYear ) throws Exception { @@ -277,27 +281,27 @@ public class AnalisesDataProvider extends GenericDataProvider Statement st = createStatement(); String sql = getExpression( nome, null, visitaDate, POR ); - if ( responsavel_loja.matches( "y" ) ) - { - sql += "AND (estado = " + Global.ESTADO_RH1 + " OR estado = " + Global.ESTADO_RH2 + + if ( responsavel_loja.matches( "y" ) ) + { + sql += "AND (estado = " + Global.ESTADO_RH1 + " OR estado = " + Global.ESTADO_RH2 + " OR estado = " + Global.ESTADO_ASSINATURA_RH + ") AND estabelecimento_id = " + estabelecimento_id + " ORDER BY analise_nr"; - } - else - { - sql += "AND (estado = " + Global.ESTADO_RH1 + " OR estado = " + Global.ESTADO_RH2 + + } + else + { + sql += "AND (estado = " + Global.ESTADO_RH1 + " OR estado = " + Global.ESTADO_RH2 + ") AND estabelecimento_id = " + estabelecimento_id + " ORDER BY analise_nr"; - } + } ResultSet rs = st.executeQuery( sql ); ArrayList list = fillAnaliseFields( rs ); - return list; + return list; } - public ArrayList getAnalisesActuaisRhList( Integer estabelecimentoID, String responsavel_loja, Integer fromYear ) + public ArrayList getAnalisesActuaisRhList( Integer estabelecimentoID, String responsavel_loja, Integer fromYear ) throws Exception - { + { Expression where = new Field( "apagada" ).isEqual( "n" ); where = where.and( new Field( "estabelecimento_id" ).isEqual( estabelecimentoID ) ); if ( fromYear != null ) @@ -305,8 +309,7 @@ public class AnalisesDataProvider extends GenericDataProvider where = where.and( new Field( "EXTRACT( year FROM analises_acidentes.data_acidente )" ).isEqual( fromYear ) ); } - Expression or = new Field( "estado" ).isEqual( Global.ESTADO_RH1 ) - .or( new Field( "estado" ).isEqual( Global.ESTADO_RH2 ) ); + Expression or = new Field( "estado" ).isEqual( Global.ESTADO_RH1 ).or( new Field( "estado" ).isEqual( Global.ESTADO_RH2 ) ); if ( "y".equals( responsavel_loja ) ) { or = or.or( new Field( "estado" ).isEqual( Global.ESTADO_ASSINATURA_RH ) ); @@ -314,14 +317,26 @@ public class AnalisesDataProvider extends GenericDataProvider where = where.and( or ); Select2 query = new Select2( - new String[] { "analises_acidentes" }, - new Integer[] {}, - new Expression[] {}, - new String[] { "*" }, + new String[] + { + "analises_acidentes" + }, + new Integer[] + { + }, + new Expression[] + { + }, + new String[] + { + "*" + }, where, - new String[] { "analise_nr" }, - null, null, null - ); + new String[] + { + "analise_nr" + }, + null, null, null ); // String sql = ""; // if ( responsavel_loja.matches( "y" ) ) @@ -346,13 +361,12 @@ public class AnalisesDataProvider extends GenericDataProvider // } System.out.println( "\ngetAnalisesActuaisRhList() : " + query.toString() + "\n" ); - - Statement st = createStatement(); - ResultSet rs = st.executeQuery( query.toString() ); - ArrayList list = fillAnaliseFields( rs ); - return list; - } + Statement st = createStatement(); + ResultSet rs = st.executeQuery( query.toString() ); + ArrayList list = fillAnaliseFields( rs ); + return list; + } public ArrayList searchAnalisesActuaisHS( Integer estabelecimento_id, String nome, String estabelecimento, String visitaDate, String POR, Integer fromYear ) @@ -367,36 +381,45 @@ public class AnalisesDataProvider extends GenericDataProvider String sql = getExpression( nome, estabelecimento, visitaDate, POR ); sql += "AND (estado = " + Global.ESTADO_HS + " OR estado = " + Global.ESTADO_FECHAR + - " OR estado = " + Global.ESTADO_CONSOLIDACAO + ")" + - " ORDER BY analise_nr"; + " OR estado = " + Global.ESTADO_CONSOLIDACAO + ")" + + " ORDER BY analise_nr"; ResultSet rs = st.executeQuery( sql ); ArrayList list = fillAnaliseFields( rs ); - return list; + return list; } - public ArrayList getAnalisesActuaisHsList( Integer estabelecimentoID, Integer fromYear ) throws Exception - { + public ArrayList getAnalisesActuaisHsList( Integer estabelecimentoID, Integer fromYear ) throws Exception + { Expression where = new Field( "apagada" ).isEqual( "n" ).and( - new Field( "estado" ).isEqual( Global.ESTADO_HS ) - .or( new Field( "estado" ).isEqual( Global.ESTADO_FECHAR ) ) - .or( new Field( "estado" ).isEqual( Global.ESTADO_CONSOLIDACAO ) ) - ); + new Field( "estado" ).isEqual( Global.ESTADO_HS ).or( new Field( "estado" ).isEqual( Global.ESTADO_FECHAR ) ).or( new Field( "estado" ).isEqual( Global.ESTADO_CONSOLIDACAO ) ) ); if ( fromYear != null ) { where = where.and( new Field( "EXTRACT( year FROM data_acidente )" ).isEqual( fromYear ) ); } Select2 query = new Select2( - new String[] { "analises_acidentes" }, - new Integer[] {}, - new Expression[] {}, - new String[] { "*" }, + new String[] + { + "analises_acidentes" + }, + new Integer[] + { + }, + new Expression[] + { + }, + new String[] + { + "*" + }, where, - new String[] { "analise_nr" }, - null, null, null - ); - + new String[] + { + "analise_nr" + }, + null, null, null ); + // String sql = "SELECT * " + // "FROM analises_acidentes " + // "WHERE " + @@ -406,22 +429,17 @@ public class AnalisesDataProvider extends GenericDataProvider // "ORDER BY analise_nr"; System.out.println( "\nAnalisesDataProvider . getAnalisesActuaisHsList() : " + query.toString() ); - - Statement st = createStatement(); - ResultSet rs = st.executeQuery( query.toString() ); - ArrayList list = fillAnaliseFields( rs ); - return list; - } - - - + Statement st = createStatement(); + ResultSet rs = st.executeQuery( query.toString() ); + ArrayList list = fillAnaliseFields( rs ); + return list; + } /*************************************************************************/ /******************************* SEGUIMENTO ******************************/ /*************************************************************************/ - - public ArrayList searchAnalisesSeguimentoSeg( Integer estabelecimento_id, + public ArrayList searchAnalisesSeguimentoSeg( Integer estabelecimento_id, String nome, String visitaDate, String POR, String responsavel_loja, Integer fromYear ) throws Exception { @@ -433,55 +451,55 @@ public class AnalisesDataProvider extends GenericDataProvider Statement st = createStatement(); String sql = getExpression( nome, null, visitaDate, POR ); - if ( responsavel_loja.matches( "y" ) ) - { - sql += "AND estabelecimento_id = " + estabelecimento_id + " AND (" + - "estado > " + Global.ESTADO_SEG + " AND estado < " + Global.ESTADO_ASSINATURA_SEG + " AND (" + - "averiguacao_posterior = 'n' OR (averiguacao_posterior = 'y' AND averiguacao_obs <> '')" + - ") " + - "OR (estado > " + Global.ESTADO_ASSINATURA_SEG + " AND estado < " + Global.ESTADO_CONCLUIDO + ")" + + if ( responsavel_loja.matches( "y" ) ) + { + sql += "AND estabelecimento_id = " + estabelecimento_id + " AND (" + + "estado > " + Global.ESTADO_SEG + " AND estado < " + Global.ESTADO_ASSINATURA_SEG + " AND (" + + "averiguacao_posterior = 'n' OR (averiguacao_posterior = 'y' AND averiguacao_obs <> '')" + + ") " + + "OR (estado > " + Global.ESTADO_ASSINATURA_SEG + " AND estado < " + Global.ESTADO_CONCLUIDO + ")" + ")" + " ORDER BY analise_nr"; - } - else - { - sql += "AND estabelecimento_id = " + estabelecimento_id + " AND (" + - "(estado > " + Global.ESTADO_SEG + " AND estado < " + Global.ESTADO_FECHAR + " AND (" + - "averiguacao_posterior = 'n' OR (averiguacao_posterior = 'y' AND averiguacao_obs <> '')" + - ")) OR estado = " + Global.ESTADO_FECHAR + + } + else + { + sql += "AND estabelecimento_id = " + estabelecimento_id + " AND (" + + "(estado > " + Global.ESTADO_SEG + " AND estado < " + Global.ESTADO_FECHAR + " AND (" + + "averiguacao_posterior = 'n' OR (averiguacao_posterior = 'y' AND averiguacao_obs <> '')" + + ")) OR estado = " + Global.ESTADO_FECHAR + ")" + " ORDER BY analise_nr"; - } + } System.out.println( "SQL: " + sql ); ResultSet rs = st.executeQuery( sql ); ArrayList list = fillAnaliseFields( rs ); - return list; + return list; } - public ArrayList getAnalisesSeguimentoSegList( Integer estabelecimento_id, String responsavel_loja, Integer fromYear ) + public ArrayList getAnalisesSeguimentoSegList( Integer estabelecimento_id, String responsavel_loja, Integer fromYear ) throws Exception - { - String sql = null; + { + String sql = null; // TODO : change to Select2 - if ( responsavel_loja.matches( "y" ) ) - { - sql = "SELECT * FROM analises_acidentes WHERE " + + if ( responsavel_loja.matches( "y" ) ) + { + sql = "SELECT * FROM analises_acidentes WHERE " + "estabelecimento_id = " + estabelecimento_id + " AND (" + - "estado > " + Global.ESTADO_SEG + " AND estado < " + Global.ESTADO_ASSINATURA_SEG + " AND (" + - "averiguacao_posterior = 'n' OR (averiguacao_posterior = 'y' AND averiguacao_obs <> '')" + - ") " + - "OR (estado > " + Global.ESTADO_ASSINATURA_SEG + " AND estado < " + Global.ESTADO_CONCLUIDO + ")" + + "estado > " + Global.ESTADO_SEG + " AND estado < " + Global.ESTADO_ASSINATURA_SEG + " AND (" + + "averiguacao_posterior = 'n' OR (averiguacao_posterior = 'y' AND averiguacao_obs <> '')" + + ") " + + "OR (estado > " + Global.ESTADO_ASSINATURA_SEG + " AND estado < " + Global.ESTADO_CONCLUIDO + ")" + ")" + " AND apagada = 'n' "; - } - else - { - sql = "SELECT * FROM analises_acidentes WHERE " + + } + else + { + sql = "SELECT * FROM analises_acidentes WHERE " + "estabelecimento_id = " + estabelecimento_id + " AND (" + - "(estado > " + Global.ESTADO_SEG + " AND estado < " + Global.ESTADO_FECHAR + " AND (" + - "averiguacao_posterior = 'n' OR (averiguacao_posterior = 'y' AND averiguacao_obs <> '')" + - ")) OR estado = " + Global.ESTADO_FECHAR + + "(estado > " + Global.ESTADO_SEG + " AND estado < " + Global.ESTADO_FECHAR + " AND (" + + "averiguacao_posterior = 'n' OR (averiguacao_posterior = 'y' AND averiguacao_obs <> '')" + + ")) OR estado = " + Global.ESTADO_FECHAR + ")" + " AND apagada = 'n' "; - } + } if ( fromYear != null ) { sql += " AND EXTRACT( year FROM analises_acidentes.data_acidente ) = " + fromYear + " "; @@ -491,12 +509,12 @@ public class AnalisesDataProvider extends GenericDataProvider System.out.println( "\ngetAnalisesSeguimentoSegList() : " + sql + "\n" ); Statement st = createStatement(); - ResultSet rs = st.executeQuery( sql ); - ArrayList list = fillAnaliseFields( rs ); - return list; - } + ResultSet rs = st.executeQuery( sql ); + ArrayList list = fillAnaliseFields( rs ); + return list; + } - public ArrayList searchAnalisesSeguimentoHS( Integer estabelecimento_id, + public ArrayList searchAnalisesSeguimentoHS( Integer estabelecimento_id, String nome, String estabelecimento, String visitaDate, String POR, Integer fromYear ) throws Exception { @@ -508,39 +526,48 @@ public class AnalisesDataProvider extends GenericDataProvider Statement st = createStatement(); String sql = getExpression( nome, estabelecimento, visitaDate, POR ); - sql += "AND (" + - "estado < " + Global.ESTADO_HS + " OR (estado > " + Global.ESTADO_HS + " AND estado < " + Global.ESTADO_CONSOLIDACAO + ") " + - "OR (estado > " + Global.ESTADO_CONSOLIDACAO + " AND estado < " + Global.ESTADO_FECHAR + ")" + + sql += "AND (" + + "estado < " + Global.ESTADO_HS + " OR (estado > " + Global.ESTADO_HS + " AND estado < " + Global.ESTADO_CONSOLIDACAO + ") " + + "OR (estado > " + Global.ESTADO_CONSOLIDACAO + " AND estado < " + Global.ESTADO_FECHAR + ")" + ")" + " ORDER BY analise_nr"; ResultSet rs = st.executeQuery( sql ); ArrayList list = fillAnaliseFields( rs ); - return list; + return list; } - public ArrayList getAnalisesSeguimentoHsList( Integer estabelecimentoID, Integer fromYear ) + public ArrayList getAnalisesSeguimentoHsList( Integer estabelecimentoID, Integer fromYear ) throws Exception - { + { Expression where = new Field( "analises_acidentes.apagada" ).isEqual( "n" ); if ( fromYear != null ) { where = where.and( new Field( "EXTRACT( year FROM analises_acidentes.data_acidente )" ).isEqual( fromYear ) ); } where = where.and( - new Field( "estado" ).isLess( Global.ESTADO_HS ) - .or( new Field( "estado" ).isGreater( Global.ESTADO_HS ).and( new Field( "estado" ).isLess( Global.ESTADO_CONSOLIDACAO ) ) ) - .or( new Field( "estado" ).isGreater( Global.ESTADO_CONSOLIDACAO ).and( new Field( "estado" ).isLess( Global.ESTADO_FECHAR ) ) ) - ); + new Field( "estado" ).isLess( Global.ESTADO_HS ).or( new Field( "estado" ).isGreater( Global.ESTADO_HS ).and( new Field( "estado" ).isLess( Global.ESTADO_CONSOLIDACAO ) ) ).or( new Field( "estado" ).isGreater( Global.ESTADO_CONSOLIDACAO ).and( new Field( "estado" ).isLess( Global.ESTADO_FECHAR ) ) ) ); Select2 query = new Select2( - new String[] { "analises_acidentes" }, - new Integer[] {}, - new Expression[] {}, - new String[] { "*" }, + new String[] + { + "analises_acidentes" + }, + new Integer[] + { + }, + new Expression[] + { + }, + new String[] + { + "*" + }, where, - new String[] { "analises_acidentes.analise_nr" }, - null, null, null - ); + new String[] + { + "analises_acidentes.analise_nr" + }, + null, null, null ); // String sql = null; // sql = "SELECT * FROM analises_acidentes WHERE (" + @@ -551,14 +578,13 @@ public class AnalisesDataProvider extends GenericDataProvider // AND estabelecimento_id = " + estabelecimento_id; Statement st = createStatement(); - ResultSet rs = st.executeQuery( query.toString() ); - System.out.println( "SEGUIMENTO HS SQL : " + query.toString() ); - ArrayList list = fillAnaliseFields( rs ); - return list; - } - + ResultSet rs = st.executeQuery( query.toString() ); + System.out.println( "SEGUIMENTO HS SQL : " + query.toString() ); + ArrayList list = fillAnaliseFields( rs ); + return list; + } - public ArrayList searchAnalisesSeguimentoRH( Integer estabelecimento_id, + public ArrayList searchAnalisesSeguimentoRH( Integer estabelecimento_id, String nome, String visitaDate, String POR, String responsavel_loja, Integer fromYear ) throws Exception { @@ -570,30 +596,30 @@ public class AnalisesDataProvider extends GenericDataProvider Statement st = createStatement(); String sql = getExpression( nome, null, visitaDate, POR ); - if ( responsavel_loja.matches( "y" ) ) - { - sql += "AND (estado = " + Global.ESTADO_SEG + " OR estado = " + Global.ESTADO_HS + - " OR estado = " + Global.ESTADO_CONSOLIDACAO + " OR estado = " + Global.ESTADO_ASSINATURA_SEG + + if ( responsavel_loja.matches( "y" ) ) + { + sql += "AND (estado = " + Global.ESTADO_SEG + " OR estado = " + Global.ESTADO_HS + + " OR estado = " + Global.ESTADO_CONSOLIDACAO + " OR estado = " + Global.ESTADO_ASSINATURA_SEG + " OR estado = " + Global.ESTADO_FECHAR + ") AND estabelecimento_id = " + estabelecimento_id + " ORDER BY analise_nr"; - } - else - { - sql += "AND ( estado = " + Global.ESTADO_SEG + " OR estado = " + Global.ESTADO_HS + - " OR estado = " + Global.ESTADO_CONSOLIDACAO + " OR estado = " + Global.ESTADO_ASSINATURA_SEG + - " OR estado = " + Global.ESTADO_ASSINATURA_RH + " OR estado = " + Global.ESTADO_FECHAR + - ") AND estabelecimento_id = " + estabelecimento_id + + } + else + { + sql += "AND ( estado = " + Global.ESTADO_SEG + " OR estado = " + Global.ESTADO_HS + + " OR estado = " + Global.ESTADO_CONSOLIDACAO + " OR estado = " + Global.ESTADO_ASSINATURA_SEG + + " OR estado = " + Global.ESTADO_ASSINATURA_RH + " OR estado = " + Global.ESTADO_FECHAR + + ") AND estabelecimento_id = " + estabelecimento_id + " ORDER BY analise_nr"; - } + } ResultSet rs = st.executeQuery( sql ); ArrayList list = fillAnaliseFields( rs ); - return list; + return list; } - public ArrayList getAnalisesSeguimentoRhList( Integer estabelecimentoID, String responsavel_loja, Integer fromYear ) + public ArrayList getAnalisesSeguimentoRhList( Integer estabelecimentoID, String responsavel_loja, Integer fromYear ) throws Exception - { + { Expression where = new Field( "apagada" ).isEqual( "n" ); where = where.and( new Field( "estabelecimento_id" ).isEqual( estabelecimentoID ) ); if ( fromYear != null ) @@ -606,28 +632,39 @@ public class AnalisesDataProvider extends GenericDataProvider or = or.or( new Field( "estado" ).isEqual( Global.ESTADO_CONSOLIDACAO ) ); or = or.or( new Field( "estado" ).isEqual( Global.ESTADO_ASSINATURA_SEG ) ); or = or.or( new Field( "estado" ).isEqual( Global.ESTADO_FECHAR ) ); - if ( ! "y".equals( responsavel_loja ) ) + if ( !"y".equals( responsavel_loja ) ) { or = or.or( new Field( "estado" ).isEqual( Global.ESTADO_ASSINATURA_RH ) ); } where = where.and( or ); Select2 query = new Select2( - new String[] { "analises_acidentes" }, - new Integer[] {}, - new Expression[] {}, - new String[] { "*" }, + new String[] + { + "analises_acidentes" + }, + new Integer[] + { + }, + new Expression[] + { + }, + new String[] + { + "*" + }, where, - new String[] { "analise_nr" }, - null, null, null - ); + new String[] + { + "analise_nr" + }, + null, null, null ); Statement st = createStatement(); - ResultSet rs = st.executeQuery( query.toString() ); - ArrayList list = fillAnaliseFields( rs ); - return list; - } - + ResultSet rs = st.executeQuery( query.toString() ); + ArrayList list = fillAnaliseFields( rs ); + return list; + } public ArrayList searchAnalisesSeguimentoMedico( Integer estabelecimento_id, String nome, String visitaDate, String POR, Integer fromYear ) throws Exception @@ -638,21 +675,21 @@ public class AnalisesDataProvider extends GenericDataProvider } Statement st = createStatement(); - String sql = getExpression( nome, null, visitaDate, POR ); + String sql = getExpression( nome, null, visitaDate, POR ); - sql += "AND 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 + - " ORDER BY analise_nr"; + sql += "AND 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 + + " ORDER BY analise_nr"; - ResultSet rs = st.executeQuery(sql); - ArrayList list = fillAnaliseFields(rs); - return list; + ResultSet rs = st.executeQuery( sql ); + ArrayList list = fillAnaliseFields( rs ); + return list; } - public ArrayList getAnalisesSeguimentoMedList( Integer estabelecimentoID, Integer fromYear ) + public ArrayList getAnalisesSeguimentoMedList( Integer estabelecimentoID, Integer fromYear ) throws Exception - { + { // 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') " + @@ -671,37 +708,38 @@ public class AnalisesDataProvider extends GenericDataProvider where = where.and( new Field( "EXTRACT( year FROM analises_acidentes.data_acidente )" ).isEqual( fromYear ) ); } where = where.and( - new Field( "analises_acidentes.estado" ).isLess( 5 ) - .or( - new Field( "analises_acidentes.estado" ).isEqual( 6 ) - .and( new Field( "analises_acidentes.estado_assinatura" ).isDifferent( 2 ) ) - ) - .or( - new Field( "analises_acidentes.estado" ).isEqual( 6 ) - .and( new Field( "analises_acidentes.estado_assinatura" ).isEqual( 2 ) ) - .and( new Field( "analises_acidentes.ass_med" ).isEqual( "y" ) ) - ) - .or( - new Field( "analises_acidentes.estado" ).isGreater( 6 ) - .and( new Field( "analises_acidentes.estado" ).isLess( 9 ) ) - ) - ); + new Field( "analises_acidentes.estado" ).isLess( 5 ).or( + new Field( "analises_acidentes.estado" ).isEqual( 6 ).and( new Field( "analises_acidentes.estado_assinatura" ).isDifferent( 2 ) ) ).or( + new Field( "analises_acidentes.estado" ).isEqual( 6 ).and( new Field( "analises_acidentes.estado_assinatura" ).isEqual( 2 ) ).and( new Field( "analises_acidentes.ass_med" ).isEqual( "y" ) ) ).or( + new Field( "analises_acidentes.estado" ).isGreater( 6 ).and( new Field( "analises_acidentes.estado" ).isLess( 9 ) ) ) ); Select2 query = new Select2( - new String[] { "analises_acidentes" }, - new Integer[] {}, - new Expression[] {}, - new String[] { "*" }, + new String[] + { + "analises_acidentes" + }, + new Integer[] + { + }, + new Expression[] + { + }, + new String[] + { + "*" + }, where, - new String[] { "analises_acidentes.analise_nr" }, - null, null, null - ); + new String[] + { + "analises_acidentes.analise_nr" + }, + null, null, null ); Statement st = createStatement(); - ResultSet rs = st.executeQuery( query.toString() ); - ArrayList list = fillAnaliseFields( rs ); - return list; - } + ResultSet rs = st.executeQuery( query.toString() ); + ArrayList list = fillAnaliseFields( rs ); + return list; + } public ArrayList searchAnalisesSeguimentoDirSiprp( String nome, String estabelecimento, String visitaDate, String POR, Integer fromYear ) throws Exception @@ -711,17 +749,17 @@ public class AnalisesDataProvider extends GenericDataProvider return getAnalisesSeguimentoDirSiprpList( fromYear ); } - String sql = getExpression( nome, estabelecimento, visitaDate, POR ); - sql += " AND estado < " + Global.ESTADO_CONCLUIDO + " ORDER BY analise_nr"; + String sql = getExpression( nome, estabelecimento, visitaDate, POR ); + sql += " AND estado < " + Global.ESTADO_CONCLUIDO + " ORDER BY analise_nr"; Statement st = createStatement(); - ResultSet rs = st.executeQuery( sql ); - ArrayList list = fillAnaliseFields( rs ); - return list; + ResultSet rs = st.executeQuery( sql ); + ArrayList list = fillAnaliseFields( rs ); + return list; } - public ArrayList getAnalisesSeguimentoDirSiprpList( Integer fromYear ) throws Exception - { + public ArrayList getAnalisesSeguimentoDirSiprpList( Integer fromYear ) throws Exception + { Expression where = new Field( "apagada" ).isEqual( "n" ); where = where.and( new Field( "estado" ).isLess( Global.ESTADO_CONCLUIDO ) ); if ( fromYear != null ) @@ -730,34 +768,46 @@ public class AnalisesDataProvider extends GenericDataProvider } Select2 query = new Select2( - new String[] { "analises_acidentes" }, - new Integer[] {}, - new Expression[] {}, - new String[] { "*" }, + new String[] + { + "analises_acidentes" + }, + new Integer[] + { + }, + new Expression[] + { + }, + new String[] + { + "*" + }, where, - new String[] { "analise_nr" }, - null, null, null - ); - + new String[] + { + "analise_nr" + }, + null, null, null ); + Statement st = createStatement(); - ResultSet rs = st.executeQuery( query.toString() ); - ArrayList list = fillAnaliseFields( rs ); - return list; - } + ResultSet rs = st.executeQuery( query.toString() ); + ArrayList list = fillAnaliseFields( rs ); + return list; + } - public ArrayList searchAnalisesSeguimentoDirGerRh( + public ArrayList searchAnalisesSeguimentoDirGerRh( String nome, String estabelecimento, String visitaDate, String POR, Integer fromYear ) throws Exception { return searchAnalisesSeguimentoDirSiprp( nome, estabelecimento, visitaDate, POR, fromYear ); } - public ArrayList getAnalisesSeguimentoDirGerRhList( Integer fromYear ) throws Exception - { + public ArrayList getAnalisesSeguimentoDirGerRhList( Integer fromYear ) throws Exception + { return getAnalisesSeguimentoDirSiprpList( fromYear ); - } + } - public ArrayList searchAnalisesSeguimentoGestor( Integer estabelecimento_id, + public ArrayList searchAnalisesSeguimentoGestor( Integer estabelecimento_id, String nome, String estabelecimento, String visitaDate, String POR, Integer fromYear ) throws Exception { @@ -767,23 +817,23 @@ public class AnalisesDataProvider extends GenericDataProvider } Statement st = createStatement(); - String sql = getExpression( nome, estabelecimento, visitaDate, POR ); + String sql = getExpression( nome, estabelecimento, visitaDate, POR ); sql += "AND estado < " + Global.ESTADO_CONCLUIDO + " "; - if ( estabelecimento_id != null ) - { - sql += " AND estabelecimento_id = " + estabelecimento_id + " "; - } + if ( estabelecimento_id != null ) + { + sql += " AND estabelecimento_id = " + estabelecimento_id + " "; + } sql += " ORDER BY analise_nr"; - - ResultSet rs = st.executeQuery( sql ); - ArrayList list = fillAnaliseFields( rs ); - return list; + + ResultSet rs = st.executeQuery( sql ); + ArrayList list = fillAnaliseFields( rs ); + return list; } - public ArrayList getAnalisesSeguimentoGestorList( Integer estabelecimentoID, Integer fromYear ) + public ArrayList getAnalisesSeguimentoGestorList( Integer estabelecimentoID, Integer fromYear ) throws Exception - { + { Expression where = new Field( "apagada" ).isEqual( "n" ); where = where.and( new Field( "estado" ).isLess( Global.ESTADO_CONCLUIDO ) ); if ( estabelecimentoID != null ) @@ -796,32 +846,39 @@ public class AnalisesDataProvider extends GenericDataProvider } Select2 query = new Select2( - new String[] { "analises_acidentes" }, - new Integer[] {}, - new Expression[] {}, - new String[] { "*" }, + new String[] + { + "analises_acidentes" + }, + new Integer[] + { + }, + new Expression[] + { + }, + new String[] + { + "*" + }, where, - new String[] { "analise_nr" }, - null, null, null - ); + new String[] + { + "analise_nr" + }, + null, null, null ); Statement st = createStatement(); - ResultSet rs = st.executeQuery( query.toString() ); - ArrayList list = fillAnaliseFields( rs ); - return list; - } - - - - + ResultSet rs = st.executeQuery( query.toString() ); + ArrayList list = fillAnaliseFields( rs ); + return list; + } /*************************************************************************/ /****************************** CONCLUIDOS *******************************/ /*************************************************************************/ - - public ArrayList getAnalisesConcluidasList( Integer estabelecimentoID, Integer fromYear ) throws Exception - { - Statement st = createStatement(); + public ArrayList getAnalisesConcluidasList( Integer estabelecimentoID, Integer fromYear ) throws Exception + { + Statement st = createStatement(); Expression where = new Field( "estado" ).isEqual( Global.ESTADO_CONCLUIDO ); where = where.and( new Field( "apagada" ).isEqual( "n" ) ); @@ -835,26 +892,38 @@ public class AnalisesDataProvider extends GenericDataProvider } Select2 query = new Select2( - new String[] { "analises_acidentes" }, - new Integer[] {}, - new Expression[] {}, - new String[] { "*" }, + new String[] + { + "analises_acidentes" + }, + new Integer[] + { + }, + new Expression[] + { + }, + new String[] + { + "*" + }, where, - new String[] { "analise_nr" }, - null, null, null - ); + new String[] + { + "analise_nr" + }, + null, null, null ); System.out.println( "\ngetAnalisesConcluidasList() : " + query.toString() + "\n" ); - - ResultSet rs = st.executeQuery( query.toString() ); - ArrayList list = fillAnaliseFields( rs ); - return list; - } - - public ArrayList getAnalisesConcluidasHsList( Integer fromYear ) throws Exception - { - return getAnalisesConcluidasList( null, fromYear ); - } + + ResultSet rs = st.executeQuery( query.toString() ); + ArrayList list = fillAnaliseFields( rs ); + return list; + } + + public ArrayList getAnalisesConcluidasHsList( Integer fromYear ) throws Exception + { + return getAnalisesConcluidasList( null, fromYear ); + } public ArrayList searchAnalisesConcluidasList( Integer estabelecimento_id, Integer ano, Integer mes, Integer dia, String POR, String nome, String estabelecimento, Integer fromYear ) @@ -925,7 +994,7 @@ public class AnalisesDataProvider extends GenericDataProvider { sql += " AND EXTRACT( year FROM analises_acidentes.data_acidente ) = " + fromYear + " "; } - + sql += " ORDER BY analises_acidentes.analise_nr ASC "; System.out.println( "CONCLUIDAS SQL: " + sql ); @@ -936,7 +1005,6 @@ public class AnalisesDataProvider extends GenericDataProvider return list; } - //by lino // public ArrayList searchAanalisesConcluidasList( Integer estabelecimento_id, // Integer ano, Integer mes, Integer dia, String por, String nome, String estabelecimento ) @@ -1275,1702 +1343,1738 @@ public class AnalisesDataProvider extends GenericDataProvider // // return list; // } - - private ArrayList fillAnaliseFields( ResultSet rs ) throws Exception - { + private ArrayList fillAnaliseFields( ResultSet rs ) throws Exception + { // Dblocal dblocal = new Dblocal(); // dblocal.connect(); // Statement stlocal = dblocal.createStatement(); // Statement stlocal1 = dblocal.createStatement(); - - ArrayList list = new ArrayList(); - if ( ! rs.isBeforeFirst() ) //rs empty - { - return list; - } - - Statement stlocal = createLocalStatement(); - Statement stlocal1 = createLocalStatement(); - - 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.setEmpresa_id(new Integer(rs.getInt("empresa_id"))); - a.setEstabelecimento_id(new Integer(rs.getInt("estabelecimento_id"))); - String sqllocal1 = "SELECT nome FROM estabelecimentos WHERE id = " + a.getEstabelecimento_id(); - ResultSet rslocal1 = stlocal1.executeQuery(sqllocal1); - rslocal1.first(); - a.setNome_estabelecimento( utils.Utils.unicodeToHTML( rslocal1.getString("nome") ) ); - - a.setEstado(new Integer(rs.getInt("estado"))); - 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, numero_mecanografico FROM trabalhadores WHERE id = " + ac.getTrabalhador_id(); - ResultSet rslocal = stlocal.executeQuery(sqllocal); + + ArrayList list = new ArrayList(); + if ( !rs.isBeforeFirst() ) //rs empty + { + return list; + } + + Statement stlocal = createLocalStatement(); + Statement stlocal1 = createLocalStatement(); + + 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.setEmpresa_id( new Integer( rs.getInt( "empresa_id" ) ) ); + a.setEstabelecimento_id( new Integer( rs.getInt( "estabelecimento_id" ) ) ); + String sqllocal1 = "SELECT nome FROM estabelecimentos WHERE id = " + a.getEstabelecimento_id(); + ResultSet rslocal1 = stlocal1.executeQuery( sqllocal1 ); + rslocal1.first(); + a.setNome_estabelecimento( utils.Utils.unicodeToHTML( rslocal1.getString( "nome" ) ) ); + + a.setEstado( new Integer( rs.getInt( "estado" ) ) ); + 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, numero_mecanografico FROM trabalhadores WHERE id = " + ac.getTrabalhador_id(); + ResultSet rslocal = stlocal.executeQuery( sqllocal ); String nome_acidentado = ""; String numero_mecanografico = ""; if ( rslocal.first() ) { - nome_acidentado = rslocal.getString("nome"); + nome_acidentado = rslocal.getString( "nome" ); numero_mecanografico = rslocal.getString( "numero_mecanografico" ); } - a.setNome_acidentado(utils.Utils.unicodeToHTML(nome_acidentado)); - a.setNumero_mecanografico( numero_mecanografico ); - Object horas_turno = rs.getObject("horas_turno"); - if(horas_turno == null) - { - a.setHoras_turno(null); - } - else - { - a.setHoras_turno(new Integer(rs.getInt("horas_turno"))); - } - - a.setAveriguador(rs.getString("averiguador")); - //a.setSeccao(rs.getString("seccao")); - a.setDepartamento_id( new Integer(rs.getInt("departamento_id")) ); - a.setSeccao_id( new Integer(rs.getInt("seccao_id")) ); - 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( new Integer(rs.getInt("causas")) ); - a.setDescricao(rs.getString("descricao")); - a.setConclusoes(rs.getString("conclusoes")); - a.setAccoes(rs.getString("accoes")); - a.setAveriguacao_posterior(rs.getString("averiguacao_posterior")); - a.setAveriguacao_obs(rs.getString("averiguacao_obs")); - - 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.setCoef_incapacidade((Integer) rs.getObject("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")); - a.setAss_consolidacao(rs.getString("ass_consolidacao")); - a.setData_consolidacao(rs.getDate("data_consolidacao")); - a.setData_assinatura_seg(rs.getDate("data_assinatura_seg")); - a.setData_assinatura_rh(rs.getDate("data_assinatura_rh")); - a.setNome_resp_seg(rs.getString("nome_resp_seg")); - a.setNome_resp_rh(rs.getString("nome_resp_rh")); - a.setCorrecao(rs.getString("correcao")); - a.setObservacoes_correcao(rs.getString("observacoes_correcao")); - a.setEstado_antes_correcao( new Integer(rs.getInt("estado_antes_correcao"))); - a.setAss_superior(rs.getString("ass_superior")); - a.setNome_superior(rs.getString("nome_superior")); - a.setData_assinatura_superior(rs.getDate("data_assinatura_superior")); - a.setData_inicio_processo(rs.getDate("data_inicio_processo")); - a.setNome_resp_consolidacao(rs.getString("nome_resp_consolidacao")); - //System.out.println("ANALISE NR : " + a.getAnalise_nr()); - a.setRh_fase4(new Integer( rs.getInt("rh_fase4") )); - - a.setConcluido_por_desactivacao( rs.getBoolean( "concluido_por_desactivacao" ) ); - a.setData_desactivacao( rs.getDate( "data_desactivacao" ) ); - a.setComentario_desactivacao( rs.getString( "comentario_desactivacao" ) ); - list.add( a ); - } while ( rs.next() ); - - return list; - } - - public ArrayList searchTrabalhador(Integer empresa_id, Integer estabelecimento_id, String nrMecanografico, String nome) - throws Exception - { - ArrayList list = new ArrayList(); - -// Dblocal dblocal = new Dblocal(); -// dblocal.connect(); -// Statement stlocal = dblocal.createStatement(); - Statement stlocal = createLocalStatement(); - - String sql = ""; - // trabalhadores do estabelecimento - if(nrMecanografico != null) - { - if(nome != null) - { - sql = "SELECT trabalhadores.id, trabalhadores.nome, data_nascimento, funcao_proposta, data_admissao, numero_mecanografico , estabelecimentos.id, estabelecimentos.nome FROM trabalhadores, estabelecimentos WHERE estabelecimento_id = estabelecimentos.id AND estabelecimento_id = " + estabelecimento_id + " AND (trabalhadores.nome LIKE '%" + nome + "%' OR LOWER(numero_mecanografico) LIKE '%" + nrMecanografico.toLowerCase() + "%') AND estabelecimentos.empresa_id = " + empresa_id + " AND trabalhadores.inactivo = 'n'"; - } - else - { - sql = "SELECT trabalhadores.id, trabalhadores.nome, data_nascimento, funcao_proposta, data_admissao, numero_mecanografico , estabelecimentos.id, estabelecimentos.nome FROM trabalhadores, estabelecimentos WHERE estabelecimento_id = estabelecimentos.id AND estabelecimento_id = " + estabelecimento_id + " AND LOWER(numero_mecanografico) LIKE '%" + nrMecanografico.toLowerCase() + "%' AND estabelecimentos.empresa_id = " + empresa_id + " AND trabalhadores.inactivo = 'n'"; - } - } - else - { - if(nome != null) - { - sql = "SELECT trabalhadores.id, trabalhadores.nome, data_nascimento, funcao_proposta, data_admissao, numero_mecanografico , estabelecimentos.id, estabelecimentos.nome FROM trabalhadores, estabelecimentos WHERE estabelecimento_id = estabelecimentos.id AND estabelecimento_id = " + estabelecimento_id + " AND trabalhadores.nome LIKE '%" + nome + "%' AND estabelecimentos.empresa_id = " + empresa_id + " AND trabalhadores.inactivo = 'n'"; - } - } - - System.out.println("TRABALHADORES SQL B : " + sql); - ResultSet rslocal = stlocal.executeQuery(sql); - if(rslocal.isBeforeFirst()) - { - rslocal.first(); - do - { - Trabalhador t = new Trabalhador(); - t.setId(new Integer(rslocal.getInt(1))); //id - String nome_trab = rslocal.getString(2); - t.setNome(utils.Utils.unicodeToHTML(nome_trab)); - 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")); - t.setEstabelecimento_id(new Integer( rslocal.getInt(7) )); - //if(nome != null) - //{ - t.setEstabelecimento(utils.Utils.unicodeToHTML(rslocal.getString(8))); - //} - - list.add(t); - }while(rslocal.next()); - } - - - //restantes trabalhadores - if(nrMecanografico != null) - { - if(nome != null) - { - sql = "SELECT trabalhadores.id, trabalhadores.nome, data_nascimento, funcao_proposta, data_admissao, numero_mecanografico , estabelecimentos.id, estabelecimentos.nome FROM trabalhadores, estabelecimentos WHERE estabelecimento_id = estabelecimentos.id AND estabelecimento_id <> " + estabelecimento_id + " AND (trabalhadores.nome LIKE '%" + nome + "%' OR LOWER(numero_mecanografico) LIKE '%" + nrMecanografico.toLowerCase() + "%') AND estabelecimentos.empresa_id = " + empresa_id + " AND trabalhadores.inactivo = 'n'"; - } - else - { - sql = "SELECT trabalhadores.id, trabalhadores.nome, data_nascimento, funcao_proposta, data_admissao, numero_mecanografico , estabelecimentos.id, estabelecimentos.nome FROM trabalhadores, estabelecimentos WHERE estabelecimento_id = estabelecimentos.id AND estabelecimento_id <> " + estabelecimento_id + " AND LOWER(numero_mecanografico) LIKE '%" + nrMecanografico.toLowerCase() + "%' AND estabelecimentos.empresa_id = " + empresa_id + " AND trabalhadores.inactivo = 'n'"; - } - } - else - { - if(nome != null) - { - sql = "SELECT trabalhadores.id, trabalhadores.nome, data_nascimento, funcao_proposta, data_admissao, numero_mecanografico , estabelecimentos.id, estabelecimentos.nome FROM trabalhadores, estabelecimentos WHERE estabelecimento_id = estabelecimentos.id AND estabelecimento_id <> " + estabelecimento_id + " AND trabalhadores.nome LIKE '%" + nome + "%' AND estabelecimentos.empresa_id = " + empresa_id + " AND trabalhadores.inactivo = 'n'"; - } - } - - -// if(nrMecanografico != null) -// { -// sql = "SELECT * FROM trabalhadores WHERE LOWER(numero_mecanografico) = '" + nrMecanografico.toLowerCase() + "'"; -// } -// else if(nome != null) -// { -// sql = "SELECT trabalhadores.id, trabalhadores.nome, data_nascimento, funcao_proposta, data_admissao, numero_mecanografico , estabelecimentos.nome FROM trabalhadores, estabelecimentos WHERE estabelecimento_id = estabelecimentos.id AND trabalhadores.nome LIKE '%" + nome + "%'"; -// } - System.out.println("TRABALHADORES SQL : " + sql); - rslocal = stlocal.executeQuery(sql); - if(rslocal.isBeforeFirst()) - { - rslocal.first(); - do - { - Trabalhador t = new Trabalhador(); - t.setId(new Integer(rslocal.getInt(1))); //id - String nome_trab = rslocal.getString(2); - t.setNome(utils.Utils.unicodeToHTML(nome_trab)); - 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")); - t.setEstabelecimento_id(new Integer( rslocal.getInt(7) )); - //if(nome != null) - //{ - t.setEstabelecimento(utils.Utils.unicodeToHTML(rslocal.getString(8))); - //} - - list.add(t); - }while(rslocal.next()); - } - return list; - } - - public ArrayList searchTrabalhador(Integer empresa_id, String nrMecanografico, String nome) throws Exception - { - ArrayList list = new ArrayList(); - -// Dblocal dblocal = new Dblocal(); -// dblocal.connect(); -// Statement stlocal = dblocal.createStatement(); - Statement stlocal = createLocalStatement(); - - String sql = ""; - - StringTokenizer st = null; - - if(nrMecanografico != null) - { - if(nome != null) - { - String sql1 = "SELECT trabalhadores.id, trabalhadores.nome, data_nascimento, funcao_proposta, data_admissao, numero_mecanografico , estabelecimentos.id, estabelecimentos.nome FROM trabalhadores, estabelecimentos WHERE estabelecimento_id = estabelecimentos.id AND ("; - String sql2 = ""; - String sql3 = ") AND LOWER(numero_mecanografico) LIKE '%" + nrMecanografico.toLowerCase() + "%' AND estabelecimentos.empresa_id = " + empresa_id + " AND trabalhadores.inactivo = 'n'"; - st = new StringTokenizer (nome); - int n = 0; - while (st.hasMoreTokens ()) { - if(n > 0) - { - sql2 += "AND "; - } - sql2 += "trabalhadores.nome LIKE '%" + st.nextToken () + "%' "; - n++; - } - sql = sql1 + sql2 + sql3; - //sql = "SELECT trabalhadores.id, trabalhadores.nome, data_nascimento, funcao_proposta, data_admissao, numero_mecanografico , estabelecimentos.id, estabelecimentos.nome FROM trabalhadores, estabelecimentos WHERE estabelecimento_id = estabelecimentos.id AND (trabalhadores.nome LIKE '%" + nome + "%' AND LOWER(numero_mecanografico) LIKE '%" + nrMecanografico.toLowerCase() + "%') AND estabelecimentos.empresa_id = " + empresa_id; - } - else - { - sql = "SELECT trabalhadores.id, trabalhadores.nome, data_nascimento, funcao_proposta, data_admissao, numero_mecanografico , estabelecimentos.id, estabelecimentos.nome FROM trabalhadores, estabelecimentos WHERE estabelecimento_id = estabelecimentos.id AND LOWER(numero_mecanografico) LIKE '%" + nrMecanografico.toLowerCase() + "%' AND estabelecimentos.empresa_id = " + empresa_id + " AND trabalhadores.inactivo = 'n'"; - } - } - else - { - if(nome != null) - { - //sql = "SELECT trabalhadores.id, trabalhadores.nome, data_nascimento, funcao_proposta, data_admissao, numero_mecanografico , estabelecimentos.id, estabelecimentos.nome FROM trabalhadores, estabelecimentos WHERE estabelecimento_id = estabelecimentos.id AND trabalhadores.nome LIKE '%" + nome + "%' AND estabelecimentos.empresa_id = " + empresa_id; - String sql1 = "SELECT trabalhadores.id, trabalhadores.nome, data_nascimento, funcao_proposta, data_admissao, numero_mecanografico , estabelecimentos.id, estabelecimentos.nome FROM trabalhadores, estabelecimentos WHERE estabelecimento_id = estabelecimentos.id AND ("; - String sql2 = ""; - String sql3 = ") AND estabelecimentos.empresa_id = " + empresa_id + " AND trabalhadores.inactivo = 'n'"; - st = new StringTokenizer (nome); - int n = 0; - while (st.hasMoreTokens ()) { - if(n > 0) - { - sql2 += "AND "; - } - sql2 += "trabalhadores.nome LIKE '%" + st.nextToken () + "%' "; - n++; - } - sql = sql1 + sql2 + sql3; - - } - } - - System.out.println("TRABALHADORES SQL A : " + sql); -// if(nrMecanografico != null) -// { -// sql = "SELECT * FROM trabalhadores WHERE LOWER(numero_mecanografico) = '" + nrMecanografico.toLowerCase() + "'"; -// } -// else if(nome != null) -// { -// sql = "SELECT trabalhadores.id, trabalhadores.nome, data_nascimento, funcao_proposta, data_admissao, numero_mecanografico , estabelecimentos.nome FROM trabalhadores, estabelecimentos WHERE estabelecimento_id = estabelecimentos.id AND trabalhadores.nome LIKE '%" + nome + "%'"; -// } - ResultSet rslocal = stlocal.executeQuery(sql); - rslocal.first(); - do - { - Trabalhador t = new Trabalhador(); - t.setId(new Integer(rslocal.getInt(1))); //id - String nome_trab = rslocal.getString(2); - t.setNome(utils.Utils.unicodeToHTML(nome_trab)); - 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")); - t.setEstabelecimento_id(new Integer( rslocal.getInt(7) )); - //if(nome != null) - //{ - t.setEstabelecimento(utils.Utils.unicodeToHTML(rslocal.getString(8))); - //} - - list.add(t); - }while(rslocal.next()); - return list; - } - - public ArrayList getTrabalhadoresListByEstabelecimento(Integer estabelecimento_id) throws Exception - { - Utils utils = new Utils(); - ArrayList list = new ArrayList(); + a.setNome_acidentado( utils.Utils.unicodeToHTML( nome_acidentado ) ); + a.setNumero_mecanografico( numero_mecanografico ); + Object horas_turno = rs.getObject( "horas_turno" ); + if ( horas_turno == null ) + { + a.setHoras_turno( null ); + } + else + { + a.setHoras_turno( new Integer( rs.getInt( "horas_turno" ) ) ); + } -// Dblocal dblocal = new Dblocal(); -// dblocal.connect(); + a.setAveriguador( rs.getString( "averiguador" ) ); + //a.setSeccao(rs.getString("seccao")); + a.setDepartamento_id( new Integer( rs.getInt( "departamento_id" ) ) ); + a.setSeccao_id( new Integer( rs.getInt( "seccao_id" ) ) ); + 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( new Integer( rs.getInt( "causas" ) ) ); + a.setDescricao( rs.getString( "descricao" ) ); + a.setConclusoes( rs.getString( "conclusoes" ) ); + a.setAccoes( rs.getString( "accoes" ) ); + a.setAveriguacao_posterior( rs.getString( "averiguacao_posterior" ) ); + a.setAveriguacao_obs( rs.getString( "averiguacao_obs" ) ); + + 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.setCoef_incapacidade( ( Integer ) rs.getObject( "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" ) ); + a.setAss_consolidacao( rs.getString( "ass_consolidacao" ) ); + a.setData_consolidacao( rs.getDate( "data_consolidacao" ) ); + a.setData_assinatura_seg( rs.getDate( "data_assinatura_seg" ) ); + a.setData_assinatura_rh( rs.getDate( "data_assinatura_rh" ) ); + a.setNome_resp_seg( rs.getString( "nome_resp_seg" ) ); + a.setNome_resp_rh( rs.getString( "nome_resp_rh" ) ); + a.setCorrecao( rs.getString( "correcao" ) ); + a.setObservacoes_correcao( rs.getString( "observacoes_correcao" ) ); + a.setEstado_antes_correcao( new Integer( rs.getInt( "estado_antes_correcao" ) ) ); + a.setAss_superior( rs.getString( "ass_superior" ) ); + a.setNome_superior( rs.getString( "nome_superior" ) ); + a.setData_assinatura_superior( rs.getDate( "data_assinatura_superior" ) ); + a.setData_inicio_processo( rs.getDate( "data_inicio_processo" ) ); + a.setNome_resp_consolidacao( rs.getString( "nome_resp_consolidacao" ) ); + //System.out.println("ANALISE NR : " + a.getAnalise_nr()); + a.setRh_fase4( new Integer( rs.getInt( "rh_fase4" ) ) ); + + a.setConcluido_por_desactivacao( rs.getBoolean( "concluido_por_desactivacao" ) ); + a.setData_desactivacao( rs.getDate( "data_desactivacao" ) ); + a.setComentario_desactivacao( rs.getString( "comentario_desactivacao" ) ); + list.add( a ); + } + while ( rs.next() ); + + return list; + } + + public ArrayList searchTrabalhador( Integer empresa_id, Integer estabelecimento_id, String nrMecanografico, String nome ) + throws Exception + { + ArrayList list = new ArrayList(); + +// Dblocal dblocal = new Dblocal(); +// dblocal.connect(); // Statement stlocal = dblocal.createStatement(); - Statement stlocal = createLocalStatement(); - - String sql ="SELECT * FROM trabalhadores WHERE estabelecimento_id = " + estabelecimento_id; - ResultSet rslocal = stlocal.executeQuery(sql); - rslocal.first(); - int nr = 0; - do - { - 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")); - list.add(t); - }while(rslocal.next()); - - return list; - } - - public Trabalhador getTrabalhador(Integer id) throws Exception - { + Statement stlocal = createLocalStatement(); + + String sql = ""; + // trabalhadores do estabelecimento + if ( nrMecanografico != null ) + { + if ( nome != null ) + { + sql = "SELECT trabalhadores.id, trabalhadores.nome, data_nascimento, funcao_proposta, data_admissao, numero_mecanografico , estabelecimentos.id, estabelecimentos.nome FROM trabalhadores, estabelecimentos WHERE estabelecimento_id = estabelecimentos.id AND estabelecimento_id = " + estabelecimento_id + " AND (trabalhadores.nome LIKE '%" + nome + "%' OR LOWER(numero_mecanografico) LIKE '%" + nrMecanografico.toLowerCase() + "%') AND estabelecimentos.empresa_id = " + empresa_id + " AND trabalhadores.inactivo = 'n'"; + } + else + { + sql = "SELECT trabalhadores.id, trabalhadores.nome, data_nascimento, funcao_proposta, data_admissao, numero_mecanografico , estabelecimentos.id, estabelecimentos.nome FROM trabalhadores, estabelecimentos WHERE estabelecimento_id = estabelecimentos.id AND estabelecimento_id = " + estabelecimento_id + " AND LOWER(numero_mecanografico) LIKE '%" + nrMecanografico.toLowerCase() + "%' AND estabelecimentos.empresa_id = " + empresa_id + " AND trabalhadores.inactivo = 'n'"; + } + } + else + { + if ( nome != null ) + { + sql = "SELECT trabalhadores.id, trabalhadores.nome, data_nascimento, funcao_proposta, data_admissao, numero_mecanografico , estabelecimentos.id, estabelecimentos.nome FROM trabalhadores, estabelecimentos WHERE estabelecimento_id = estabelecimentos.id AND estabelecimento_id = " + estabelecimento_id + " AND trabalhadores.nome LIKE '%" + nome + "%' AND estabelecimentos.empresa_id = " + empresa_id + " AND trabalhadores.inactivo = 'n'"; + } + } + + System.out.println( "TRABALHADORES SQL B : " + sql ); + ResultSet rslocal = stlocal.executeQuery( sql ); + if ( rslocal.isBeforeFirst() ) + { + rslocal.first(); + do + { + Trabalhador t = new Trabalhador(); + t.setId( new Integer( rslocal.getInt( 1 ) ) ); //id + String nome_trab = rslocal.getString( 2 ); + t.setNome( utils.Utils.unicodeToHTML( nome_trab ) ); + 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" ) ); + t.setEstabelecimento_id( new Integer( rslocal.getInt( 7 ) ) ); + //if(nome != null) + //{ + t.setEstabelecimento( utils.Utils.unicodeToHTML( rslocal.getString( 8 ) ) ); + //} + + list.add( t ); + } + while ( rslocal.next() ); + } + + + //restantes trabalhadores + if ( nrMecanografico != null ) + { + if ( nome != null ) + { + sql = "SELECT trabalhadores.id, trabalhadores.nome, data_nascimento, funcao_proposta, data_admissao, numero_mecanografico , estabelecimentos.id, estabelecimentos.nome FROM trabalhadores, estabelecimentos WHERE estabelecimento_id = estabelecimentos.id AND estabelecimento_id <> " + estabelecimento_id + " AND (trabalhadores.nome LIKE '%" + nome + "%' OR LOWER(numero_mecanografico) LIKE '%" + nrMecanografico.toLowerCase() + "%') AND estabelecimentos.empresa_id = " + empresa_id + " AND trabalhadores.inactivo = 'n'"; + } + else + { + sql = "SELECT trabalhadores.id, trabalhadores.nome, data_nascimento, funcao_proposta, data_admissao, numero_mecanografico , estabelecimentos.id, estabelecimentos.nome FROM trabalhadores, estabelecimentos WHERE estabelecimento_id = estabelecimentos.id AND estabelecimento_id <> " + estabelecimento_id + " AND LOWER(numero_mecanografico) LIKE '%" + nrMecanografico.toLowerCase() + "%' AND estabelecimentos.empresa_id = " + empresa_id + " AND trabalhadores.inactivo = 'n'"; + } + } + else + { + if ( nome != null ) + { + sql = "SELECT trabalhadores.id, trabalhadores.nome, data_nascimento, funcao_proposta, data_admissao, numero_mecanografico , estabelecimentos.id, estabelecimentos.nome FROM trabalhadores, estabelecimentos WHERE estabelecimento_id = estabelecimentos.id AND estabelecimento_id <> " + estabelecimento_id + " AND trabalhadores.nome LIKE '%" + nome + "%' AND estabelecimentos.empresa_id = " + empresa_id + " AND trabalhadores.inactivo = 'n'"; + } + } + + +// if(nrMecanografico != null) +// { +// sql = "SELECT * FROM trabalhadores WHERE LOWER(numero_mecanografico) = '" + nrMecanografico.toLowerCase() + "'"; +// } +// else if(nome != null) +// { +// sql = "SELECT trabalhadores.id, trabalhadores.nome, data_nascimento, funcao_proposta, data_admissao, numero_mecanografico , estabelecimentos.nome FROM trabalhadores, estabelecimentos WHERE estabelecimento_id = estabelecimentos.id AND trabalhadores.nome LIKE '%" + nome + "%'"; +// } + System.out.println( "TRABALHADORES SQL : " + sql ); + rslocal = stlocal.executeQuery( sql ); + if ( rslocal.isBeforeFirst() ) + { + rslocal.first(); + do + { + Trabalhador t = new Trabalhador(); + t.setId( new Integer( rslocal.getInt( 1 ) ) ); //id + String nome_trab = rslocal.getString( 2 ); + t.setNome( utils.Utils.unicodeToHTML( nome_trab ) ); + 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" ) ); + t.setEstabelecimento_id( new Integer( rslocal.getInt( 7 ) ) ); + //if(nome != null) + //{ + t.setEstabelecimento( utils.Utils.unicodeToHTML( rslocal.getString( 8 ) ) ); + //} + + list.add( t ); + } + while ( rslocal.next() ); + } + return list; + } + + public ArrayList searchTrabalhador( Integer empresa_id, String nrMecanografico, String nome ) throws Exception + { + ArrayList list = new ArrayList(); + // Dblocal dblocal = new Dblocal(); // dblocal.connect(); // Statement stlocal = dblocal.createStatement(); - Statement stlocal = createLocalStatement(); - - String sql ="SELECT * FROM trabalhadores WHERE id = " + id; - ResultSet rslocal = stlocal.executeQuery(sql); - rslocal.first(); - Trabalhador t = new Trabalhador(); - t.setId(new Integer(rslocal.getInt("id"))); - t.setNome(rslocal.getString("nome")); - t.setData_nascimento(rslocal.getDate("data_nascimento")); - t.setFuncao(rslocal.getString("funcao_proposta")); - t.setData_admissao(rslocal.getDate("data_admissao")); - 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.setNumero_mecanografico(rs.getString("numero_mecanografico")); - a.setNome_superior_hierarquico(rs.getString("nome_superior_hierarquico")); - a.setEmail_superior_hierarquico(rs.getString("email_superior_hierarquico")); - a.setEstabelecimento_origem(rs.getString("estabelecimento_origem")); - a.setData_email_superior_hierarquico(rs.getDate("data_email_superior_hierarquico")); - //a.setAnalise_acidente_id(new Integer("analise_acidente_id")); - return a; - } - - public String getEmpresaNome(Integer empresa_id) throws Exception - { + Statement stlocal = createLocalStatement(); + + String sql = ""; + + StringTokenizer st = null; + + if ( nrMecanografico != null ) + { + if ( nome != null ) + { + String sql1 = "SELECT trabalhadores.id, trabalhadores.nome, data_nascimento, funcao_proposta, data_admissao, numero_mecanografico , estabelecimentos.id, estabelecimentos.nome FROM trabalhadores, estabelecimentos WHERE estabelecimento_id = estabelecimentos.id AND ("; + String sql2 = ""; + String sql3 = ") AND LOWER(numero_mecanografico) LIKE '%" + nrMecanografico.toLowerCase() + "%' AND estabelecimentos.empresa_id = " + empresa_id + " AND trabalhadores.inactivo = 'n'"; + st = new StringTokenizer( nome ); + int n = 0; + while ( st.hasMoreTokens() ) + { + if ( n > 0 ) + { + sql2 += "AND "; + } + sql2 += "trabalhadores.nome LIKE '%" + st.nextToken() + "%' "; + n++; + } + sql = sql1 + sql2 + sql3; + //sql = "SELECT trabalhadores.id, trabalhadores.nome, data_nascimento, funcao_proposta, data_admissao, numero_mecanografico , estabelecimentos.id, estabelecimentos.nome FROM trabalhadores, estabelecimentos WHERE estabelecimento_id = estabelecimentos.id AND (trabalhadores.nome LIKE '%" + nome + "%' AND LOWER(numero_mecanografico) LIKE '%" + nrMecanografico.toLowerCase() + "%') AND estabelecimentos.empresa_id = " + empresa_id; + } + else + { + sql = "SELECT trabalhadores.id, trabalhadores.nome, data_nascimento, funcao_proposta, data_admissao, numero_mecanografico , estabelecimentos.id, estabelecimentos.nome FROM trabalhadores, estabelecimentos WHERE estabelecimento_id = estabelecimentos.id AND LOWER(numero_mecanografico) LIKE '%" + nrMecanografico.toLowerCase() + "%' AND estabelecimentos.empresa_id = " + empresa_id + " AND trabalhadores.inactivo = 'n'"; + } + } + else + { + if ( nome != null ) + { + //sql = "SELECT trabalhadores.id, trabalhadores.nome, data_nascimento, funcao_proposta, data_admissao, numero_mecanografico , estabelecimentos.id, estabelecimentos.nome FROM trabalhadores, estabelecimentos WHERE estabelecimento_id = estabelecimentos.id AND trabalhadores.nome LIKE '%" + nome + "%' AND estabelecimentos.empresa_id = " + empresa_id; + String sql1 = "SELECT trabalhadores.id, trabalhadores.nome, data_nascimento, funcao_proposta, data_admissao, numero_mecanografico , estabelecimentos.id, estabelecimentos.nome FROM trabalhadores, estabelecimentos WHERE estabelecimento_id = estabelecimentos.id AND ("; + String sql2 = ""; + String sql3 = ") AND estabelecimentos.empresa_id = " + empresa_id + " AND trabalhadores.inactivo = 'n'"; + st = new StringTokenizer( nome ); + int n = 0; + while ( st.hasMoreTokens() ) + { + if ( n > 0 ) + { + sql2 += "AND "; + } + sql2 += "trabalhadores.nome LIKE '%" + st.nextToken() + "%' "; + n++; + } + sql = sql1 + sql2 + sql3; + + } + } + + System.out.println( "TRABALHADORES SQL A : " + sql ); +// if(nrMecanografico != null) +// { +// sql = "SELECT * FROM trabalhadores WHERE LOWER(numero_mecanografico) = '" + nrMecanografico.toLowerCase() + "'"; +// } +// else if(nome != null) +// { +// sql = "SELECT trabalhadores.id, trabalhadores.nome, data_nascimento, funcao_proposta, data_admissao, numero_mecanografico , estabelecimentos.nome FROM trabalhadores, estabelecimentos WHERE estabelecimento_id = estabelecimentos.id AND trabalhadores.nome LIKE '%" + nome + "%'"; +// } + ResultSet rslocal = stlocal.executeQuery( sql ); + rslocal.first(); + do + { + Trabalhador t = new Trabalhador(); + t.setId( new Integer( rslocal.getInt( 1 ) ) ); //id + String nome_trab = rslocal.getString( 2 ); + t.setNome( utils.Utils.unicodeToHTML( nome_trab ) ); + 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" ) ); + t.setEstabelecimento_id( new Integer( rslocal.getInt( 7 ) ) ); + //if(nome != null) + //{ + t.setEstabelecimento( utils.Utils.unicodeToHTML( rslocal.getString( 8 ) ) ); + //} + + list.add( t ); + } + while ( rslocal.next() ); + return list; + } + + 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(); + Statement stlocal = createLocalStatement(); + + String sql = "SELECT * FROM trabalhadores WHERE estabelecimento_id = " + estabelecimento_id; + ResultSet rslocal = stlocal.executeQuery( sql ); + rslocal.first(); + int nr = 0; + do + { + 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" ) ); + list.add( t ); + } + while ( rslocal.next() ); + + return list; + } + + public Trabalhador getTrabalhador( Integer id ) throws Exception + { +// Dblocal dblocal = new Dblocal(); +// dblocal.connect(); +// Statement stlocal = dblocal.createStatement(); + Statement stlocal = createLocalStatement(); + + String sql = "SELECT * FROM trabalhadores WHERE id = " + id; + ResultSet rslocal = stlocal.executeQuery( sql ); + rslocal.first(); + Trabalhador t = new Trabalhador(); + t.setId( new Integer( rslocal.getInt( "id" ) ) ); + t.setNome( rslocal.getString( "nome" ) ); + t.setData_nascimento( rslocal.getDate( "data_nascimento" ) ); + t.setFuncao( rslocal.getString( "funcao_proposta" ) ); + t.setData_admissao( rslocal.getDate( "data_admissao" ) ); + 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.setNumero_mecanografico( rs.getString( "numero_mecanografico" ) ); + a.setNome_superior_hierarquico( rs.getString( "nome_superior_hierarquico" ) ); + a.setEmail_superior_hierarquico( rs.getString( "email_superior_hierarquico" ) ); + a.setEstabelecimento_origem( rs.getString( "estabelecimento_origem" ) ); + a.setData_email_superior_hierarquico( rs.getDate( "data_email_superior_hierarquico" ) ); + //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(); - Statement stlocal = createLocalStatement(); - - String sql ="SELECT designacao_social FROM empresas WHERE id = " + empresa_id; - ResultSet rslocal = stlocal.executeQuery(sql); - rslocal.first(); - String nome = rslocal.getString("designacao_social"); - return nome; - } - - - - public String getEstabelecimentoNome( Integer estabelecimento_id ) throws Exception - { + Statement stlocal = createLocalStatement(); + + String sql = "SELECT designacao_social FROM empresas WHERE id = " + empresa_id; + ResultSet rslocal = stlocal.executeQuery( sql ); + rslocal.first(); + String nome = rslocal.getString( "designacao_social" ); + return nome; + } + + public String getEstabelecimentoNome( Integer estabelecimento_id ) throws Exception + { // Dblocal dblocal = new Dblocal(); // dblocal.connect(); // Statement stlocal = dblocal.createStatement(); - Statement stlocal = createLocalStatement(); + Statement stlocal = createLocalStatement(); + + String sql = "SELECT nome FROM estabelecimentos WHERE id = " + estabelecimento_id; + ResultSet rslocal = stlocal.executeQuery( sql ); + + String nome = ""; + if ( rslocal.first() ) + { + nome = rslocal.getString( "nome" ); + } + return Utils.unicodeToHTML( nome ); + } + + public String getMedicoNome( Integer medico_id ) throws Exception + { +// Dblocal dblocal = new Dblocal(); +// dblocal.connect(); +// Statement stlocal = dblocal.createStatement(); + Statement stlocal = createLocalStatement(); + + String sql = "SELECT nome FROM medicos WHERE id = " + medico_id; + ResultSet rslocal = stlocal.executeQuery( sql ); + rslocal.first(); + String nome = rslocal.getString( "nome" ); + return Utils.unicodeToHTML( nome ); + } + + public Medico getMedico( Integer id ) throws Exception + { +// Dblocal dblocal = new Dblocal(); +// dblocal.connect(); +// Statement stlocal = dblocal.createStatement(); + Statement stlocal = createLocalStatement(); + + String sql = "SELECT * FROM medicos WHERE id = " + id; + ResultSet rslocal = stlocal.executeQuery( sql ); + rslocal.first(); + Medico m = new Medico(); + m.setId( new Integer( rslocal.getInt( "id" ) ) ); + m.setNome( rslocal.getString( "nome" ) ); + m.setNumero_cedula( rslocal.getString( "numero_cedula" ) ); + return m; + } + + public String getTecnicoSaudeNome( Integer tecnico_id ) throws Exception + { +// Dblocal dblocal = new Dblocal(); +// dblocal.connect(); +// Statement stlocal = dblocal.createStatement(); + Statement stlocal = createLocalStatement(); + + String sql = "SELECT nome FROM marcacoes_tecnicos_hst WHERE id = " + tecnico_id; + ResultSet rslocal = stlocal.executeQuery( sql ); + rslocal.first(); + String nome = rslocal.getString( "nome" ); + 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, nome_superior_hierarquico, email_superior_hierarquico, estabelecimento_origem, data_email_superior_hierarquico) VALUES ("; + sql += newId + ", '"; + sql += a.getNome() + "', "; + if ( a.getData_nascimento() == null ) + { + sql += null + ", '"; + } + else + { + sql += "'" + a.getData_nascimento() + "', '"; + } + //sql += a.getData_nascimento() + "', '"; + sql += a.getBilhete_identidade() + "', '"; + sql += a.getMorada() + "', '"; + sql += a.getCod_postal() + "', '"; + sql += a.getLocalidade() + "', '"; + sql += a.getContacto_telefonico() + "', "; + if ( a.getData_admissao() == null ) + { + sql += null + ", '"; + } + else + { + sql += "'" + a.getData_admissao() + "', '"; + } +// sql += a.getData_admissao() + "', '"; + sql += a.getTurno() + "', '"; + sql += a.getFuncao() + "', "; + sql += a.getTrabalhador_id() + ", '"; + sql += a.getNumero_mecanografico() + "', '"; + sql += a.getNome_superior_hierarquico() + "', '"; + sql += a.getEmail_superior_hierarquico() + "', '"; + sql += a.getEstabelecimento_origem() + "', "; + if ( a.getData_email_superior_hierarquico() == null ) + { + sql += null + ")"; + } + else + { + sql += "'" + a.getData_email_superior_hierarquico() + "')"; + } + //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() + "', "; + if ( a.getData_nascimento() == null ) + { + sql += "data_nascimento = " + null + ", "; + } + else + { + sql += "data_nascimento = '" + a.getData_nascimento() + "', "; + } +// 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() + "', "; + if ( a.getData_admissao() == null ) + { + sql += "data_admissao = " + null + ", "; + } + else + { + sql += "data_admissao = '" + a.getData_admissao() + "', "; + } +// 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 += "nome_superior_hierarquico = '" + a.getNome_superior_hierarquico() + "', "; + sql += "email_superior_hierarquico = '" + a.getEmail_superior_hierarquico() + "', "; + sql += "estabelecimento_origem = '" + a.getEstabelecimento_origem() + "', "; + if ( a.getData_email_superior_hierarquico() == null ) + { + sql += "data_email_superior_hierarquico = " + null + " "; + } + else + { + sql += "data_email_superior_hierarquico = '" + a.getData_email_superior_hierarquico() + "' "; + } + //sql += "analise_acidente_id = '" + a.getAnalise_acidente_id() + " "; + sql += "WHERE id = " + a.getId(); + System.out.println( "SQL UPDATE ACIDENTADO : " + sql ); + st.execute( sql ); + } + + public Integer getMaxControleId() + { + Statement st = createStatement(); + String sql = "SELECT max(controle.id)+1 AS MAXCONTROLEID FROM controle"; + try + { + ResultSet rs = st.executeQuery( sql ); + rs.first(); + Integer newId = new Integer( rs.getInt( "MAXCONTROLEID" ) ); + if ( newId.intValue() == 0 ) + { + newId = new Integer( 1 ); + } + return newId; + } + catch ( Exception ex ) + { + return new Integer( 1 ); + } + } + + public Integer getMaxAnaliseId() + { + Statement st = createStatement(); + String sql = "SELECT max(analises_acidentes.id)+1 AS MAXANALISEID FROM analises_acidentes"; + try + { + 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 ) + { + return new Integer( 1 ); + } + } + + public AnaliseAcidente createAnalise( AnaliseAcidente a ) throws Exception + { + //Controle c = getControle(); + Statement st = createStatement(); + Integer newId = getMaxAnaliseId(); + + //calc analise_nr + java.util.Date data_acidente = new java.util.Date( a.getData_acidente().getTime() ); + //java.util.Date now = new java.util.Date(); + Calendar cal = new GregorianCalendar(); + //cal.setTime(now); + cal.setTime( data_acidente ); + int ano = cal.get( Calendar.YEAR ); + Controle c = getControloByAno( new Integer( ano ) ); + if ( c == null ) + { + c = createAnoNumeracao( new Integer( ano ) ); + } +// if(c.getAnalise_year().intValue() != ano) +// { +// c.setAnalise_year(new Integer(ano)); +// c.setLast_analise_nr(new Integer(0)); +// } + //String seq_str = new Integer(10000 + newId.intValue()).toString(); + int i_analise_nr = c.getLast_analise_nr().intValue() + 1; + c.setLast_analise_nr( new Integer( i_analise_nr ) ); + //updateControle(c); + String seq_str = new Integer( 10000 + i_analise_nr ).toString(); + String ano_str = new Integer( ano ).toString(); + String analise_nr = ano_str.substring( 2 ) + "/" + seq_str.substring( 1 ); + a.setAnalise_nr( analise_nr ); + a.setId( newId ); + + String sql = "INSERT INTO analises_acidentes (id, averiguador, data_acidente, acidentado_id, estado, empresa_id, estabelecimento_id, horas_turno, departamento_id, seccao_id, local_trabalho, tarefa, substancias, condicoes, testemunhas, causas, descricao, conclusoes, accoes, hora_acidente, medico_id, tecnico_saude_id, averiguacao_posterior, averiguacao_obs, data_inicio_processo, analise_nr, coef_incapacidade, concluido_por_desactivacao, data_desactivacao, comentario_desactivacao) VALUES ("; + sql += newId + ", '"; + sql += a.getAveriguador() + "', '"; + sql += a.getData_acidente() + "', "; + sql += a.getAcidentado_id() + ", "; + sql += a.getEstado() + ", "; + sql += a.getEmpresa_id() + ", "; + sql += a.getEstabelecimento_id() + ", "; + sql += a.getHoras_turno() + ", "; + sql += a.getDepartamento_id() + ", "; + sql += a.getSeccao_id() + ", '"; + sql += a.getLocal_trabalho() + "', '"; + sql += a.getTarefa() + "', '"; + sql += a.getSubstancias() + "', '"; +// sql += a.getSuperior_hierarquico() + "', '"; + sql += a.getCondicoes() + "', '"; + sql += a.getTestemunhas() + "', "; + sql += a.getCausas() + ", '"; + sql += a.getDescricao() + "', '"; + sql += a.getConclusoes() + "', '"; + sql += a.getAccoes() + "', "; + if ( a.getHora_acidente() == null ) + { + sql += null + ", "; + } + else + { + sql += "'" + a.getHora_acidente() + "', "; + } + + sql += a.getMedico_id() + ", "; + sql += a.getTecnico_saude_id() + ", '"; + sql += a.getAveriguacao_posterior() + "', '"; + sql += a.getAveriguacao_obs() + "', "; + if ( a.getData_inicio_processo() == null ) + { + sql += null + ", "; + } + else + { + sql += "'" + a.getData_inicio_processo() + "', '"; + } + + sql += analise_nr + "', "; + sql += null + ", "; + + sql += false + ", " + null + ", " + null; //concluido_por_desactivacao, data_desactivacao, comentario_desactivacao + + sql += ")"; + +// sql += null + ")"; +// 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 ); + updateControle( c ); + return a; + } + + 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( "" ); + } + if ( a.getConcluido_por_desactivacao() == null ) + { + a.setConcluido_por_desactivacao( Boolean.FALSE ); + a.setData_desactivacao( null ); + a.setComentario_desactivacao( null ); + } + if ( a.getConcluido_por_desactivacao() != null && a.getConcluido_por_desactivacao().equals( Boolean.TRUE ) && a.getData_desactivacao() == null ) + { + a.setData_desactivacao( new Date() ); + } + if ( a.getComentario_desactivacao() != null && "".equals( a.getComentario_desactivacao().trim() ) ) + { + a.setComentario_desactivacao( null ); + } + + + Statement st = createStatement(); + String sql = "UPDATE analises_acidentes SET data_acidente = '" + a.getData_acidente() + "', "; + 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 += "departamento_id = " + a.getDepartamento_id() + ", "; + sql += "seccao_id = " + a.getSeccao_id() + ", "; + sql += "local_trabalho = '" + a.getLocal_trabalho() + "', "; + sql += "tarefa = '" + a.getTarefa() + "', "; + sql += "substancias = '" + a.getSubstancias() + "', "; +// sql += "superior_hierarquico = '" + a.getSuperior_hierarquico() + "', "; + sql += "condicoes = '" + a.getCondicoes() + "', "; + sql += "testemunhas = '" + a.getTestemunhas() + "', "; + sql += "causas = " + a.getCausas() + ", "; + sql += "descricao = '" + a.getDescricao() + "', "; + sql += "conclusoes = '" + a.getConclusoes() + "', "; + sql += "accoes = '" + a.getAccoes() + "', "; + sql += "averiguador = '" + a.getAveriguador() + "', "; + if ( a.getHora_acidente() == null ) + { + sql += "hora_acidente = " + null + ", "; + } + else + { + 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 += "tecnico_saude_id = " + a.getTecnico_saude_id() + ", "; + sql += "medico_id = " + a.getMedico_id() + ", "; + sql += "ass_consolidacao = '" + a.getAss_consolidacao() + "', "; + sql += "ass_resp_seg = '" + a.getAss_resp_seg() + "', "; + sql += "ass_resp_rh = '" + a.getAss_resp_rh() + "', "; + if ( a.getData_consolidacao() == null ) + { + sql += "data_consolidacao = " + null + ", "; + } + else + { + sql += "data_consolidacao = '" + a.getData_consolidacao() + "', "; + } + if ( a.getData_assinatura_seg() == null ) + { + sql += "data_assinatura_seg = " + null + ", "; + } + else + { + sql += "data_assinatura_seg = '" + a.getData_consolidacao() + "', "; + } + if ( a.getData_assinatura_rh() == null ) + { + sql += "data_assinatura_rh = " + null + ", "; + } + else + { + sql += "data_assinatura_rh = '" + a.getData_consolidacao() + "', "; + } + sql += "nome_resp_seg = '" + a.getNome_resp_seg() + "', "; + sql += "nome_resp_rh = '" + a.getNome_resp_rh() + "', "; + sql += "correcao = '" + a.getCorrecao() + "', "; + sql += "observacoes_correcao = '" + a.getObservacoes_correcao() + "', "; + sql += "estado_antes_correcao = " + a.getEstado_antes_correcao() + ", "; + sql += "ass_superior = '" + a.getAss_superior() + "', "; + sql += "nome_superior = '" + a.getNome_superior() + "', "; + sql += "averiguacao_posterior = '" + a.getAveriguacao_posterior() + "', "; + sql += "averiguacao_obs = '" + a.getAveriguacao_obs() + "', "; + sql += "nome_resp_consolidacao = '" + a.getNome_resp_consolidacao() + "', "; + if ( a.getData_assinatura_superior() == null ) + { + sql += "data_assinatura_superior = " + null + ", "; + } + else + { + sql += "data_assinatura_superior = '" + a.getData_assinatura_superior() + "', "; + } + sql += "rh_fase4 = " + a.getRh_fase4() + ", "; + sql += "concluido_por_desactivacao = " + a.getConcluido_por_desactivacao() + ", "; + sql += "comentario_desactivacao = " + ( a.getComentario_desactivacao() == null ? "null" : "'" + a.getComentario_desactivacao() + "'" ) + ", "; + sql += "data_desactivacao = " + ( a.getData_desactivacao() == null ? "null" : "'" + new java.sql.Date( a.getData_desactivacao().getTime() ) + "'" ); + sql += " WHERE id = " + a.getId(); + System.out.println( "SQL UPDATE : " + sql ); + st.execute( sql ); + } + + public void changeEstado( Correcao c ) throws Exception + { + Statement st = createStatement(); + String sql = "UPDATE analises_acidentes SET correcao = '" + c.getCorrecao() + "', estado = " + c.getEstado_corr() + ", estado_antes_correcao = " + c.getEstado_actual() + ", observacoes_correcao = '" + c.getObservacoes() + "' WHERE id = " + c.getAnalise_id(); + 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 + { + System.out.println( "DELETE RECOMENDACOES" ); + Statement st = createStatement(); + String sql = "DELETE FROM recomendacoes WHERE analise_id = " + analise_id; + st.execute( sql ); + } + + public void deleteAnaliseAcidente( Integer analise_id ) throws Exception + { + Statement st = createStatement(); + //String sql = "DELETE FROM analises_acidentes WHERE id = " + analise_id; + String sql = "UPDATE analises_acidentes SET apagada = 'y' WHERE id = " + analise_id; + st.execute( sql ); + } + + public void deleteAcidentado( Integer acidentado_id ) throws Exception + { + Statement st = createStatement(); + String sql = "DELETE FROM acidentados WHERE id = " + acidentado_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 ); + if ( rs.isBeforeFirst() ) + { + 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 ); + if ( rs.isBeforeFirst() ) + { + 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(); + Statement stlocal = createLocalStatement(); + + 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" ); + return numero_cedula; + } + + public String getTipoDescricao( Integer tipo ) throws Exception + { + Statement st = createStatement(); + String sql = "SELECT descricao FROM tipos_utilizadores WHERE tipo = " + tipo; + ResultSet rs = st.executeQuery( sql ); + rs.first(); + String descricao = rs.getString( "descricao" ); + return descricao; + } + + 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 ); + if ( rs.isBeforeFirst() ) + { + 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(); - String sql = "SELECT nome FROM estabelecimentos WHERE id = " + estabelecimento_id; - ResultSet rslocal = stlocal.executeQuery( sql ); + listOptions[i] = new Option( t.getTipo(), t.getDescricao() ); + i++; + } + return listOptions; + } - String nome = ""; - if ( rslocal.first() ) + public com.sun.rave.web.ui.model.Option[] getTiposList( Integer permissao ) 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 ); + if ( rs.isBeforeFirst() ) + { + rs.first(); + do + { + t = new TipoUtilizador(); + if ( permissao.intValue() == 7 ) //director rh + { + t.setTipo( new Integer( rs.getInt( "tipo" ) ) ); + if ( t.getTipo().intValue() == 1 || t.getTipo().intValue() == 2 || t.getTipo().intValue() == 6 ) // seguranca || rh || gestor + { + t.setId( new Integer( rs.getInt( "id" ) ) ); + t.setDescricao( rs.getString( "descricao" ) ); + //t.setActivo(rs.getString("activo")); + //t.setOrdem(new Integer(rs.getInt("ordem"))); + list.add( t ); + } + } + else + { + 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, Boolean booGestor ) throws Exception { - nome = rslocal.getString( "nome" ); - } - return Utils.unicodeToHTML( nome ); - } - - public String getMedicoNome(Integer medico_id) throws Exception - { -// Dblocal dblocal = new Dblocal(); -// dblocal.connect(); -// Statement stlocal = dblocal.createStatement(); - Statement stlocal = createLocalStatement(); - - String sql ="SELECT nome FROM medicos WHERE id = " + medico_id; - ResultSet rslocal = stlocal.executeQuery(sql); - rslocal.first(); - String nome = rslocal.getString("nome"); - return Utils.unicodeToHTML(nome); - } - - public Medico getMedico(Integer id) throws Exception - { -// Dblocal dblocal = new Dblocal(); -// dblocal.connect(); -// Statement stlocal = dblocal.createStatement(); - Statement stlocal = createLocalStatement(); - - String sql ="SELECT * FROM medicos WHERE id = " + id; - ResultSet rslocal = stlocal.executeQuery(sql); - rslocal.first(); - Medico m = new Medico(); - m.setId(new Integer( rslocal.getInt("id") )); - m.setNome(rslocal.getString("nome")); - m.setNumero_cedula(rslocal.getString("numero_cedula")); - return m; - } - - public String getTecnicoSaudeNome(Integer tecnico_id) throws Exception - { // Dblocal dblocal = new Dblocal(); // dblocal.connect(); // Statement stlocal = dblocal.createStatement(); - Statement stlocal = createLocalStatement(); - - String sql ="SELECT nome FROM marcacoes_tecnicos_hst WHERE id = " + tecnico_id; - ResultSet rslocal = stlocal.executeQuery(sql); - rslocal.first(); - String nome = rslocal.getString("nome"); - 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, nome_superior_hierarquico, email_superior_hierarquico, estabelecimento_origem, data_email_superior_hierarquico) VALUES ("; - sql += newId + ", '"; - sql += a.getNome() + "', "; - if(a.getData_nascimento() == null) - { - sql += null + ", '"; - } - else - { - sql += "'" + a.getData_nascimento() + "', '"; - } - //sql += a.getData_nascimento() + "', '"; - sql += a.getBilhete_identidade() + "', '"; - sql += a.getMorada() + "', '"; - sql += a.getCod_postal() + "', '"; - sql += a.getLocalidade() + "', '"; - sql += a.getContacto_telefonico() + "', "; - if(a.getData_admissao() == null) - { - sql += null + ", '"; - } - else - { - sql += "'" + a.getData_admissao() + "', '"; - } -// sql += a.getData_admissao() + "', '"; - sql += a.getTurno() + "', '"; - sql += a.getFuncao() + "', "; - sql += a.getTrabalhador_id() + ", '"; - sql += a.getNumero_mecanografico() + "', '"; - sql += a.getNome_superior_hierarquico() + "', '"; - sql += a.getEmail_superior_hierarquico() + "', '"; - sql += a.getEstabelecimento_origem() + "', "; - if(a.getData_email_superior_hierarquico() == null) - { - sql += null + ")"; - } - else - { - sql += "'" + a.getData_email_superior_hierarquico() + "')"; - } - //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() + "', "; - if(a.getData_nascimento() == null) - { - sql += "data_nascimento = " + null + ", "; - } - else - { - sql += "data_nascimento = '" + a.getData_nascimento() + "', "; - } -// 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() + "', "; - if(a.getData_admissao() == null) - { - sql += "data_admissao = " + null + ", "; - } - else - { - sql += "data_admissao = '" + a.getData_admissao() + "', "; - } -// 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 += "nome_superior_hierarquico = '" + a.getNome_superior_hierarquico() + "', "; - sql += "email_superior_hierarquico = '" + a.getEmail_superior_hierarquico() + "', "; - sql += "estabelecimento_origem = '" + a.getEstabelecimento_origem() + "', "; - if(a.getData_email_superior_hierarquico() == null) - { - sql += "data_email_superior_hierarquico = " + null + " "; - } - else - { - sql += "data_email_superior_hierarquico = '" + a.getData_email_superior_hierarquico() + "' "; - } - //sql += "analise_acidente_id = '" + a.getAnalise_acidente_id() + " "; - sql += "WHERE id = " + a.getId(); - System.out.println("SQL UPDATE ACIDENTADO : " + sql); - st.execute(sql); - } - - public Integer getMaxControleId() - { - Statement st = createStatement(); - String sql = "SELECT max(controle.id)+1 AS MAXCONTROLEID FROM controle"; - try - { - ResultSet rs = st.executeQuery(sql); - rs.first(); - Integer newId = new Integer(rs.getInt("MAXCONTROLEID")); - if(newId.intValue() == 0 ) - { - newId = new Integer(1); - } - return newId; - } - catch(Exception ex) - { - return new Integer(1); - } - } - - public Integer getMaxAnaliseId() - { - Statement st = createStatement(); - String sql = "SELECT max(analises_acidentes.id)+1 AS MAXANALISEID FROM analises_acidentes"; - try - { - 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) - { - return new Integer(1); - } - } - - - public AnaliseAcidente createAnalise(AnaliseAcidente a) throws Exception - { - //Controle c = getControle(); - Statement st = createStatement(); - Integer newId = getMaxAnaliseId(); - - //calc analise_nr - java.util.Date data_acidente = new java.util.Date(a.getData_acidente().getTime()); - //java.util.Date now = new java.util.Date(); - Calendar cal = new GregorianCalendar(); - //cal.setTime(now); - cal.setTime(data_acidente); - int ano = cal.get(Calendar.YEAR); - Controle c = getControloByAno(new Integer(ano)); - if(c == null) - { - c = createAnoNumeracao(new Integer(ano)); - } -// if(c.getAnalise_year().intValue() != ano) -// { -// c.setAnalise_year(new Integer(ano)); -// c.setLast_analise_nr(new Integer(0)); -// } - //String seq_str = new Integer(10000 + newId.intValue()).toString(); - int i_analise_nr = c.getLast_analise_nr().intValue() + 1; - c.setLast_analise_nr(new Integer(i_analise_nr)); - //updateControle(c); - String seq_str = new Integer(10000 + i_analise_nr).toString(); - String ano_str = new Integer(ano).toString(); - String analise_nr = ano_str.substring(2) + "/" + seq_str.substring(1); - a.setAnalise_nr(analise_nr); - a.setId(newId); - - String sql = "INSERT INTO analises_acidentes (id, averiguador, data_acidente, acidentado_id, estado, empresa_id, estabelecimento_id, horas_turno, departamento_id, seccao_id, local_trabalho, tarefa, substancias, condicoes, testemunhas, causas, descricao, conclusoes, accoes, hora_acidente, medico_id, tecnico_saude_id, averiguacao_posterior, averiguacao_obs, data_inicio_processo, analise_nr, coef_incapacidade, concluido_por_desactivacao, data_desactivacao, comentario_desactivacao) VALUES ("; - sql += newId + ", '"; - sql += a.getAveriguador() + "', '"; - sql += a.getData_acidente() + "', "; - sql += a.getAcidentado_id() + ", "; - sql += a.getEstado() + ", "; - sql += a.getEmpresa_id() + ", "; - sql += a.getEstabelecimento_id() + ", "; - sql += a.getHoras_turno() + ", "; - sql += a.getDepartamento_id() + ", "; - sql += a.getSeccao_id() + ", '"; - sql += a.getLocal_trabalho() + "', '"; - sql += a.getTarefa() + "', '"; - sql += a.getSubstancias() + "', '"; -// sql += a.getSuperior_hierarquico() + "', '"; - sql += a.getCondicoes() + "', '"; - sql += a.getTestemunhas() + "', "; - sql += a.getCausas() + ", '"; - sql += a.getDescricao() + "', '"; - sql += a.getConclusoes() + "', '"; - sql += a.getAccoes() + "', "; - if(a.getHora_acidente() == null) - { - sql += null + ", "; - } - else - { - sql += "'" + a.getHora_acidente() + "', "; - } - - sql += a.getMedico_id() + ", "; - sql += a.getTecnico_saude_id() + ", '"; - sql += a.getAveriguacao_posterior() + "', '"; - sql += a.getAveriguacao_obs() + "', "; - if(a.getData_inicio_processo() == null) - { - sql += null + ", "; - } - else - { - sql += "'" + a.getData_inicio_processo() + "', '"; - } - - sql += analise_nr + "', "; - sql += null + ", "; + Statement stlocal = createLocalStatement(); - sql += false + ", " + null + ", " + null; //concluido_por_desactivacao, data_desactivacao, comentario_desactivacao - - sql += ")"; + ArrayList list = new ArrayList(); + Estabelecimento e = new Estabelecimento(); + e.setId( new Integer( -1 ) ); -// sql += null + ")"; -// 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); - updateControle(c); - return a; - } - - 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(""); - } - if ( a.getConcluido_por_desactivacao() == null ) + e.setNome( "-Seleccionar-" ); + + list.add( e ); + if ( booGestor.equals( new Boolean( true ) ) ) { - a.setConcluido_por_desactivacao( Boolean.FALSE ); - a.setData_desactivacao( null ); - a.setComentario_desactivacao( null ); + e = new Estabelecimento(); + e.setId( new Integer( 0 ) ); + e.setNome( "-Todos os estabelecimentos-" ); + + list.add( e ); } - if ( a.getConcluido_por_desactivacao() != null && a.getConcluido_por_desactivacao().equals( Boolean.TRUE ) && a.getData_desactivacao() == null ) + String sql = "SELECT * FROM estabelecimentos WHERE empresa_id = " + empresa_id + " AND inactivo = 'n' ORDER BY nome_plain"; + + ResultSet rslocal = stlocal.executeQuery( sql ); + if ( rslocal.isBeforeFirst() ) { - a.setData_desactivacao( new Date() ); + rslocal.first(); + do + { + e = new Estabelecimento(); + e.setId( new Integer( rslocal.getInt( "id" ) ) ); + //e.setNome_plain(rslocal.getString("nome_plain")); + e.setNome( rslocal.getString( "nome" ) ); + System.out.println( "ESTABELECIMENTOAA : " + e.getId().toString() + " - " + e.getNome() ); + //t.setActivo(rs.getString("activo")); + //t.setOrdem(new Integer(rs.getInt("ordem"))); + list.add( e ); + } + while ( rslocal.next() ); } - if ( a.getComentario_desactivacao() != null && "".equals( a.getComentario_desactivacao().trim() ) ) + + 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() ) { - a.setComentario_desactivacao( null ); + e = ( Estabelecimento ) iter.next(); + System.out.println( "ESTABELECIMENTOL : " + e.getId().toString() + " - " + e.getNome() ); + listOptions[i] = new Option( e.getId(), Utils.unicodeToHTML( e.getNome() ) ); + i++; } + return listOptions; + } - - Statement st = createStatement(); - String sql = "UPDATE analises_acidentes SET data_acidente = '" + a.getData_acidente() + "', "; - 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 += "departamento_id = " + a.getDepartamento_id() + ", "; - sql += "seccao_id = " + a.getSeccao_id() + ", "; - sql += "local_trabalho = '" + a.getLocal_trabalho() + "', "; - sql += "tarefa = '" + a.getTarefa() + "', "; - sql += "substancias = '" + a.getSubstancias() + "', "; -// sql += "superior_hierarquico = '" + a.getSuperior_hierarquico() + "', "; - sql += "condicoes = '" + a.getCondicoes() + "', "; - sql += "testemunhas = '" + a.getTestemunhas() + "', "; - sql += "causas = " + a.getCausas() + ", "; - sql += "descricao = '" + a.getDescricao() + "', "; - sql += "conclusoes = '" + a.getConclusoes() + "', "; - sql += "accoes = '" + a.getAccoes() + "', "; - sql += "averiguador = '" + a.getAveriguador() + "', "; - if(a.getHora_acidente() == null) - { - sql += "hora_acidente = " + null + ", "; - } - else - { - 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 += "tecnico_saude_id = " + a.getTecnico_saude_id() + ", "; - sql += "medico_id = " + a.getMedico_id() + ", "; - sql += "ass_consolidacao = '" + a.getAss_consolidacao() + "', "; - sql += "ass_resp_seg = '" + a.getAss_resp_seg() + "', "; - sql += "ass_resp_rh = '" + a.getAss_resp_rh() + "', "; - if(a.getData_consolidacao() == null) - { - sql += "data_consolidacao = " + null + ", "; - } - else - { - sql += "data_consolidacao = '" + a.getData_consolidacao() + "', "; - } - if(a.getData_assinatura_seg() == null) - { - sql += "data_assinatura_seg = " + null + ", "; - } - else - { - sql += "data_assinatura_seg = '" + a.getData_consolidacao() + "', "; - } - if(a.getData_assinatura_rh() == null) - { - sql += "data_assinatura_rh = " + null + ", "; - } - else - { - sql += "data_assinatura_rh = '" + a.getData_consolidacao() + "', "; - } - sql += "nome_resp_seg = '" + a.getNome_resp_seg() + "', "; - sql += "nome_resp_rh = '" + a.getNome_resp_rh() + "', "; - sql += "correcao = '" + a.getCorrecao() + "', "; - sql += "observacoes_correcao = '" + a.getObservacoes_correcao() + "', "; - sql += "estado_antes_correcao = " + a.getEstado_antes_correcao() + ", "; - sql += "ass_superior = '" + a.getAss_superior() + "', "; - sql += "nome_superior = '" + a.getNome_superior() + "', "; - sql += "averiguacao_posterior = '" + a.getAveriguacao_posterior() + "', "; - sql += "averiguacao_obs = '" + a.getAveriguacao_obs() + "', "; - sql += "nome_resp_consolidacao = '" + a.getNome_resp_consolidacao() + "', "; - if(a.getData_assinatura_superior() == null) - { - sql += "data_assinatura_superior = " + null + ", "; - } - else - { - sql += "data_assinatura_superior = '" + a.getData_assinatura_superior() + "', "; - } - sql += "rh_fase4 = " + a.getRh_fase4() + ", "; - sql += "concluido_por_desactivacao = " + a.getConcluido_por_desactivacao() + ", "; - sql += "comentario_desactivacao = " + ( a.getComentario_desactivacao() == null ? "null" : "'" + a.getComentario_desactivacao() + "'" ) + ", "; - sql += "data_desactivacao = " + ( a.getData_desactivacao() == null ? "null" : "'" + new java.sql.Date( a.getData_desactivacao().getTime() ) + "'" ); - sql += " WHERE id = " + a.getId(); - System.out.println("SQL UPDATE : " + sql); - st.execute( sql ); - } - - public void changeEstado(Correcao c) throws Exception - { - Statement st = createStatement(); - String sql = "UPDATE analises_acidentes SET correcao = '" + c.getCorrecao() + "', estado = " + c.getEstado_corr() + ", estado_antes_correcao = " + c.getEstado_actual() + ", observacoes_correcao = '" + c.getObservacoes() + "' WHERE id = " + c.getAnalise_id(); - 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 - { - System.out.println("DELETE RECOMENDACOES"); - Statement st = createStatement(); - String sql = "DELETE FROM recomendacoes WHERE analise_id = " + analise_id; - st.execute(sql); - } - - public void deleteAnaliseAcidente(Integer analise_id) throws Exception - { - Statement st = createStatement(); - //String sql = "DELETE FROM analises_acidentes WHERE id = " + analise_id; - String sql = "UPDATE analises_acidentes SET apagada = 'y' WHERE id = " + analise_id; - st.execute(sql); - } - - public void deleteAcidentado(Integer acidentado_id) throws Exception - { - Statement st = createStatement(); - String sql = "DELETE FROM acidentados WHERE id = " + acidentado_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); - if(rs.isBeforeFirst()) - { - 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); - if(rs.isBeforeFirst()) - { - 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(); - Statement stlocal = createLocalStatement(); - - 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"); - return numero_cedula; - } - - public String getTipoDescricao(Integer tipo) throws Exception - { - Statement st = createStatement(); - String sql = "SELECT descricao FROM tipos_utilizadores WHERE tipo = " + tipo; - ResultSet rs = st.executeQuery(sql); - rs.first(); - String descricao = rs.getString("descricao"); - return descricao; - } - - 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); - if(rs.isBeforeFirst()) - { - 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[] getTiposList(Integer permissao) 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); - if(rs.isBeforeFirst()) - { - rs.first(); - do - { - t = new TipoUtilizador(); - if(permissao.intValue() == 7) //director rh - { - t.setTipo(new Integer(rs.getInt("tipo"))); - if(t.getTipo().intValue() == 1 || t.getTipo().intValue() == 2 || t.getTipo().intValue() == 6) // seguranca || rh || gestor - { - t.setId(new Integer(rs.getInt("id"))); - t.setDescricao(rs.getString("descricao")); - //t.setActivo(rs.getString("activo")); - //t.setOrdem(new Integer(rs.getInt("ordem"))); - list.add(t); - } - } - else - { - 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, Boolean booGestor) throws Exception - { -// Dblocal dblocal = new Dblocal(); -// dblocal.connect(); -// Statement stlocal = dblocal.createStatement(); - Statement stlocal = createLocalStatement(); - - ArrayList list = new ArrayList(); - Estabelecimento e = new Estabelecimento(); - e.setId(new Integer(-1)); - - e.setNome("-Seleccionar-"); - - list.add(e); - if(booGestor.equals(new Boolean(true))) - { - e = new Estabelecimento(); - e.setId(new Integer(0)); - e.setNome("-Todos os estabelecimentos-"); - - list.add(e); - } - String sql ="SELECT * FROM estabelecimentos WHERE empresa_id = " + empresa_id + " AND inactivo = 'n' ORDER BY nome_plain"; - - ResultSet rslocal = stlocal.executeQuery(sql); - if(rslocal.isBeforeFirst()) - { - rslocal.first(); - do - { - e = new Estabelecimento(); - e.setId(new Integer(rslocal.getInt("id"))); - //e.setNome_plain(rslocal.getString("nome_plain")); - e.setNome(rslocal.getString("nome")); - System.out.println("ESTABELECIMENTOAA : " + e.getId().toString() + " - " + e.getNome()); - //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(); - System.out.println("ESTABELECIMENTOL : " + e.getId().toString() + " - " + e.getNome()); - listOptions[i] = new Option(e.getId(), Utils.unicodeToHTML(e.getNome())); - i++; - } - return listOptions; - } - - public com.sun.rave.web.ui.model.Option[] getEstabelecimentosGestorList(Integer empresa_id, Boolean booGestor) throws Exception - { + public com.sun.rave.web.ui.model.Option[] getEstabelecimentosGestorList( Integer empresa_id, Boolean booGestor ) throws Exception + { // Dblocal dblocal = new Dblocal(); // dblocal.connect(); // Statement stlocal = dblocal.createStatement(); - Statement stlocal = createLocalStatement(); - - ArrayList list = new ArrayList(); - Estabelecimento e = null; - //Estabelecimento e = new Estabelecimento(); - //e.setId(new Integer(-1)); - - //e.setNome("-Seleccionar-"); - - //list.add(e); - if(booGestor.equals(new Boolean(true))) - { - e = new Estabelecimento(); - e.setId(new Integer(0)); - e.setNome("-Todos os estabelecimentos-"); - - list.add(e); - } - String sql ="SELECT * FROM estabelecimentos WHERE empresa_id = " + empresa_id + " AND inactivo = 'n' ORDER BY nome_plain"; - - ResultSet rslocal = stlocal.executeQuery(sql); - if(rslocal.isBeforeFirst()) - { - rslocal.first(); - do - { - e = new Estabelecimento(); - e.setId(new Integer(rslocal.getInt("id"))); - //e.setNome_plain(rslocal.getString("nome_plain")); - e.setNome(rslocal.getString("nome")); - System.out.println("ESTABELECIMENTOAA : " + e.getId().toString() + " - " + e.getNome()); - //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(); - System.out.println("ESTABELECIMENTOL : " + e.getId().toString() + " - " + e.getNome()); - listOptions[i] = new Option(e.getId(), Utils.unicodeToHTML(e.getNome())); - i++; - } - return listOptions; - } - - public com.sun.rave.web.ui.model.Option[] getMedicosList() throws Exception - { + Statement stlocal = createLocalStatement(); + + ArrayList list = new ArrayList(); + Estabelecimento e = null; + //Estabelecimento e = new Estabelecimento(); + //e.setId(new Integer(-1)); + + //e.setNome("-Seleccionar-"); + + //list.add(e); + if ( booGestor.equals( new Boolean( true ) ) ) + { + e = new Estabelecimento(); + e.setId( new Integer( 0 ) ); + e.setNome( "-Todos os estabelecimentos-" ); + + list.add( e ); + } + String sql = "SELECT * FROM estabelecimentos WHERE empresa_id = " + empresa_id + " AND inactivo = 'n' ORDER BY nome_plain"; + + ResultSet rslocal = stlocal.executeQuery( sql ); + if ( rslocal.isBeforeFirst() ) + { + rslocal.first(); + do + { + e = new Estabelecimento(); + e.setId( new Integer( rslocal.getInt( "id" ) ) ); + //e.setNome_plain(rslocal.getString("nome_plain")); + e.setNome( rslocal.getString( "nome" ) ); + System.out.println( "ESTABELECIMENTOAA : " + e.getId().toString() + " - " + e.getNome() ); + //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(); + System.out.println( "ESTABELECIMENTOL : " + e.getId().toString() + " - " + e.getNome() ); + listOptions[i] = new Option( e.getId(), Utils.unicodeToHTML( e.getNome() ) ); + i++; + } + return listOptions; + } + + public com.sun.rave.web.ui.model.Option[] getMedicosList() throws Exception + { // Dblocal dblocal = new Dblocal(); // dblocal.connect(); // Statement stlocal = dblocal.createStatement(); - Statement stlocal = createLocalStatement(); - - ArrayList list = new ArrayList(); - Medico m = new Medico(); - m.setId(new Integer(0)); - m.setNome("-Seleccionar-"); - list.add(m); - String sql ="SELECT * FROM medicos WHERE inactivo = 'n'"; - ResultSet rslocal = stlocal.executeQuery(sql); - if(rslocal.isBeforeFirst()) - { - 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++; - } - return listOptions; - } - - public com.sun.rave.web.ui.model.Option[] getTecnicosSaudeList() throws Exception - { + Statement stlocal = createLocalStatement(); + + ArrayList list = new ArrayList(); + Medico m = new Medico(); + m.setId( new Integer( 0 ) ); + m.setNome( "-Seleccionar-" ); + list.add( m ); + String sql = "SELECT * FROM medicos WHERE inactivo = 'n'"; + ResultSet rslocal = stlocal.executeQuery( sql ); + if ( rslocal.isBeforeFirst() ) + { + 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++; + } + return listOptions; + } + + public com.sun.rave.web.ui.model.Option[] getTecnicosSaudeList() throws Exception + { // Dblocal dblocal = new Dblocal(); // dblocal.connect(); // Statement stlocal = dblocal.createStatement(); - Statement stlocal = createLocalStatement(); - - ArrayList list = new ArrayList(); - TecnicoSaude t = new TecnicoSaude(); - t.setId(new Integer(0)); - t.setNome("-Seleccionar-"); - list.add(t); - String sql ="SELECT * FROM marcacoes_tecnicos_hst WHERE inactivo = 'n'"; - ResultSet rslocal = stlocal.executeQuery(sql); - if(rslocal.isBeforeFirst()) - { - 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++; - } - return listOptions; - } - - public com.sun.rave.web.ui.model.Option[] getCausasList() throws Exception - { - ArrayList list = new ArrayList(); - Causa c = new Causa(); - c.setId(new Integer(0)); - c.setCausa("-Seleccionar-"); - list.add(c); - Statement st = createStatement(); - String sql = "SELECT * FROM causas WHERE activa = 'y'"; - ResultSet rs = st.executeQuery(sql); - if(rs.isBeforeFirst()) - { - rs.first(); - do - { - c = new Causa(); - c.setId( new Integer(rs.getInt("id")) ); - c.setCausa(rs.getString("causa")); - list.add(c); - }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()) - { - c = (Causa) iter.next(); - - listOptions[i] = new Option(c.getId(), c.getCausa()); - i++; - } - return listOptions; - } - - public com.sun.rave.web.ui.model.Option[] getDepartamentosList() throws Exception - { - ArrayList list = new ArrayList(); - Departamento d = new Departamento(); - - d.setId(new Integer(0)); - d.setDescricao("-Todos-"); - list.add(d); - Statement st = createStatement(); - String sql = "SELECT * FROM departamentos WHERE activo = 'y'"; - ResultSet rs = st.executeQuery(sql); - if(rs.isBeforeFirst()) - { - rs.first(); - do - { - d = new Departamento(); - d.setId( new Integer(rs.getInt("id")) ); - d.setDescricao(rs.getString("descricao")); - list.add(d); - }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()) - { - d = (Departamento) iter.next(); - - listOptions[i] = new Option(d.getId(), d.getDescricao()); - i++; - } - return listOptions; - } - - public com.sun.rave.web.ui.model.Option[] getSeccoesList(Integer departamento_id) throws Exception - { - ArrayList list = new ArrayList(); - Seccao s = new Seccao(); - - s.setId(new Integer(0)); - s.setDescricao("-Seleccionar-"); - list.add(s); - Statement st = createStatement(); - String sql = ""; - if(departamento_id == null) // todos - { - sql = "SELECT * FROM seccoes WHERE activo = 'y'"; - } - else - { - sql = "SELECT * FROM seccoes WHERE activo = 'y' AND departamento_id = " + departamento_id; - } - - ResultSet rs = st.executeQuery(sql); - if(rs.isBeforeFirst()) - { - rs.first(); - do - { - s = new Seccao(); - s.setId( new Integer(rs.getInt("id")) ); - s.setDescricao(rs.getString("descricao")); - s.setDepartamento_id( new Integer(rs.getInt("departamento_id")) ); - list.add(s); - }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()) - { - s = (Seccao) iter.next(); - - listOptions[i] = new Option(s.getId(), s.getDescricao()); - i++; - } - return listOptions; - } - - - - public Causa getCausa(Integer id) throws Exception - { - Statement st = createStatement(); - String sql = null; - - sql ="SELECT * FROM causas WHERE id = " + id; - - ResultSet rs = st.executeQuery(sql); + Statement stlocal = createLocalStatement(); + + ArrayList list = new ArrayList(); + TecnicoSaude t = new TecnicoSaude(); + t.setId( new Integer( 0 ) ); + t.setNome( "-Seleccionar-" ); + list.add( t ); + String sql = "SELECT * FROM marcacoes_tecnicos_hst WHERE inactivo = 'n'"; + ResultSet rslocal = stlocal.executeQuery( sql ); + if ( rslocal.isBeforeFirst() ) + { + 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++; + } + return listOptions; + } + + + public com.sun.rave.web.ui.model.Option[] getCausasAcidente( ) throws Exception + { + com.sun.rave.web.ui.model.Option[] options = null; + + Select2 query = new Select2( + new String[] { CausasData.TABLENAME }, + new Integer[] { }, + new Expression[] { }, + new String[] { CausasData.ID_FULL, CausasData.CAUSA_FULL }, + new Field( CausasData.ACTIVA_FULL ).isEqual( "y" ), + new String[] { CausasData.ID_FULL, CausasData.CAUSA_FULL }, + null, null, null + ); + Virtual2DArray array = getExecuter().executeQuery( query ); + if ( array != null ) + { + options = new com.sun.rave.web.ui.model.Option[ array.columnLength() + 1 ]; + options[ 0 ] = new Option( new Integer( 0 ), "-Seleccionar" ); + for ( int i = 0; i < array.columnLength(); i++ ) + { + Integer causaID = array.get( i, 0 ); + String causa = array.get( i, 1 ); + options[ (i+1) ] = new Option( causaID, causa ); + } + } + return options; + } + +// public com.sun.rave.web.ui.model.Option[] getCausasList() throws Exception +// { +// ArrayList list = new ArrayList(); +// Causa c = new Causa(); +// c.setId( new Integer( 0 ) ); +// c.setCausa( "-Seleccionar-" ); +// list.add( c ); +// Statement st = createStatement(); +// String sql = "SELECT * FROM causas WHERE activa = 'y'"; +// ResultSet rs = st.executeQuery( sql ); +// if ( rs.isBeforeFirst() ) +// { +// rs.first(); +// do +// { +// c = new Causa(); +// c.setId( new Integer( rs.getInt( "id" ) ) ); +// c.setCausa( rs.getString( "causa" ) ); +// list.add( c ); +// } +// 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() ) +// { +// c = ( Causa ) iter.next(); +// +// listOptions[i] = new Option( c.getId(), c.getCausa() ); +// i++; +// } +// return listOptions; +// } + + public com.sun.rave.web.ui.model.Option[] getDepartamentosList() throws Exception + { + ArrayList list = new ArrayList(); + Departamento d = new Departamento(); + + d.setId( new Integer( 0 ) ); + d.setDescricao( "-Todos-" ); + list.add( d ); + Statement st = createStatement(); + String sql = "SELECT * FROM departamentos WHERE activo = 'y'"; + ResultSet rs = st.executeQuery( sql ); + if ( rs.isBeforeFirst() ) + { + rs.first(); + do + { + d = new Departamento(); + d.setId( new Integer( rs.getInt( "id" ) ) ); + d.setDescricao( rs.getString( "descricao" ) ); + list.add( d ); + } + 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() ) + { + d = ( Departamento ) iter.next(); + + listOptions[i] = new Option( d.getId(), d.getDescricao() ); + i++; + } + return listOptions; + } + + public com.sun.rave.web.ui.model.Option[] getSeccoesList( Integer departamento_id ) throws Exception + { + ArrayList list = new ArrayList(); + Seccao s = new Seccao(); + + s.setId( new Integer( 0 ) ); + s.setDescricao( "-Seleccionar-" ); + list.add( s ); + Statement st = createStatement(); + String sql = ""; + if ( departamento_id == null ) // todos + { + sql = "SELECT * FROM seccoes WHERE activo = 'y'"; + } + else + { + sql = "SELECT * FROM seccoes WHERE activo = 'y' AND departamento_id = " + departamento_id; + } + + ResultSet rs = st.executeQuery( sql ); + if ( rs.isBeforeFirst() ) + { + rs.first(); + do + { + s = new Seccao(); + s.setId( new Integer( rs.getInt( "id" ) ) ); + s.setDescricao( rs.getString( "descricao" ) ); + s.setDepartamento_id( new Integer( rs.getInt( "departamento_id" ) ) ); + list.add( s ); + } + 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() ) + { + s = ( Seccao ) iter.next(); + + listOptions[i] = new Option( s.getId(), s.getDescricao() ); + i++; + } + return listOptions; + } + + public Causa getCausa( Integer id ) throws Exception + { + Statement st = createStatement(); + String sql = null; + + sql = "SELECT * FROM causas WHERE id = " + id; + + ResultSet rs = st.executeQuery( sql ); Causa c = null; if ( rs.first() ) { @@ -2978,42 +3082,57 @@ public class AnalisesDataProvider extends GenericDataProvider c.setId( new Integer( rs.getInt( "id" ) ) ); c.setCausa( rs.getString( "causa" ) ); } - return c; - } - - public Seccao getSeccao(Integer id) throws Exception - { - Statement st = createStatement(); - String sql = null; - - sql ="SELECT * FROM seccoes WHERE id = " + id + " AND activo = 'y'"; - - ResultSet rs = st.executeQuery(sql); - rs.first(); - Seccao s = new Seccao(); - s.setId( new Integer(rs.getInt("id")) ); - s.setDescricao(rs.getString("descricao")); - return s; - } - - public List< Integer > getDistinctYears( Integer excludeYear ) throws Exception - { - List< Integer > result = new LinkedList< Integer >(); - + return c; + } + + public Seccao getSeccao( Integer id ) throws Exception + { + Statement st = createStatement(); + String sql = null; + + sql = "SELECT * FROM seccoes WHERE id = " + id + " AND activo = 'y'"; + + ResultSet rs = st.executeQuery( sql ); + rs.first(); + Seccao s = new Seccao(); + s.setId( new Integer( rs.getInt( "id" ) ) ); + s.setDescricao( rs.getString( "descricao" ) ); + return s; + } + + public List getDistinctYears( Integer excludeYear ) throws Exception + { + List result = new LinkedList(); + Expression where = new Field( "apagada" ).isEqual( "n" ); if ( excludeYear != null ) { - where = where.and( new Field( "EXTRACT( year FROM data_acidente )" ).notIn( new Integer[] { excludeYear } ) ); + where = where.and( new Field( "EXTRACT( year FROM data_acidente )" ).notIn( new Integer[] + { + excludeYear + } ) ); } Select2 query = new Select2( - new String[] { "analises_acidentes" }, - new Integer[] {}, - new Expression[] {}, - new String[] { "DISTINCT( cast( EXTRACT( year FROM data_acidente ) as integer ) ) AS ano" }, + new String[] + { + "analises_acidentes" + }, + new Integer[] + { + }, + new Expression[] + { + }, + new String[] + { + "DISTINCT( cast( EXTRACT( year FROM data_acidente ) as integer ) ) AS ano" + }, where, - new String[] { "ano DESC" }, - null, null, null - ); + new String[] + { + "ano DESC" + }, + null, null, null ); query.disableOrderFieldsVerification(); Virtual2DArray array = getExecuter().executeQuery( query ); for ( int i = 0; i < array.columnLength(); i++ ) @@ -3024,60 +3143,58 @@ public class AnalisesDataProvider extends GenericDataProvider return result; } - public ArrayList getAnosListFromAnalises() throws Exception - { - ArrayList list = new ArrayList(); - - String sql = "SELECT DISTINCT EXTRACT( year FROM data_acidente ) AS ano " + + public ArrayList getAnosListFromAnalises() throws Exception + { + ArrayList list = new ArrayList(); + + String sql = "SELECT DISTINCT EXTRACT( year FROM data_acidente ) AS ano " + "FROM analises_acidentes " + "WHERE " + - "apagada = 'n' AND estado = " + Global.ESTADO_CONCLUIDO + + "apagada = 'n' AND estado = " + Global.ESTADO_CONCLUIDO + " ORDER BY ano"; Statement st = createStatement(); - ResultSet rs = st.executeQuery( sql ); - if ( rs.isBeforeFirst() ) - { - rs.first(); - do - { - Double dAno = new Double( rs.getDouble( "ano" ) ); - Integer iAno = new Integer( dAno.intValue() ); - list.add( iAno ); - } + ResultSet rs = st.executeQuery( sql ); + if ( rs.isBeforeFirst() ) + { + rs.first(); + do + { + Double dAno = new Double( rs.getDouble( "ano" ) ); + Integer iAno = new Integer( dAno.intValue() ); + list.add( iAno ); + } while ( rs.next() ); - } - return list; - } - - - - public String getFase(int estado) - { - if(estado == Global.ESTADO_SEG) - { - return "FASE 1 - SEG - ABERTURA"; - } - else if(estado == Global.ESTADO_RH1) - { - return "FASE 2 - RH - ACOMPANHAMENTO"; - } - else if(estado == Global.ESTADO_HS) - { - return "FASE 3 - SIPRP - RECOMENDAÇÕES"; - } - else if(estado == Global.ESTADO_RH2) - { - return "FASE 4 - RH - MEDIDAS + LESÃO"; - } + } + return list; + } + + public String getFase( int estado ) + { + if ( estado == Global.ESTADO_SEG ) + { + return "FASE 1 - SEG - ABERTURA"; + } + else if ( estado == Global.ESTADO_RH1 ) + { + return "FASE 2 - RH - ACOMPANHAMENTO"; + } + else if ( estado == Global.ESTADO_HS ) + { + return "FASE 3 - SIPRP - RECOMENDAÇÕES"; + } + else if ( estado == Global.ESTADO_RH2 ) + { + return "FASE 4 - RH - MEDIDAS + LESÃO"; + } // else if(estado == Global.ESTADO_MEDICINA) // { // return "Medicina"; // } - else if(estado == Global.ESTADO_CONSOLIDACAO) - { - return "FASE 5 - SIPRP - CONSOLIDAÇÃO"; - } + else if ( estado == Global.ESTADO_CONSOLIDACAO ) + { + return "FASE 5 - SIPRP - CONSOLIDAÇÃO"; + } // else if(estado == Global.ESTADO_ASSINATURAS) // { // return "Verificação"; @@ -3086,84 +3203,82 @@ public class AnalisesDataProvider extends GenericDataProvider // { // return "Impressão"; // } - else if(estado == Global.ESTADO_ASSINATURA_SEG) - { - return "FASE 6 - SEG - VERIFICAÇÃO SEG."; - } - else if(estado == Global.ESTADO_ASSINATURA_RH) - { - return "FASE 7 - RH - VERIFICAÇÃO RH"; - } - else if(estado == Global.ESTADO_FECHAR) - { - return "FASE 8 - SIPRP - CONCLUSÃO"; - } - else if ( estado == Global.ESTADO_CONCLUIDO ) - { - return "FASE 9 - CONCLUÍDO"; - } - return null; - } - - public HashMap getMetaData(String table) throws Exception - { - Statement st = createStatement(); - String sql = "select * from " + table; - - ResultSet rs = st.executeQuery(sql); - ResultSetMetaData rsmd = rs.getMetaData(); - - HashMap hash = new HashMap(); - int cols = rsmd.getColumnCount(); - - for(int i=0; i < cols; i++) - { - String field = rsmd.getColumnName(i + 1); - int len = rsmd.getPrecision(i+1); - hash.put(field, new Integer(len)); - } - return hash; - } - - public byte[] getLogoByEmpresa(Integer empresaId) throws Exception - { + else if ( estado == Global.ESTADO_ASSINATURA_SEG ) + { + return "FASE 6 - SEG - VERIFICAÇÃO SEG."; + } + else if ( estado == Global.ESTADO_ASSINATURA_RH ) + { + return "FASE 7 - RH - VERIFICAÇÃO RH"; + } + else if ( estado == Global.ESTADO_FECHAR ) + { + return "FASE 8 - SIPRP - CONCLUSÃO"; + } + else if ( estado == Global.ESTADO_CONCLUIDO ) + { + return "FASE 9 - CONCLUÍDO"; + } + return null; + } + + public HashMap getMetaData( String table ) throws Exception + { + Statement st = createStatement(); + String sql = "select * from " + table; + + ResultSet rs = st.executeQuery( sql ); + ResultSetMetaData rsmd = rs.getMetaData(); + + HashMap hash = new HashMap(); + int cols = rsmd.getColumnCount(); + + for ( int i = 0; i < cols; i++ ) + { + String field = rsmd.getColumnName( i + 1 ); + int len = rsmd.getPrecision( i + 1 ); + hash.put( field, new Integer( len ) ); + } + return hash; + } + + public byte[] getLogoByEmpresa( Integer empresaId ) throws Exception + { // Dblocal dblocal = new Dblocal(); // dblocal.connect(); // Statement st = dblocal.createStatement(); - Statement st = createLocalStatement(); - - String sql = "select empresa_logo_id from empresas where id = " + empresaId; - ResultSet rslocal = st.executeQuery(sql); - if ( rslocal.isBeforeFirst() ) - { - rslocal.first(); - Integer logoId = new Integer(rslocal.getInt("empresa_logo_id")); - byte[] logo = getLogo(logoId); - return logo; - } - - return null; - } - - public byte[] getLogo(Integer logoId) throws Exception - { + Statement st = createLocalStatement(); + + String sql = "select empresa_logo_id from empresas where id = " + empresaId; + ResultSet rslocal = st.executeQuery( sql ); + if ( rslocal.isBeforeFirst() ) + { + rslocal.first(); + Integer logoId = new Integer( rslocal.getInt( "empresa_logo_id" ) ); + byte[] logo = getLogo( logoId ); + return logo; + } + + return null; + } + + public byte[] getLogo( Integer logoId ) throws Exception + { // Dblocal dblocal = new Dblocal(); // dblocal.connect(); // Statement st = dblocal.createStatement(); - Statement st = createLocalStatement(); - - String sql = "select image_data from image where id = " + logoId; - ResultSet rslocal = st.executeQuery(sql); - rslocal.first(); - byte[] logo = rslocal.getBytes("image_data"); - System.out.println("LOGO SIZE : " + logo.length); - return logo; - } - + Statement st = createLocalStatement(); + + String sql = "select image_data from image where id = " + logoId; + ResultSet rslocal = st.executeQuery( sql ); + rslocal.first(); + byte[] logo = rslocal.getBytes( "image_data" ); + System.out.println( "LOGO SIZE : " + logo.length ); + return logo; + } // private Statement createStatement() // { // Db db = new Db(); // return db.createStatement(); // } - }