Skip to content

Commit

Permalink
feat(IN): Agrega campo de configuracion de frecuencia en un seccion d…
Browse files Browse the repository at this point in the history
…el plan
  • Loading branch information
silviroa committed May 3, 2023
1 parent f3e0660 commit 65fdccc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions modules/rup/internacion/estados.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ const EstadoSchema = new Schema({
concepto: SnomedConcept,
color: String,
icono: String,
requiereFrecuencia: Boolean,
registro: SnomedConcept
}]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ EventCore.on('internacion:plan-indicaciones-eventos:create', async (evento) => {
});

EventCore.on('internacion:plan-indicaciones:create', async (indicacion) => {
if (indicacion.elementoRUP === '60ed8c8770569dd3ad533e96') {
if (indicacion.requiereFrecuencia) {
await crearEventosSegunPrescripcion(indicacion);
}
});
Expand Down Expand Up @@ -115,7 +115,7 @@ EventCore.on('internacion:plan-indicaciones:update', async (indicacion) => {
case 'draft':
// Se editó una prescripción existente
await PlanIndicacionesEventosCtr.deleteByIndicacion(indicacion._id);
if (indicacion.elementoRUP === '60ed8c8770569dd3ad533e96') {
if (indicacion.requiereFrecuencia) {
await crearEventosSegunPrescripcion(indicacion);
}
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ export const PlanIndicacionesSchema = new Schema({
estados: [PlanIndicacionesEstadoSchema],
estadoActual: PlanIndicacionesEstadoSchema,
turneable: Boolean,
seccion: SnomedConcept
seccion: SnomedConcept,
requiereFrecuencia: Boolean
});

PlanIndicacionesSchema.plugin(AuditPlugin);
Expand Down

0 comments on commit 65fdccc

Please sign in to comment.