Skip to content

Commit

Permalink
Merge pull request #959 from bcgov/fix/EDX-2721
Browse files Browse the repository at this point in the history
Update the Program Eligibility for non-graduated adult students reported in GA grade with a special education code to "No"
  • Loading branch information
arcshiftsolutions committed Jul 17, 2024
2 parents b42b264 + 31fdb26 commit a8f594c
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public enum ProgramEligibilityIssueCode {
ENROLLED_CAREER_INDY_SCHOOL("ENRCARINDY", "Students reported by Independent Schools are not eligible for Career Program funding."),
NOT_ENROLLED_INDIGENOUS("NTENRINDIG", "The student is not enrolled in indigenous programs."),
NOT_ENROLLED_SPECIAL_ED("NTENRSPED", "The student was not reported in any special education programs."),
NON_ELIG_SPECIAL_EDUCATION("NELISPED", "Student must be school-aged and have been reported in ELL for 5 years or less."),
NON_ELIG_SPECIAL_EDUCATION("NELISPED", "Student must be school-aged or a non-graduated adult reported in a grade other than GA."),
INDIGENOUS_ADULT("ISADULTAGE", "Student must be school-aged and self-identify as having Indigenous Ancestry to be eligible for funding for Indigenous Support Programs."),
YEARS_IN_ELL("ELL5ORLESS", "Student must be school-aged and have been reported in ELL for 5 years or less."),
NOT_ENROLLED_ELL("NTENRELL", "The student is not enrolled in the ELL program."),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

import ca.bc.gov.educ.studentdatacollection.api.calculator.FteCalculatorUtils;
import ca.bc.gov.educ.studentdatacollection.api.constants.v1.ProgramEligibilityIssueCode;
import ca.bc.gov.educ.studentdatacollection.api.constants.v1.SchoolGradeCodes;
import ca.bc.gov.educ.studentdatacollection.api.rules.ProgramEligibilityBaseRule;
import ca.bc.gov.educ.studentdatacollection.api.service.v1.ValidationRulesService;
import ca.bc.gov.educ.studentdatacollection.api.struct.StudentRuleData;
import ca.bc.gov.educ.studentdatacollection.api.struct.v1.SpecialEducationCategoryCode;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.core.annotation.Order;
Expand Down Expand Up @@ -41,17 +43,17 @@ public List<ProgramEligibilityIssueCode> executeValidation(StudentRuleData stude
List<ProgramEligibilityIssueCode> errors = new ArrayList<>();
var student = studentRuleData.getSdcSchoolCollectionStudentEntity();

List<String> activeSpecialEdPrograms = validationRulesService.getActiveSpecialEducationCategoryCodes().stream().map(e -> e.getSpecialEducationCategoryCode()).toList();
List<String> activeSpecialEdPrograms = validationRulesService.getActiveSpecialEducationCategoryCodes().stream().map(SpecialEducationCategoryCode::getSpecialEducationCategoryCode).toList();

Boolean isGraduated = student.getIsGraduated();
Boolean isSchoolAged = student.getIsSchoolAged();
Boolean isGraduated = student.getIsGraduated();
Boolean isAdult = student.getIsAdult();
boolean isNonGraduatedAdult = Boolean.FALSE.equals(isGraduated) && Boolean.TRUE.equals(isAdult);
Boolean isGA = SchoolGradeCodes.GRADUATED_ADULT.getCode().equals(student.getEnrolledGradeCode());

if (StringUtils.isEmpty(student.getSpecialEducationCategoryCode()) || !activeSpecialEdPrograms.contains(student.getSpecialEducationCategoryCode())) {
log.debug("ProgramEligibilityBaseRule - SpecialEducationProgramsRule: Sped code value - {} for sdcSchoolCollectionStudentID :: {}", student.getSpecialEducationCategoryCode(), studentRuleData.getSdcSchoolCollectionStudentEntity().getSdcSchoolCollectionStudentID());
errors.add(ProgramEligibilityIssueCode.NOT_ENROLLED_SPECIAL_ED);
}else if (Boolean.FALSE.equals(isSchoolAged) && !isNonGraduatedAdult) {
} else if (Boolean.FALSE.equals(isSchoolAged) && (isGraduated || (isAdult && isGA))) {
log.debug("ProgramEligibilityBaseRule - SpecialEducationProgramsRule: Is school aged - {}, Is non graduated adult - {}, for sdcSchoolCollectionStudentID :: {}", student.getIsSchoolAged(), student.getIsGraduated(), studentRuleData.getSdcSchoolCollectionStudentEntity().getSdcSchoolCollectionStudentID());
errors.add(ProgramEligibilityIssueCode.NON_ELIG_SPECIAL_EDUCATION);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,31 @@ void testSpecialEdStudentsMustBeSchoolAgeOrNotGraduated() {
)).isFalse();
}

@Test
void testSpecialEdStudentSchoolAgedAdultGANotEligible() {
CollectionEntity collection = collectionRepository.save(createMockCollectionEntity());
SdcSchoolCollectionEntity schoolCollection = sdcSchoolCollectionRepository
.save(createMockSdcSchoolCollectionEntity(collection, null));
SdcSchoolCollectionStudentEntity schoolStudentEntity = this.createMockSchoolStudentEntity(schoolCollection);
schoolStudentEntity.setDob("20040101");
schoolStudentEntity.setSpecialEducationCategoryCode("A");
schoolStudentEntity.setEnrolledGradeCode("GA");
schoolStudentEntity.setNumberOfCourses("1");
schoolStudentEntity.setIsSchoolAged(false);
schoolStudentEntity.setIsAdult(true);

List<ProgramEligibilityIssueCode> listWithoutEnrollmentError = rulesProcessor.processRules(
createMockStudentRuleData(
schoolStudentEntity,
createMockSchool()
)
);

assertThat(listWithoutEnrollmentError.stream().anyMatch(e ->
e.equals(ProgramEligibilityIssueCode.NON_ELIG_SPECIAL_EDUCATION)
)).isTrue();
}

@Test
void testIndigenousStudentsMustBeSchoolAged() {
CollectionEntity collection = collectionRepository.save(createMockCollectionEntity());
Expand Down

0 comments on commit a8f594c

Please sign in to comment.