Skip to content

Commit

Permalink
feat(MISC-259): API agregar índices a mongo (#1864)
Browse files Browse the repository at this point in the history
Co-authored-by: aldoEMatamala <aldo.emanuel.matamla@gmail.com>
  • Loading branch information
aldoEMatamala and aldoEMatamala committed Jun 18, 2024
1 parent d4b1277 commit a3c2880
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion core-v2/mpi/paciente/paciente.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ PacienteSchema.plugin(mongoose_fuzzy_searching, {
}]
});

PacienteSchema.index({ tokens: 1 });
PacienteSchema.index({ tokens: 1, activo: 1 });
PacienteSchema.index({ documento: 1, sexo: 1 });
PacienteSchema.index({ estado: 1, activo: 1, updateAt: 1 });

Expand Down
6 changes: 6 additions & 0 deletions modules/rup/internacion/censos.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,11 @@ export const CensoSchema = new mongoose.Schema({
}]
});

CensoSchema.index({
idOrganizacion: 1,
unidadOrganizativa: 1,
start: 1,
end: 1
});

export const Censo = mongoose.model('internacionCensos', CensoSchema, 'internacionCensos');
8 changes: 8 additions & 0 deletions modules/rup/schemas/prestacion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ PrestacionSchema.index({
'ejecucion.fecha': 1,
'solicitud.tipoPrestacion.conceptId': 1
});

PrestacionSchema.index({
createdAt: 1,
'solicitud.organizacion.id': 1,
Expand Down Expand Up @@ -343,6 +344,13 @@ PrestacionSchema.index({
'ejecucion.registros.valor.informeIngreso.fechaIngreso': 1,
}, { sparse: true, name: 'LISTADO-INTERNACIONES' });

PrestacionSchema.index({
'solicitud.organizacion.id': 1,
'solicitud.ambitoOrigen': 1,
'solicitud.tipoPrestacion.conceptId': 1,
'ejecucion.registros.valor.InformeEgreso.fechaEgreso': 1,
}, { sparse: true, name: 'Listado-internacion-egreso' });

PrestacionSchema.index({
'solicitud.prestacionOrigen': 1,
'paciente.id': 1
Expand Down

0 comments on commit a3c2880

Please sign in to comment.