Split Assessment Factors into separate dataframe to reduce duplication of error rows passed to FE #475
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.
Current
Ingress creates a separate row in the Assessments dataframe for each AssessmentFactors value within a LAchildID-CINdetailsID-AssessmentActualStartDate set. This means that where an assessment has many factors assigned, the assessment is duplicated within the dataset and any in-error assessments are reported multiple times in the FE.
Proposed
Amend ingress to store the assessment factors in a separate dataframe, linked to the parent assessment (and CINdetailsID) via a new internally incremented AssessmentID value. I have ensured that the AssessmentFactors column remains on the Assessments dataframe, but now as a single string containing a list of the factors assigned on the assessment.
The new AssessmentFactorsList dataframe can be used within the relevant validations rules to return the incorrect records, while at the same time being ignored for other validation rules that do not involve assessment factors. This will remove unnecessary duplicate assessment rows from both the validation rules and the FE error lists.
Note: I am not 100% sure how the FE data tables are built and whether some corresponding changes need to be made on that side to handle this change (e.g. do they use the dataframes from ingress or a separate parsing from the uploaded source files).