Skip to content

FEAT - Consentimiento programas#2270

Open
JuanIRamirez wants to merge 1 commit into
masterfrom
PDP-121
Open

FEAT - Consentimiento programas#2270
JuanIRamirez wants to merge 1 commit into
masterfrom
PDP-121

Conversation

@JuanIRamirez

Copy link
Copy Markdown
Contributor

Requerimiento

https://proyectos.andes.gob.ar/browse/PDP-121

Funcionalidad desarrollada

  1. Nuevos esquemas consentVersion, consentimiento y padronElectoral
  2. Nuevas rutas

UserStories llegó a completarse

  • Si
  • No

Requiere actualizaciones en la base de datos

  • Si
  • No

@JuanIRamirez JuanIRamirez requested review from a team as code owners July 1, 2026 18:25
@github-actions github-actions Bot added the script Necesidad de aplicar un scripts label Jul 1, 2026
@JuanIRamirez JuanIRamirez force-pushed the PDP-121 branch 3 times, most recently from 91143f7 to 9953b57 Compare July 2, 2026 17:52
Comment thread core/tm/controller/consentimiento.ts Outdated
if (pacienteId) {
paciente = await Paciente.findById(pacienteId);
} else {
paciente = await Paciente.findOne({ documento, sexo });

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Habría que filtrar tambien por activo en true, para que no levante inactivos vinculados

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hecho

if (paciente) {
const edadPaciente = calcularEdad(paciente.fechaNacimiento, paciente.fechaFallecimiento);
if (edadPaciente && edadPaciente >= 65) {
let financiador = paciente.financiador;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Este bloque está un poco confuso, dejo dos sugerencias como alternativa (no es obligatorio!):

Opción 1 (la que mas me gusta):

Suggested change
let financiador = paciente.financiador;
const financiador = verificarFinanciador(paciente.financiador) ? paciente.financiador : await getObraSocial(paciente);
if (!verificarFinanciador(financiador))
const existePadron = ...
...

Opcion 2:

Suggested change
let financiador = paciente.financiador;
let financiador = paciente.financiador;
if(!verificarFinanciador(financiador)) {
financiador = await getObraSocial(paciente);
}
if(!verificarFinanciador(financiador)) {
const existePadron = ...
...

Comment thread core/tm/routes/consentimiento.ts Outdated

const router = express.Router();

class ConsentVersionResource extends ResourceBase {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tratemos de no abreviar palabras 🙏🏼 ConsentimientoVersionResource estaría perfecto

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hecho

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hecho

Comment thread core/tm/routes/consentimiento.ts Outdated

class PadronElectoralResource extends ResourceBase {
Model = PadronElectoral;
resourceName = 'padronelectoral';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Camelcase 🙏🏼 👉🏼 padronElectoral

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hecho

Comment thread core/tm/routes/consentimiento.ts Outdated
};
}

router.get('/validarpaciente', Auth.authenticate(), async (req: express.Request, res: express.Response) => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Camelcase de nuevo: validarPaciente

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hecho

Comment thread core/tm/schemas/consentimiento.ts Outdated
@@ -0,0 +1,38 @@
import { model, Schema } from 'mongoose';

export const consentVersionSchema = new Schema({

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consentimientoVersionSchema

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hecho

Comment thread core/tm/schemas/consentimiento.ts Outdated
dir_escuela: { type: String, required: true }
});

export const ConsentVersion = model('consentVersion', consentVersionSchema, 'consentVersion');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consentimientoVersion y consentimientoVersionSchema

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hecho

@JuanIRamirez JuanIRamirez force-pushed the PDP-121 branch 4 times, most recently from 7b265d9 to 698198b Compare July 8, 2026 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

script Necesidad de aplicar un scripts

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants