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

PEPPER-1364 . Additional PHI Manifest changes #2931

Merged
merged 1 commit into from
Aug 27, 2024

Conversation

ssettipalli
Copy link
Contributor

PEPPER-1364
Add functionality to let aged-up participants who are in lost to followup (not self consented yet) be included in PHI manifest download.

int age = DateTimeUtil.calculateAgeInYears(dateOfBirth);
boolean hasCompletedPediatricConsentAddendum = participant.hasCompletedActivity(CONSENT_ADDENDUM_PEDIATRICS_ACTIVITY_CODE);

if (hasCompletedPediatricConsentAddendum) {
if (age >= 7) {
if (age >= 7 || participantStatus.equalsIgnoreCase(CONSENT_SUSPENDED)) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

agedup participants should fall into this >7 age for sure any way but explicitly checking for CONSENT_SUSPENDED will help just incase DOB isn't in ES DSM document.
Doesnt hurt to include in OR , hence added

if (StringUtils.isBlank(dateOfMajority) || DateTimeUtil.isAdult(dateOfMajority)) {
return (Boolean)getAdultParticipantConsentedToTumorAnswer(participant, ddpInstanceDto.getStudyGuid())
String participantStatus = participant.getStatus().orElse("");
if (StringUtils.isBlank(dateOfMajority) || participant.hasCompletedActivity(CONSENT_ACTIVITY_CODE)) {
Copy link
Contributor Author

@ssettipalli ssettipalli Aug 27, 2024

Choose a reason for hiding this comment

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

explicitly checking for SELF CONSENT will make sure aged-up and self enrolled fall into this category

}
}

private static boolean isPediatricValidForPHI(ElasticSearchParticipantDto participant, String dateOfBirth, String participantStatus) {
int age = DateTimeUtil.calculateAgeInYears(dateOfBirth);
boolean hasCompletedPediatricConsentAddendum = participant.hasCompletedActivity(CONSENT_ADDENDUM_PEDIATRICS_ACTIVITY_CODE);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Might be an edge case in existing code base ... if child was enrolled when < 7 and after few years current age will be > 7.. and the child might not have this question: SOMATIC_ASSENT_ADDENDUM_QUESTION_STABLE_ID answered ! (Need to test this scenario later & might need to fix it) .

@ssettipalli ssettipalli requested a review from zyme August 27, 2024 16:35
@ssettipalli ssettipalli merged commit b933985 into develop Aug 27, 2024
8 checks passed
@ssettipalli ssettipalli deleted the PEPPER-1364-phi-download-updates-2 branch August 27, 2024 17:24
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.

2 participants