Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

INT: pasar a internacion no censable #1702

Merged
merged 1 commit into from
Jul 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion modules/rup/internacion/censo.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,15 @@ async function realizarConteo(internaciones, unidadOrganizativa, timestampStart,
diasEstadaUO = (diasEstadaUO === 0) ? 1 : diasEstadaUO;
}

if (!ultimoMovimiento.esCensable && !(prestacion as any).ejecucion.registros[0].esCensable) {
const prestacionInternacion = (prestacion as any).ejecucion.registros[0];
/** Ignoramos las internaciones de cama no censable que no estén explicitamente flageadas 'esCensable' en true */
if (!ultimoMovimiento.esCensable && !prestacionInternacion.esCensable) {
return;
}

/** Ignoramos las internaciones de cama censable que estan explicitamente flageadas 'esCensable' en false */
const prestacionNoCensable = 'esCensable' in prestacionInternacion && prestacionInternacion.esCensable === false;
if (ultimoMovimiento.esCensable && prestacionNoCensable) {
return;
}
if (fechaEgreso) {
Expand Down
3 changes: 3 additions & 0 deletions modules/rup/schemas/prestacion.registro.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ schema.add({
// Indica los id de otros registros dentro array 'registros' de la prestación
// O un conceptId si el registro está relacionado con un concepto (ej: un registro de "caries" con concepto "diente 18")
relacionadoCon: [mongoose.Schema.Types.Mixed],
/** Flag 'esCensable' indica si debe o no ser excluido dentro de los censos.
* Para ser evaluado debe ser explicitamente definido. Si no está definido, es ignorado.
* */
esCensable: {
type: Boolean,
required: false
Expand Down