FEAT - Consentimiento programas#2270
Open
JuanIRamirez wants to merge 1 commit into
Open
Conversation
0f7e520 to
91143f7
Compare
negro89
reviewed
Jul 2, 2026
| if (pacienteId) { | ||
| paciente = await Paciente.findById(pacienteId); | ||
| } else { | ||
| paciente = await Paciente.findOne({ documento, sexo }); |
Contributor
There was a problem hiding this comment.
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; |
Contributor
There was a problem hiding this comment.
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 { |
Contributor
There was a problem hiding this comment.
Tratemos de no abreviar palabras 🙏🏼 ConsentimientoVersionResource estaría perfecto
|
|
||
| class PadronElectoralResource extends ResourceBase { | ||
| Model = PadronElectoral; | ||
| resourceName = 'padronelectoral'; |
Contributor
There was a problem hiding this comment.
Camelcase 🙏🏼 👉🏼 padronElectoral
| }; | ||
| } | ||
|
|
||
| router.get('/validarpaciente', Auth.authenticate(), async (req: express.Request, res: express.Response) => { |
Contributor
There was a problem hiding this comment.
Camelcase de nuevo: validarPaciente
| @@ -0,0 +1,38 @@ | |||
| import { model, Schema } from 'mongoose'; | |||
|
|
|||
| export const consentVersionSchema = new Schema({ | |||
Contributor
There was a problem hiding this comment.
consentimientoVersionSchema
| dir_escuela: { type: String, required: true } | ||
| }); | ||
|
|
||
| export const ConsentVersion = model('consentVersion', consentVersionSchema, 'consentVersion'); |
Contributor
There was a problem hiding this comment.
consentimientoVersion y consentimientoVersionSchema
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requerimiento
https://proyectos.andes.gob.ar/browse/PDP-121
Funcionalidad desarrollada
UserStories llegó a completarse
Requiere actualizaciones en la base de datos