From 308daf6eab020b9152b48dbb8ad4306233b6e083 Mon Sep 17 00:00:00 2001 From: aldoEMatamala Date: Tue, 12 May 2026 15:33:48 -0300 Subject: [PATCH] feat(MPI-478): Filtros para busqueda de paciente --- core-v2/mpi/paciente/paciente.routes.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core-v2/mpi/paciente/paciente.routes.ts b/core-v2/mpi/paciente/paciente.routes.ts index a14e9be222..85fd069800 100644 --- a/core-v2/mpi/paciente/paciente.routes.ts +++ b/core-v2/mpi/paciente/paciente.routes.ts @@ -78,6 +78,10 @@ class PacienteResource extends ResourceBase { field: 'fechaNacimiento', fn: (value) => (MongoQuery.matchDate(value)) }, + obraSocial: { + field: 'financiador.nombre', + fn: MongoQuery.partialString + }, search: ['documento', 'nombre', 'apellido', 'sexo', 'certificadoRenaper'] }; eventBus = EventCore; @@ -120,7 +124,8 @@ export const get = async (req: Request, res: Response) => { const conditions = { ...req.query }; delete conditions.search; Object.keys(options).map(opt => delete conditions[opt]); - const pacientes = await multimatch(req.query.search, conditions, options); + const filter = MongoQuery.buildQuery(conditions, PacienteCtr.searchFileds); + const pacientes = await multimatch(req.query.search, filter, options); return res.json(pacientes); } else { if (Object.keys(req.query).length) {