|  |  | @ -162,7 +162,8 @@ public class PlanoActuacaoPrintDataProvider | 
			
		
	
		
		
			
				
					
					|  |  |  | 				getLegislacaoAplicavel( id ),  |  |  |  | 				getLegislacaoAplicavel( id ),  | 
			
		
	
		
		
			
				
					
					|  |  |  | 				getAreasToPrintByPlanoId( id, validacaoDl, validacaoDns ), |  |  |  | 				getAreasToPrintByPlanoId( id, validacaoDl, validacaoDns ), | 
			
		
	
		
		
			
				
					
					|  |  |  | 				observacoesDl, |  |  |  | 				observacoesDl, | 
			
		
	
		
		
			
				
					
					|  |  |  | 				observacoesDns ); |  |  |  | 				observacoesDns, | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 				getTecnicoHS( id ) ); | 
			
		
	
		
		
			
				
					
					|  |  |  | 		return plano;  |  |  |  | 		return plano;  | 
			
		
	
		
		
			
				
					
					|  |  |  | 	} |  |  |  | 	} | 
			
		
	
		
		
			
				
					
					|  |  |  | 	 |  |  |  | 	 | 
			
		
	
	
		
		
			
				
					|  |  | @ -184,34 +185,6 @@ public class PlanoActuacaoPrintDataProvider | 
			
		
	
		
		
			
				
					
					|  |  |  | 		return array.columnLength() > 0 ? ( Integer ) array.get( 0, 0 ) : null; |  |  |  | 		return array.columnLength() > 0 ? ( Integer ) array.get( 0, 0 ) : null; | 
			
		
	
		
		
			
				
					
					|  |  |  | 	} |  |  |  | 	} | 
			
		
	
		
		
			
				
					
					|  |  |  | 	 |  |  |  | 	 | 
			
		
	
		
		
			
				
					
					|  |  |  | //	public LegislacaoAplicavelToPrint getLegislacaoAplicavel( Integer planoId )
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | //		throws Exception
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | //	{
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | //		Select select =
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | //			new Select2( 
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | //				new String[]{ "hs_relatorio_legislacao" },
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | //				new Integer[]{},
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | //				new Expression[]{},
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | //				new String[]{ "hs_relatorio_legislacao.categoria", "hs_relatorio_legislacao.descricao" },
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | //				new Field( "hs_relatorio_legislacao.hs_relatorio_id" ).isEqual( planoId ).and(
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | //					new Field( "hs_relatorio_legislacao.categoria" ).isEqual( null ) ),
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | //				null,
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | //				null,
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | //				null,
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | //				null );
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | //		Virtual2DArray array = LOCAL_EXECUTER.executeQuery( select );
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | //		Vector<String> diplomas = new Vector<String>();
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | //		for( int n = 0; n < array.columnLength(); n++ )
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | //		{
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | //			String descricao = ( String ) array.get( n, 0 );
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | //			diplomas.add( descricao );
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | //		}
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | //		LegislacaoAplicavelToPrint legislacao = 
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | //			new LegislacaoAplicavelToPrint( diplomas );
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | //		
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | //		return legislacao;
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | //	}
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 	 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 	protected Integer getRelatorioIdForPlanoId( Integer planoId ) |  |  |  | 	protected Integer getRelatorioIdForPlanoId( Integer planoId ) | 
			
		
	
		
		
			
				
					
					|  |  |  | 		throws Exception |  |  |  | 		throws Exception | 
			
		
	
		
		
			
				
					
					|  |  |  | 	{ |  |  |  | 	{ | 
			
		
	
	
		
		
			
				
					|  |  | @ -747,4 +720,46 @@ public class PlanoActuacaoPrintDataProvider | 
			
		
	
		
		
			
				
					
					|  |  |  | 			new BlobUpdate( "image", "image_data", data, new Field( "id" ).isEqual( id ) ); |  |  |  | 			new BlobUpdate( "image", "image_data", data, new Field( "id" ).isEqual( id ) ); | 
			
		
	
		
		
			
				
					
					|  |  |  | 		LOCAL_EXECUTER.executeQuery( update ); |  |  |  | 		LOCAL_EXECUTER.executeQuery( update ); | 
			
		
	
		
		
			
				
					
					|  |  |  | 	} |  |  |  | 	} | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 	 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 	public TecnicoHSToPrint getTecnicoHS( Integer relatorioId ) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 		throws Exception | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 	{ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 		if( web ) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 		{ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 			relatorioId = getRelatorioIdForPlanoId( relatorioId ); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 		} | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 		Select select = | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 			new Select2( | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 				new String[]{ "hs_relatorio", "marcacoes_estabelecimento", "marcacoes_tecnicos_hst" }, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 				new Integer[]{ Select2.JOIN_INNER, Select2.JOIN_INNER }, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 				new Expression[]{ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 					new Field( "hs_relatorio.marcacao_id" ).isEqual( new Field( "marcacoes_estabelecimento.id" ) ), | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 					new Field( "marcacoes_estabelecimento.tecnico_hst" ).isEqual( new Field( "marcacoes_tecnicos_hst.id" ) ), | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 				}, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 				new String[]{  | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 					"marcacoes_tecnicos_hst.id",  | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 					"marcacoes_tecnicos_hst.nome", | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 					"marcacoes_tecnicos_hst.cap", | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 					"marcacoes_tecnicos_hst.formacao", | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 					"marcacoes_tecnicos_hst.assinatura",}, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 				new Field( "hs_relatorio.id" ).isEqual( relatorioId ), | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 				null, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 				null, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 				null, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 				null ); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 		Virtual2DArray array = LOCAL_EXECUTER.executeQuery( select ); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 		if( array.columnLength() == 0 ) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 		{ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 			return null; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 		} | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 		else | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 		{ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 			Integer id = ( Integer ) array.get( 0, 0 ); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 			String nome = ( String ) array.get( 0, 1 ); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 			String cap = ( String ) array.get( 0, 2 ); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 			String formacao = ( String ) array.get( 0, 3 ); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 			Integer assinatura = ( Integer ) array.get( 0, 4 ); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 			return new TecnicoHSToPrint( id, nome, cap, formacao, "http://www.evolute.pt:13080/SIPRPImages/image?id=" + assinatura ); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 		} | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 	} | 
			
		
	
		
		
			
				
					
					|  |  |  | } |  |  |  | } | 
			
		
	
	
		
		
			
				
					|  |  | 
 |