Skip to content

Commit 0ae86b4

Browse files
committed
cambios en fn3FB para añadir tipos de matriculados y filtrar RecordEndDateTime
1 parent dd51e0a commit 0ae86b4

1 file changed

Lines changed: 17 additions & 3 deletions

File tree

  • ede/ede/validation_functions/fn3_integridad_datos

ede/ede/validation_functions/fn3_integridad_datos/fn3FB.py

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,20 @@ def fn3FB(conn, return_dict):
3636
JOIN RefPersonIdentificationSystem rfiLista
3737
ON numLista.RefPersonIdentificationSystemId=rfiLista.RefPersonIdentificationSystemId
3838
AND rfiLista.code IN ('listNumber')
39+
WHERE
40+
p.RecordEndDateTime IS NULL
3941
) as 'cantidadNumeroLista'
4042
,(
4143
SELECT count(p.personId)
4244
FROM person p
4345
JOIN PersonIdentifier numMatri
4446
ON p.personid = numMatri.personid
47+
AND numMatri.RecordEndDateTime IS NULL
4548
JOIN RefPersonIdentificationSystem rfiMatri
4649
ON numMatri.RefPersonIdentificationSystemId=rfiMatri.RefPersonIdentificationSystemId
4750
AND rfiMatri.code IN ('SchoolNumber')
51+
WHERE
52+
p.RecordEndDateTime IS NULL
4853
) as 'cantidadNumeroMatricula'
4954
,(
5055
SELECT count(p.personId)
@@ -53,7 +58,9 @@ def fn3FB(conn, return_dict):
5358
ON ps.personId = p.personId
5459
JOIN RefPersonStatusType rpst
5560
ON rpst.RefPersonStatusTypeId=ps.RefPersonStatusTypeId
56-
AND rpst.Description IN ('Estudiante con matrícula definitiva')
61+
AND rpst.Description IN ('Estudiante con matrícula definitiva', 'Estudiante promovido', 'Estudiante con matrícula provisoria', 'Estudiante Matriculado a través de Decreto 152, artículo 60')
62+
WHERE
63+
p.RecordEndDateTime IS NULL
5764
) as 'cantidadMatriDefinitiva'
5865
,(
5966
SELECT count(p.personId)
@@ -64,16 +71,21 @@ def fn3FB(conn, return_dict):
6471
JOIN RefPersonStatusType rpst
6572
ON rpst.RefPersonStatusTypeId=ps.RefPersonStatusTypeId
6673
AND rpst.Description IN ('Estudiante asignado a un curso, se crea número de lista')
74+
WHERE
75+
p.RecordEndDateTime IS NULL
6776
) as 'cantidadNumerosListaAsignados'
6877
, (
6978
SELECT group_concat(p.personId)
7079
FROM person p
7180
JOIN PersonIdentifier numLista
7281
ON p.personid = numLista.personid
82+
AND numLista.RecordEndDateTime IS NULL
7383
JOIN RefPersonIdentificationSystem rfiLista
7484
ON numLista.RefPersonIdentificationSystemId=rfiLista.RefPersonIdentificationSystemId
7585
AND rfiLista.code IN ('listNumber')
76-
WHERE p.personId NOT IN (
86+
WHERE
87+
p.RecordEndDateTime IS NULL
88+
AND p.personId NOT IN (
7789
SELECT p.personId
7890
FROM person p
7991
JOIN PersonStatus ps
@@ -93,7 +105,9 @@ def fn3FB(conn, return_dict):
93105
JOIN RefPersonIdentificationSystem rfiMatri
94106
ON numMatri.RefPersonIdentificationSystemId=rfiMatri.RefPersonIdentificationSystemId
95107
AND rfiMatri.code IN ('SchoolNumber')
96-
WHERE p.personId NOT IN (
108+
WHERE
109+
p.RecordEndDateTime IS NULL
110+
AND p.personId NOT IN (
97111
SELECT p.personId
98112
FROM person p
99113
JOIN PersonStatus ps

0 commit comments

Comments
 (0)