Skip to content

Commit

Permalink
fix (CDA): corrige respuesta de error al crear CDA
Browse files Browse the repository at this point in the history
  • Loading branch information
MCele committed Nov 13, 2023
1 parent f9151e2 commit 9b52554
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions modules/cda/routes/cda.ts
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ async function createCDA(req, res, next) {
const prestacion = await cdaCtr.matchCode(req.body.tipoPrestacion);
if (!prestacion) {
// Es obligatorio que posea prestación
return next({ error: `prestacion_invalida ${req.body.tipoPrestacion}` });
return next(`prestacion_invalida ${req.body.tipoPrestacion}`);
}
const cie10Code = req.body.cie10;
const file: string = req.body.file;
Expand All @@ -381,7 +381,7 @@ async function createCDA(req, res, next) {
{ codigo: cie10Code + '.8' }]
});
if (!cie10) {
return next({ error: `cie10_invalid ${cie10Code}` });
return next(`cie10_invalid ${cie10Code}`);
}
}
let confidencialidad = 'N';
Expand All @@ -391,7 +391,7 @@ async function createCDA(req, res, next) {

const paciente = await cdaCtr.findOrCreate(req, dataPaciente, organizacion._id);
if (!paciente) {
return next({ error: 'paciente_inexistente' });
return next('paciente_inexistente');
}
const uniqueId = String(new ObjectId());

Expand All @@ -409,7 +409,7 @@ async function createCDA(req, res, next) {
};
adjuntos = [{ path: fileData.data, id: ObjectId(fileData.id), adapter: 'drive' }];
} else {
return next({ error: 'file_not_exists' });
return next('file_not_exists');
}
} else {
const fileObj: any = cdaCtr.base64toStream(file);
Expand Down

0 comments on commit 9b52554

Please sign in to comment.