Skip to content

Commit

Permalink
feat(IN-573): nuevo rol de internacion: farmacia
Browse files Browse the repository at this point in the history
  • Loading branch information
MarianoCampetella committed Mar 7, 2024
1 parent d4fbbdb commit e93aea8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
1 change: 1 addition & 0 deletions auth/permisos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ export default [
{ key: 'enfermeria', title: 'Enfermero', type: 'boolean' },
{ key: 'estadistica', title: 'Estadístico', type: 'boolean' },
{ key: 'interconsultores', title: 'Interconsultor', type: 'boolean' },
{ key: 'farmaceutica', title: 'Farmacéutico', type: 'boolean' },
{ key: 'estadistica-v2', title: 'Estadístico (nuevo)', type: 'boolean' }
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@ class PlanIndicacionesController extends ResourceBase<IPlanIndicacionesDoc> {
internacion: MongoQuery.equalMatch.withField('idInternacion'),
prestacion: MongoQuery.equalMatch.withField('idPrestacion'),
registro: MongoQuery.equalMatch.withField('idRegistro'),
rangoFechas:(fecha: Date)=>{
return { $or:[
{ fechaInicio: { $gte: moment(fecha).startOf('day').toDate() } },
{ fechaInicio: { $lte: moment(fecha).endOf('day').add(1, 'd').toDate() } }
] };
rangoFechas: (fecha: Date) => {
return {
$or: [
{ fechaInicio: { $gte: moment(fecha).startOf('day').toDate() } },
{ fechaInicio: { $lte: moment(fecha).endOf('day').add(1, 'd').toDate() } }
]
};
}
};
eventBus = EventCore;
Expand All @@ -38,9 +40,12 @@ PlanIndicacionesRouter.patch('/plan-indicaciones/:id/estado', asyncHandler(async
if (indicacion) {
const estado = req.body;
if (estado.verificacion) {
indicacion.estados[indicacion.estados.length - 1] = req.body;
indicacion.estados[indicacion.estados.length - 1] = estado;
} else {
indicacion.estados.push(estado);
if (req.body.continuarIndicacion) {
indicacion.estadoActual.verificacion = undefined;
}
}
Auth.audit(indicacion, req);
const indicacionUpdated = await indicacion.save();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export type IPlanIndicacionesDoc = AndesDoc<IPlanIndicaciones>;
export const PlanIndicacionesEstadoSchema = new Schema({
tipo: {
type: String,
enum: ['active', 'on-hold', 'cancelled', 'completed', 'entered-in-error', 'stopped', 'draft', 'unknown', 'edited', 'pending']
enum: ['active', 'on-hold', 'cancelled', 'completed', 'entered-in-error', 'stopped', 'draft', 'unknown', 'edited', 'pending', 'bypass']
},
fecha: Date,
observaciones: String,
Expand Down

0 comments on commit e93aea8

Please sign in to comment.