|
|
|
@ -169,12 +169,9 @@ public class LocaisRealizacaoDataProvider
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Integer id = ( Integer ) array.get( n, 0 );
|
|
|
|
Integer id = ( Integer ) array.get( n, 0 );
|
|
|
|
String nome = ( String ) array.get( n, 1 );
|
|
|
|
String nome = ( String ) array.get( n, 1 );
|
|
|
|
System.out.println( id + " - " + nome );
|
|
|
|
|
|
|
|
estabelecimentos[ n ] = new ColumnizedMappable( id, nome );
|
|
|
|
estabelecimentos[ n ] = new ColumnizedMappable( id, nome );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
System.out.println("Estabelecimentos: " + estabelecimentos.length );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return estabelecimentos;
|
|
|
|
return estabelecimentos;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -365,6 +362,52 @@ System.out.println("Estabelecimentos: " + estabelecimentos.length );
|
|
|
|
return ( ( Number ) array.get( 0, 0 ) ).intValue();
|
|
|
|
return ( ( Number ) array.get( 0, 0 ) ).intValue();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void setPrestadorIdForGruposEcdsEstabelecimentoAndDate( Integer estabelecimentoId, Date data, Integer prestadorId )
|
|
|
|
|
|
|
|
throws Exception
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Select selectConsultas =
|
|
|
|
|
|
|
|
new Select2(
|
|
|
|
|
|
|
|
new String[]{ "trabalhadores_consultas", "trabalhadores" },
|
|
|
|
|
|
|
|
new Integer[]{ Select2.JOIN_INNER },
|
|
|
|
|
|
|
|
new Expression[]{
|
|
|
|
|
|
|
|
new Field( "trabalhadores_consultas.trabalhador_id" ).isEqual( new Field( "trabalhadores.id" ) ) },
|
|
|
|
|
|
|
|
new String[]{ "DISTINCT trabalhadores_consultas.id" },
|
|
|
|
|
|
|
|
new Field( "trabalhadores_consultas.data" ).isEqual( data ).and(
|
|
|
|
|
|
|
|
new Field( "trabalhadores.estabelecimento_id" ).isEqual( estabelecimentoId ) ).and(
|
|
|
|
|
|
|
|
new Field( "trabalhadores_consultas.estado" ).isEqual( new Integer( MedicinaConstants.ESTADO_POR_REALIZAR ) ) ),
|
|
|
|
|
|
|
|
null,
|
|
|
|
|
|
|
|
null,
|
|
|
|
|
|
|
|
null,
|
|
|
|
|
|
|
|
null );
|
|
|
|
|
|
|
|
Update updateConsultas = new Update( "trabalhadores_consultas",
|
|
|
|
|
|
|
|
new Assignment[]{
|
|
|
|
|
|
|
|
new Assignment( new Field( "prestador_id" ), prestadorId )
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
new Field( "id" ).in( selectConsultas ) );
|
|
|
|
|
|
|
|
EXECUTER.executeQuery( updateConsultas );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Select selectConsultasDatas =
|
|
|
|
|
|
|
|
new Select2(
|
|
|
|
|
|
|
|
new String[]{ "trabalhadores_consultas_datas", "trabalhadores_consultas", "trabalhadores" },
|
|
|
|
|
|
|
|
new Integer[]{ Select2.JOIN_INNER, Select2.JOIN_INNER },
|
|
|
|
|
|
|
|
new Expression[]{
|
|
|
|
|
|
|
|
new Field( "trabalhadores_consultas_datas.trabalhadores_consultas_id" ).isEqual( new Field( "trabalhadores_consultas.id" ) ),
|
|
|
|
|
|
|
|
new Field( "trabalhadores_consultas.trabalhador_id" ).isEqual( new Field( "trabalhadores.id" ) ) },
|
|
|
|
|
|
|
|
new String[]{ "DISTINCT trabalhadores_consultas_datas.id" },
|
|
|
|
|
|
|
|
new Field( "trabalhadores_consultas_datas.data" ).isEqual( data ).and(
|
|
|
|
|
|
|
|
new Field( "trabalhadores.estabelecimento_id" ).isEqual( estabelecimentoId ) ).and(
|
|
|
|
|
|
|
|
new Field( "trabalhadores_consultas_datas.estado" ).isEqual( new Integer( MedicinaConstants.ESTADO_POR_REALIZAR ) ) ),
|
|
|
|
|
|
|
|
null,
|
|
|
|
|
|
|
|
null,
|
|
|
|
|
|
|
|
null,
|
|
|
|
|
|
|
|
null );
|
|
|
|
|
|
|
|
Update updateConsultasDatas = new Update( "trabalhadores_consultas_datas",
|
|
|
|
|
|
|
|
new Assignment[]{
|
|
|
|
|
|
|
|
new Assignment( new Field( "prestador_id" ), prestadorId )
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
new Field( "id" ).in( selectConsultasDatas ) );
|
|
|
|
|
|
|
|
EXECUTER.executeQuery( updateConsultasDatas );
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected IDObject[] getExamesOficiaisByEstabelecimentoAndDate( Integer estabelecimentoId, Date data )
|
|
|
|
protected IDObject[] getExamesOficiaisByEstabelecimentoAndDate( Integer estabelecimentoId, Date data )
|
|
|
|
throws Exception
|
|
|
|
throws Exception
|
|
|
|
@ -451,4 +494,7 @@ System.out.println("Estabelecimentos: " + estabelecimentos.length );
|
|
|
|
Virtual2DArray array = EXECUTER.executeQuery( select );
|
|
|
|
Virtual2DArray array = EXECUTER.executeQuery( select );
|
|
|
|
return ( ( Number ) array.get( 0, 0 ) ).intValue();
|
|
|
|
return ( ( Number ) array.get( 0, 0 ) ).intValue();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|