-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds PDF preparer code for race and ethnicity #492
Conversation
0655517
to
b303507
Compare
@@ -45,6 +50,23 @@ public Map<String, SubmissionField> prepareSubmissionFields(Submission submissio | |||
|
|||
var uuid = householdMember.get("uuid"); | |||
results.put("householdUSCitizen" + i, new SingleField("householdUSCitizenDerived", nonCitizens != null && nonCitizens.contains(uuid) ? "No" : "Yes", i + 1)); | |||
|
|||
List<String> raceInput = (List)submission.getInputData().get(RACE_PREFIX + uuid + "[]"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bseeger we have a field called "permissionToAskAboutRace" that determines whether the race questions were asked. If it's false then we wouldn't have displayed the race and ethnicity questions to the form filler.
Maybe there is a benefit to using that here to exit out of the process sooner.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding in this logic. Thanks for pointing that out, @analoo.
if (ethnicityInput != null && !ethnicityInput.isEmpty()) { | ||
raceEthnicCode += "/" + EthnicityType.getAbbreviationFromValue(ethnicityInput); | ||
} | ||
results.put("householdRaceEthnicCode" + i, new SingleField("householdRaceEthnicCode", raceEthnicCode, i+1)); | ||
} | ||
} | ||
return results; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is more for me: curious about whether it makes sense to make each of these inout checks into a method separate from the main method. Just noticing that it's getting pretty big. I could also see a good reason to split it out into methods for testing purposes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did refactor the code a little here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - comments are things that I am curious about.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also LGTM - thanks for all the cleanup
Adds tests for race and ethnicity.
if the user doesn't want us to collect it (and it was already collected). General cleanup.
fdc6490
to
020abde
Compare
Note that the race and ethnicity for the applicant are covered via mapping in the pdf-map.yml file. I didn't have to do anything explicitly for those except to tweak the mapping a little.
The mapping for household member's got tucked into the household details preparer.