File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,9 +22,9 @@ export async function createFile(idExportHuds) {
2222 // recuperamos las posibles vinculaciones del paciente para traer también todas las prestaciones asociadas a esas vinculaciones
2323 const paciente = await Paciente . findById ( peticionExport . pacienteId ) ;
2424 const vinculacionesPaciente = paciente . identificadores
25- . filter ( item => item . entidad === 'ANDES' && item . valor ?. length )
26- . map ( item => item . valor ) ;
27- const idsPaciente = [ ...vinculacionesPaciente , peticionExport . pacienteId ] ;
25+ ? .filter ( item => item . entidad === 'ANDES' && item . valor ?. length )
26+ ? .map ( item => item . valor ) ;
27+ const idsPaciente = vinculacionesPaciente ?. length ? [ ...vinculacionesPaciente , peticionExport . pacienteId ] : [ peticionExport . pacienteId ] ;
2828 const query = {
2929 'paciente.id' : { $in : idsPaciente } ,
3030 'estadoActual.tipo' : 'validada'
You can’t perform that action at this time.
0 commit comments