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 2 times, most recently from 0f7e520 to 91143f7 Compare July 2, 2026 17:50
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

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 = ...
...


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


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

};
}

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

@@ -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

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

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