forked from Coded/SIPRP
				
			
			You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							449 lines
						
					
					
						
							15 KiB
						
					
					
				
			
		
		
	
	
							449 lines
						
					
					
						
							15 KiB
						
					
					
				/*
 | 
						|
 * LembretesDataProvider.java
 | 
						|
 *
 | 
						|
 * Created on February 5, 2007, 6:09 PM
 | 
						|
 *
 | 
						|
 * To change this template, choose Tools | Template Manager
 | 
						|
 * and open the template in the editor.
 | 
						|
 */
 | 
						|
 | 
						|
package siprp.lembretes;
 | 
						|
 | 
						|
import java.util.Calendar;
 | 
						|
import java.util.Date;
 | 
						|
import java.util.HashMap;
 | 
						|
import java.util.LinkedList;
 | 
						|
import java.util.List;
 | 
						|
 | 
						|
import siprp.MedicinaConstants;
 | 
						|
import siprp.data.ExameData;
 | 
						|
import siprp.database.cayenne.objects.Empresas;
 | 
						|
import siprp.database.cayenne.objects.Estabelecimentos;
 | 
						|
import siprp.database.cayenne.objects.Trabalhadores;
 | 
						|
import siprp.database.cayenne.providers.MedicinaDAO;
 | 
						|
import siprp.ficha.FichaAptidaoConstants;
 | 
						|
 | 
						|
import com.evolute.utils.Singleton;
 | 
						|
import com.evolute.utils.arrays.Virtual2DArray;
 | 
						|
import com.evolute.utils.db.DBException;
 | 
						|
import com.evolute.utils.db.DBManager;
 | 
						|
import com.evolute.utils.db.Executer;
 | 
						|
import com.evolute.utils.sql.Assignment;
 | 
						|
import com.evolute.utils.sql.Field;
 | 
						|
import com.evolute.utils.sql.Insert;
 | 
						|
import com.evolute.utils.sql.Select;
 | 
						|
import com.evolute.utils.sql.Select2;
 | 
						|
import com.evolute.utils.sql.Update;
 | 
						|
 | 
						|
/**
 | 
						|
 *
 | 
						|
 * @author lflores
 | 
						|
 */
 | 
						|
public class LembretesDataProvider
 | 
						|
{
 | 
						|
	private static final Object LOCK = new Object();
 | 
						|
	private static LembretesDataProvider instance = null;
 | 
						|
	
 | 
						|
	private final HashMap<String,TipoLembrete> TIPOS_LEMBRETES_BY_CODIGO =
 | 
						|
			new HashMap<String,TipoLembrete>();
 | 
						|
	private final HashMap<Integer,TipoLembrete> TIPOS_LEMBRETES_BY_ID =
 | 
						|
			new HashMap<Integer,TipoLembrete>();
 | 
						|
	private TipoLembrete tiposLembrete[];
 | 
						|
	
 | 
						|
	private MedicinaDAO medicinaDAO = null ;
 | 
						|
	
 | 
						|
	private Executer EXECUTER;
 | 
						|
	
 | 
						|
	/** Creates a new instance of LembretesDataProvider */
 | 
						|
	public LembretesDataProvider()
 | 
						|
		throws Exception
 | 
						|
	{
 | 
						|
		DBManager dbm = ( DBManager ) Singleton.getInstance( Singleton.DEFAULT_DBMANAGER );
 | 
						|
		EXECUTER = dbm.getSharedExecuter( this );
 | 
						|
		medicinaDAO = new MedicinaDAO();
 | 
						|
	}
 | 
						|
	
 | 
						|
	public static LembretesDataProvider getProvider()
 | 
						|
		throws Exception
 | 
						|
	{
 | 
						|
		synchronized( LOCK )
 | 
						|
		{
 | 
						|
			if( instance == null )
 | 
						|
			{
 | 
						|
				instance = new LembretesDataProvider();
 | 
						|
			}
 | 
						|
		}
 | 
						|
		return instance;
 | 
						|
	}
 | 
						|
	
 | 
						|
	public TipoLembrete[] getTiposLembrete()
 | 
						|
		throws Exception
 | 
						|
	{
 | 
						|
		if( tiposLembrete == null )
 | 
						|
		{
 | 
						|
			Select select = 
 | 
						|
					new Select( new String[]{ "lembretes_tipos" },
 | 
						|
								new String[]{ "id", "codigo", "descricao", "ordem" },
 | 
						|
								new Field( "activo" ).isEqual( "y" ),
 | 
						|
								new String[]{ "ordem" },
 | 
						|
								null );
 | 
						|
			Virtual2DArray array = EXECUTER.executeQuery( select );
 | 
						|
			tiposLembrete = new TipoLembrete[ array.columnLength() ];
 | 
						|
			for( int n = 0; n < tiposLembrete.length; n++ )
 | 
						|
			{
 | 
						|
				Integer id = ( Integer ) array.get( n, 0 );
 | 
						|
				String codigo = ( String ) array.get( n, 1 );
 | 
						|
				String descricao = ( String ) array.get( n, 2 );
 | 
						|
				Integer ordem = ( Integer ) array.get( n, 3 );
 | 
						|
				tiposLembrete[ n ] = new TipoLembrete( id, codigo, descricao, ordem );
 | 
						|
				TIPOS_LEMBRETES_BY_CODIGO.put( codigo, tiposLembrete[ n ] );
 | 
						|
				TIPOS_LEMBRETES_BY_ID.put( id, tiposLembrete[ n ] );
 | 
						|
			}
 | 
						|
		}
 | 
						|
		return tiposLembrete;
 | 
						|
	}
 | 
						|
	
 | 
						|
	public Integer getTipoLembreteIDByCodigo( String codigo )
 | 
						|
	{
 | 
						|
		Integer result = null;
 | 
						|
		TipoLembrete tipo;
 | 
						|
		try
 | 
						|
		{
 | 
						|
			tipo = getTipoLembreteByCodigo( codigo );
 | 
						|
			if( tipo != null )
 | 
						|
			{
 | 
						|
				result = tipo.getID();
 | 
						|
			}
 | 
						|
		} catch( Exception e )
 | 
						|
		{
 | 
						|
			e.printStackTrace();
 | 
						|
		}
 | 
						|
		return result;
 | 
						|
	}
 | 
						|
	
 | 
						|
	public TipoLembrete getTipoLembreteByCodigo( String codigo )
 | 
						|
		throws Exception
 | 
						|
	{
 | 
						|
		getTiposLembrete();
 | 
						|
		return TIPOS_LEMBRETES_BY_CODIGO.get( codigo );
 | 
						|
	}
 | 
						|
	
 | 
						|
	public TipoLembrete getTipoLembreteByID( Integer id )
 | 
						|
		throws Exception
 | 
						|
	{
 | 
						|
		getTiposLembrete();
 | 
						|
		return TIPOS_LEMBRETES_BY_ID.get( id );
 | 
						|
	}
 | 
						|
	
 | 
						|
	public void criarLembrete( Integer tipoID,
 | 
						|
								Date data,
 | 
						|
								String descricao,
 | 
						|
								String texto,
 | 
						|
								Integer empresaID,
 | 
						|
								Integer estabelecimentoID,
 | 
						|
								Integer trabalhadorID,
 | 
						|
								Integer marcacaoEstabelecimentoID,
 | 
						|
								Integer marcacaoTrabalhadorID,
 | 
						|
								boolean enviarEmail,
 | 
						|
								Integer periodicidadeDias,
 | 
						|
								Integer periodicidadeMeses )
 | 
						|
		throws Exception
 | 
						|
	{
 | 
						|
		Insert insert = 
 | 
						|
			new Insert( "lembretes",
 | 
						|
						new Assignment[]{
 | 
						|
							new Assignment( new Field( "tipo_id" ), tipoID ),
 | 
						|
							new Assignment( new Field( "data" ), data ),
 | 
						|
							new Assignment( new Field( "descricao" ), descricao ),
 | 
						|
							new Assignment( new Field( "texto" ), texto ),
 | 
						|
							new Assignment( new Field( "empresa_id" ), empresaID ),
 | 
						|
							new Assignment( new Field( "estabelecimento_id" ), estabelecimentoID ),
 | 
						|
							new Assignment( new Field( "trabalhador_id" ), trabalhadorID ),
 | 
						|
							new Assignment( new Field( "marcacao_estabelecimento_id" ), marcacaoEstabelecimentoID ),
 | 
						|
							new Assignment( new Field( "marcacao_trabalhador_id" ), marcacaoTrabalhadorID ),
 | 
						|
							new Assignment( new Field( "enviar_email" ), enviarEmail ? "y" : "n" ),
 | 
						|
							new Assignment( new Field( "periodicidade_dias" ), periodicidadeDias ),
 | 
						|
							new Assignment( new Field( "periodicidade_meses" ), periodicidadeMeses ) } );
 | 
						|
		EXECUTER.executeQuery( insert );
 | 
						|
	}
 | 
						|
	
 | 
						|
	public void criarLembreteConsulta( Integer tipoID, Date date, String descricao, String texto, Integer empresaID, Integer estabelecimentoID, Integer trabalhadorID, Integer consultaMarcacaoID )
 | 
						|
	{
 | 
						|
		criarLembreteNew( tipoID, date, descricao, texto, empresaID, estabelecimentoID, trabalhadorID, consultaMarcacaoID, true);
 | 
						|
	}
 | 
						|
	
 | 
						|
	public void criarLembreteExame( Integer tipoID, Date date, String descricao, String texto, Integer empresaID, Integer estabelecimentoID, Integer trabalhadorID, Integer consultaExameID )
 | 
						|
	{
 | 
						|
		criarLembreteNew( tipoID, date, descricao, texto, empresaID, estabelecimentoID, trabalhadorID, consultaExameID, false );
 | 
						|
	}
 | 
						|
	
 | 
						|
	private void criarLembreteNew( Integer tipoID, Date date, String descricao, String texto, Integer empresaID, Integer estabelecimentoID, Integer trabalhadorID, Integer marcacaoID, boolean isConsulta )
 | 
						|
	{
 | 
						|
		try
 | 
						|
		{
 | 
						|
			Select2 query = new Select2(
 | 
						|
					new String[]{ "lembretes" },
 | 
						|
					null,
 | 
						|
					null,
 | 
						|
					new String[]{ "id" },
 | 
						|
					new Field( "tipo_id" ).isEqual( tipoID ).
 | 
						|
					and( new Field( "data" ).isEqual( date ).
 | 
						|
							and( new Field( "trabalhador_id" ).isEqual( trabalhadorID ) ) ),
 | 
						|
					null, null, null, null);
 | 
						|
			Virtual2DArray array = EXECUTER.executeQuery( query );
 | 
						|
			if( array.columnLength() == 0 )
 | 
						|
			{
 | 
						|
				Insert insert = 
 | 
						|
					new Insert( "lembretes",
 | 
						|
								new Assignment[]{
 | 
						|
									new Assignment( new Field( "tipo_id" ), tipoID ),
 | 
						|
									new Assignment( new Field( "data" ), date ),
 | 
						|
									new Assignment( new Field( "descricao" ), descricao ),
 | 
						|
									new Assignment( new Field( "texto" ), texto ),
 | 
						|
									new Assignment( new Field( "empresa_id" ), empresaID ),
 | 
						|
									new Assignment( new Field( "estabelecimento_id" ), estabelecimentoID ),
 | 
						|
									new Assignment( new Field( "trabalhador_id" ), trabalhadorID ),
 | 
						|
									new Assignment( new Field( isConsulta ? "trabalhadores_consultas_datas_id" : "trabalhadores_ecds_datas_id" ), marcacaoID ) } );
 | 
						|
				EXECUTER.executeQuery( insert );
 | 
						|
			}
 | 
						|
		}
 | 
						|
		catch( Exception e )
 | 
						|
		{
 | 
						|
			e.printStackTrace();
 | 
						|
		}
 | 
						|
	}
 | 
						|
 | 
						|
	public void apagarLembreteByID( Integer id )
 | 
						|
		throws Exception
 | 
						|
	{
 | 
						|
		Update update =	new Update( "lembretes", new Assignment[]{ new Assignment(new Field("deleted_date"),new Date()) }, new Field("id").isEqual( id ) );
 | 
						|
		EXECUTER.executeQuery( update );
 | 
						|
	}
 | 
						|
	
 | 
						|
	public void apagarLembreteByMarcacaoTrabalhadorID( Integer marcacaoID )
 | 
						|
		throws Exception
 | 
						|
	{
 | 
						|
		Update update = new Update( "lembretes", new Assignment[]{ new Assignment(new Field("deleted_date"),new Date()) }, new Field("marcacao_trabalhador_id").isEqual( marcacaoID ) );
 | 
						|
		EXECUTER.executeQuery( update );
 | 
						|
	}
 | 
						|
	
 | 
						|
	public int countLembretesByTipo( Integer tipoID )
 | 
						|
		throws Exception
 | 
						|
	{
 | 
						|
		Select select = 
 | 
						|
				new Select( new String[]{ "lembretes" },
 | 
						|
							new String[]{ "COUNT(*)" },
 | 
						|
							new Field( "tipo_id" ).isEqual( tipoID ).and( 
 | 
						|
							new Field( "data" ).isLessOrEqual( new Date() ) ).and(
 | 
						|
							new Field( "deleted_date" ).isEqual( null ) ) );
 | 
						|
		Virtual2DArray array = EXECUTER.executeQuery( select );
 | 
						|
		if( array.columnLength() == 0 || array.get( 0, 0 ) == null )
 | 
						|
		{
 | 
						|
			return 0;
 | 
						|
		}
 | 
						|
		else
 | 
						|
		{
 | 
						|
			return ( ( Number ) array.get( 0, 0 ) ).intValue();
 | 
						|
		}
 | 
						|
				
 | 
						|
	}
 | 
						|
	
 | 
						|
	public Lembrete[] getLembretesByTipo( Integer tipoID )
 | 
						|
		throws Exception
 | 
						|
	{
 | 
						|
		Select select =
 | 
						|
			new Select( new String[]{ "lembretes" },
 | 
						|
						new String[]{ "id", "tipo_id", "data", "descricao",
 | 
						|
										"texto", "empresa_id", "estabelecimento_id",
 | 
						|
										"trabalhador_id", "marcacao_estabelecimento_id",
 | 
						|
										"marcacao_trabalhador_id", "enviar_email",
 | 
						|
										"periodicidade_dias", "periodicidade_meses" , "trabalhadores_consultas_datas_id", "trabalhadores_ecds_datas_id" },
 | 
						|
						new Field( "tipo_id" ).isEqual( tipoID ).and( 
 | 
						|
						new Field( "data" ).isLessOrEqual( new Date() ) ).and(
 | 
						|
								new Field( "deleted_date" ).isEqual( null ) ) );
 | 
						|
		Virtual2DArray array = EXECUTER.executeQuery( select );
 | 
						|
		Lembrete lembretes[] = new Lembrete[ array.columnLength() ];
 | 
						|
		for( int n = 0; n < lembretes.length; n++ )
 | 
						|
		{
 | 
						|
			Integer id = ( Integer ) array.get( n, 0 );
 | 
						|
			Date data = ( Date ) array.get( n, 2 );
 | 
						|
			String descricao = ( String ) array.get( n, 3 );
 | 
						|
			String texto = ( String ) array.get( n, 4 );
 | 
						|
			Integer empresaID = ( Integer ) array.get( n, 5 );
 | 
						|
			Integer estabelecimentoID = ( Integer ) array.get( n, 6 );
 | 
						|
			Integer trabalhadorID = ( Integer ) array.get( n, 7 );
 | 
						|
			Integer marcacaoEstabelecimentoID = ( Integer ) array.get( n, 8 );
 | 
						|
			Integer marcacaoTrabalhadorID = ( Integer ) array.get( n, 9 );
 | 
						|
			boolean enviarEmail = "y".equals( array.get( n, 10 ) );
 | 
						|
			Integer periodicidadeDias = ( Integer ) array.get( n, 11 );
 | 
						|
			Integer periodicidadeMeses = ( Integer ) array.get( n, 12 );
 | 
						|
			Integer consultaDataID = ( Integer ) array.get( 0, 13 );
 | 
						|
			Integer exameDataID = ( Integer ) array.get( 0, 14 );
 | 
						|
			lembretes[ n ] = new Lembrete( id, tipoID, data, descricao, texto,
 | 
						|
											empresaID, estabelecimentoID, trabalhadorID,
 | 
						|
											marcacaoEstabelecimentoID, marcacaoTrabalhadorID,
 | 
						|
											enviarEmail, periodicidadeDias, periodicidadeMeses, consultaDataID, exameDataID );
 | 
						|
		}
 | 
						|
		return lembretes;
 | 
						|
	}
 | 
						|
	
 | 
						|
	public Lembrete getLembreteByID( Integer id )
 | 
						|
		throws Exception
 | 
						|
	{
 | 
						|
		Select select =
 | 
						|
			new Select( new String[]{ "lembretes" },
 | 
						|
						new String[]{ "id", "tipo_id", "data", "descricao",
 | 
						|
										"texto", "empresa_id", "estabelecimento_id",
 | 
						|
										"trabalhador_id", "marcacao_estabelecimento_id",
 | 
						|
										"marcacao_trabalhador_id", "enviar_email",
 | 
						|
										"periodicidade_dias", "periodicidade_meses", "trabalhadores_consultas_datas_id", "trabalhadores_ecds_datas_id" },
 | 
						|
						new Field( "id" ).isEqual( id ).and(
 | 
						|
								new Field( "deleted_date" ).isEqual( null ) ) );
 | 
						|
		Virtual2DArray array = EXECUTER.executeQuery( select );
 | 
						|
		if( array.columnLength() == 0 )
 | 
						|
		{
 | 
						|
			return null;
 | 
						|
		}
 | 
						|
		else
 | 
						|
		{
 | 
						|
			Integer tipoID = ( Integer ) array.get( 0, 1 );
 | 
						|
			Date data = ( Date ) array.get( 0, 2 );
 | 
						|
			String descricao = ( String ) array.get( 0, 3 );
 | 
						|
			String texto = ( String ) array.get( 0, 4 );
 | 
						|
			Integer empresaID = ( Integer ) array.get( 0, 5 );
 | 
						|
			Integer estabelecimentoID = ( Integer ) array.get( 0, 6 );
 | 
						|
			Integer trabalhadorID = ( Integer ) array.get( 0, 7 );
 | 
						|
			Integer marcacaoEstabelecimentoID = ( Integer ) array.get( 0, 8 );
 | 
						|
			Integer marcacaoTrabalhadorID = ( Integer ) array.get( 0, 9 );
 | 
						|
			boolean enviarEmail = "y".equals( array.get( 0, 10 ) );
 | 
						|
			Integer periodicidadeDias = ( Integer ) array.get( 0, 11 );
 | 
						|
			Integer periodicidadeMeses = ( Integer ) array.get( 0, 12 );
 | 
						|
			Integer consultaDataID = ( Integer ) array.get( 0, 13 );
 | 
						|
			Integer exameDataID = ( Integer ) array.get( 0, 14 );
 | 
						|
			return new Lembrete( id, tipoID, data, descricao, texto,
 | 
						|
											empresaID, estabelecimentoID, trabalhadorID,
 | 
						|
											marcacaoEstabelecimentoID, marcacaoTrabalhadorID,
 | 
						|
											enviarEmail, periodicidadeDias, periodicidadeMeses, consultaDataID, exameDataID );
 | 
						|
		}
 | 
						|
	}
 | 
						|
 | 
						|
	private Calendar makeDateCalendar()
 | 
						|
	{
 | 
						|
		Calendar now = Calendar.getInstance();
 | 
						|
		Calendar nowDate = Calendar.getInstance();
 | 
						|
		nowDate.clear();
 | 
						|
		nowDate.set( Calendar.YEAR, now.get( Calendar.YEAR ) );
 | 
						|
		nowDate.set( Calendar.MONTH, now.get( Calendar.MONTH ) );
 | 
						|
		nowDate.set( Calendar.DAY_OF_MONTH, now.get( Calendar.DAY_OF_MONTH ) );
 | 
						|
		return nowDate;
 | 
						|
	}
 | 
						|
	
 | 
						|
	public List<Integer> getFichasExpiradasID()
 | 
						|
	{
 | 
						|
		List<Integer> fichasExpiradas = new LinkedList<Integer>();
 | 
						|
		try
 | 
						|
		{
 | 
						|
			Calendar nowDate = makeDateCalendar();
 | 
						|
			Select2 query = new Select2(
 | 
						|
					new String[]{ "exames" },
 | 
						|
					null,
 | 
						|
					null,
 | 
						|
					new String[]{ "id" },
 | 
						|
					new Field( "proximo_exame" ).isEqual( nowDate.getTime() ).
 | 
						|
					and( new Field( "tipo" ).isEqual( FichaAptidaoConstants.CODIGO_TIPO_PERIODICO ) ),
 | 
						|
					null, null, null, null);
 | 
						|
			Virtual2DArray array = EXECUTER.executeQuery( query );
 | 
						|
			for( int i = 0; i < array.columnLength(); fichasExpiradas.add( (Integer) array.get( i, 0 ) ), ++i );
 | 
						|
		} catch( DBException e )
 | 
						|
		{
 | 
						|
			e.printStackTrace();
 | 
						|
		}
 | 
						|
		return fichasExpiradas;
 | 
						|
	}
 | 
						|
	
 | 
						|
 | 
						|
//	public List<Integer> getFichasExpiradasSemData()
 | 
						|
//	{
 | 
						|
//		List<Integer> fichasExpiradas = new LinkedList<Integer>();
 | 
						|
//		try
 | 
						|
//		{
 | 
						|
//			Calendar date = makeDateCalendar();
 | 
						|
//			date.add( Calendar.MONTH, -22 );
 | 
						|
//			Select2 query = new Select2(
 | 
						|
//					new String[]{ "exames" },
 | 
						|
//					null,
 | 
						|
//					null,
 | 
						|
//					new String[]{ "id" },
 | 
						|
//					new Field( "proximo_exame" ).isEqual( null ).and( new Field( "data" ).isEqual( date.getTime() ) ),
 | 
						|
//					null, null, null, null);
 | 
						|
//			Virtual2DArray array = EXECUTER.executeQuery( query );
 | 
						|
//			for( int i = 0; i < array.columnLength(); fichasExpiradas.add( (Integer) array.get( i, 0 ) ), ++i );
 | 
						|
//		} catch( DBException e )
 | 
						|
//		{
 | 
						|
//			e.printStackTrace();
 | 
						|
//		}
 | 
						|
//		return fichasExpiradas;
 | 
						|
//	}
 | 
						|
 | 
						|
	public void createLembretesForFichas( List<Integer> fichas )
 | 
						|
	{
 | 
						|
		Integer tipoID = getTipoLembreteIDByCodigo( LembretesConstants.CODE_MARCACOES );
 | 
						|
		for( Integer fichaID : fichas )
 | 
						|
		{
 | 
						|
			createLembreteForFicha( fichaID, tipoID, new Date() );
 | 
						|
		}	
 | 
						|
	}
 | 
						|
	
 | 
						|
	private Integer getTrabalhadorIDForFichaID( Integer fichaID )
 | 
						|
	{
 | 
						|
		Integer result = null;
 | 
						|
		try
 | 
						|
		{
 | 
						|
			Select2 query = new Select2(
 | 
						|
					new String[]{ "exames" },
 | 
						|
					null,
 | 
						|
					null,
 | 
						|
					new String[]{ "trabalhador_id" },
 | 
						|
					new Field( "id" ).isEqual( fichaID ),
 | 
						|
					null, null, null, null);
 | 
						|
			Virtual2DArray array = EXECUTER.executeQuery( query );
 | 
						|
			result = (Integer) array.get( 0, 0 );
 | 
						|
		} catch( DBException e )
 | 
						|
		{
 | 
						|
			e.printStackTrace();
 | 
						|
		}
 | 
						|
		return result;
 | 
						|
	}
 | 
						|
	
 | 
						|
	private void createLembreteForFicha( Integer fichaID, Integer tipoID, Date when )
 | 
						|
	{
 | 
						|
		try
 | 
						|
		{
 | 
						|
			Integer trabalhadorID = getTrabalhadorIDForFichaID( fichaID );
 | 
						|
			Trabalhadores trabalhador = medicinaDAO.getTrabalhadorByID( trabalhadorID );
 | 
						|
			Estabelecimentos estabelecimento = trabalhador.getToEstabelecimentos();
 | 
						|
			Empresas empresa = estabelecimento.getToEmpresas();
 | 
						|
			criarLembreteConsulta( tipoID,
 | 
						|
					when == null ? new Date() : when,
 | 
						|
					MedicinaConstants.LEMBRETE_RENOVACAO_FICHA_APTIDAO_STRING,
 | 
						|
					null,
 | 
						|
					empresa.getId(),
 | 
						|
					estabelecimento.getId(),
 | 
						|
					trabalhador.getId(),
 | 
						|
					null
 | 
						|
					);
 | 
						|
		}
 | 
						|
		catch(Exception e)
 | 
						|
		{
 | 
						|
			System.out.println(e);
 | 
						|
		}
 | 
						|
	}
 | 
						|
 | 
						|
	public void criarLembreteFicha( ExameData exame, Date when )
 | 
						|
	{
 | 
						|
		Integer tipoID = getTipoLembreteIDByCodigo( LembretesConstants.CODE_MARCACOES );
 | 
						|
		createLembreteForFicha( (Integer) exame.get( ExameData.ID ), tipoID, when );
 | 
						|
	}
 | 
						|
	
 | 
						|
}
 |