Skip to content
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

[JN-1560] fix missing trcc export fields #1401

Merged
merged 2 commits into from
Jan 23, 2025

Conversation

connorlbark
Copy link
Collaborator

@connorlbark connorlbark commented Jan 17, 2025

DESCRIPTION (include screenshots, and mobile screenshots for participant UX)

We weren't actually getting the latest survey question definition, and earlier versions of these questions were html so it was skipping them on export.

TO TEST: (simple manual steps for confirming core behavior -- used for pre-release checks)

  • import what trcc is on prod
  • go to sandbox data export
  • observe that researchConsentForm.consentSignatureDate and researchAssentForm.assentSignatureDate show up

@connorlbark connorlbark marked this pull request as ready for review January 17, 2025 18:20
Copy link
Collaborator

@devonbush devonbush left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice fix, one small suggestion

@@ -77,7 +76,13 @@ private void generateAnswerItemFormatters(
)).values().stream().sorted(Comparator.comparingInt(a -> a.get(0).getExportOrder())).toList();

for (List<SurveyQuestionDefinition> questionVersions : questionDefsByStableId) {
SurveyQuestionDefinition mostRecent = questionVersions.get(0);

Optional<SurveyQuestionDefinition> mostRecentOpt = getLatest(questionVersions);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of doing this, I think it's cleaner to update the code above to sort the lists as they're made.

I think you can pass a second argument to groupingBy of a collector that sorts the sublists. See https://stackoverflow.com/questions/35872236/sorting-lists-after-groupingby

@connorlbark connorlbark changed the title [JN-1650] fix missing trcc export fields [JN-1560] fix missing trcc export fields Jan 22, 2025
@connorlbark connorlbark merged commit 9d0d5cd into development Jan 23, 2025
18 checks passed
@connorlbark connorlbark deleted the cb-fix-missing-trcc-export-fields branch January 23, 2025 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants