Skip to content

Commit

Permalink
[DUOS-2617][risk=no] Update v3 for DAR abstain cases (#879)
Browse files Browse the repository at this point in the history
* add abstain fields and purpose/consent descriptions

* add abstain condition and tests
  • Loading branch information
rushtong authored Jul 27, 2023
1 parent 4569054 commit 4dff32d
Show file tree
Hide file tree
Showing 5 changed files with 559 additions and 124 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,23 @@ static MatchResult matchCommercial(DataUseV3 purpose, DataUseV3 dataset) {
static MatchResult abstainDecision(
DataUseV3 purpose, DataUseV3 dataset, Map<String, List<String>> purposeDiseaseIdMap,
MatchResultType diseaseMatch) {

// Immediate Abstain Cases:
if (
getNullableOrFalse(purpose.getControls()) ||
getNullableOrFalse(purpose.getPopulation()) ||
Objects.nonNull(purpose.getGender()) ||
getNullableOrFalse(purpose.getPediatric()) ||
getNullableOrFalse(purpose.getVulnerablePopulations()) ||
getNullableOrFalse(purpose.getIllegalBehavior()) ||
getNullableOrFalse(purpose.getSexualDiseases()) ||
getNullableOrFalse(purpose.getPsychologicalTraits()) ||
getNullableOrFalse(purpose.getNotHealth()) ||
getNullableOrFalse(purpose.getStigmatizeDiseases())
) {
return MatchResult.from(MatchResultType.ABSTAIN, Collections.singletonList(ABSTAIN));
}

// Valid RPs
boolean purposeDSX = getNullableOrFalse(!purpose.getDiseaseRestrictions().isEmpty());
boolean purposeHMB = getNullableOrFalse(purpose.getHmbResearch());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,75 @@ public DataUseBuilderV3 setCollaboratorRequired(boolean collaboratorRequired) {
du.setCollaboratorRequired(collaboratorRequired);
return this;
}

public DataUseBuilderV3 setGeographicalRestrictions(String geographicalRestrictions) {
du.setGeographicalRestrictions(geographicalRestrictions);
return this;
}

public DataUseBuilderV3 setGeneticStudiesOnly(boolean geneticStudiesOnly) {
du.setGeneticStudiesOnly(geneticStudiesOnly);
return this;
}

public DataUseBuilderV3 setPublicationResults(boolean publicationResults) {
du.setPublicationResults(publicationResults);
return this;
}

public DataUseBuilderV3 setPublicationMoratorium(String publicationMoratorium) {
du.setPublicationMoratorium(publicationMoratorium);
return this;
}

public DataUseBuilderV3 setControls(boolean controls) {
du.setControls(controls);
return this;
}

public DataUseBuilderV3 setGender(String gender) {
du.setGender(gender);
return this;
}

public DataUseBuilderV3 setPediatric(boolean pediatric) {
du.setPediatric(pediatric);
return this;
}

public DataUseBuilderV3 setPopulation(boolean population) {
du.setPopulation(population);
return this;
}

public DataUseBuilderV3 setIllegalBehavior(boolean illegalBehavior) {
du.setIllegalBehavior(illegalBehavior);
return this;
}

public DataUseBuilderV3 setSexualDiseases(boolean sexualDiseases) {
du.setSexualDiseases(sexualDiseases);
return this;
}

public DataUseBuilderV3 setStigmatizeDiseases(boolean stigmatizeDiseases) {
du.setStigmatizeDiseases(stigmatizeDiseases);
return this;
}

public DataUseBuilderV3 setVulnerablePopulations(boolean vulnerablePopulations) {
du.setVulnerablePopulations(vulnerablePopulations);
return this;
}

public DataUseBuilderV3 setPsychologicalTraits(boolean psychologicalTraits) {
du.setPsychologicalTraits(psychologicalTraits);
return this;
}

public DataUseBuilderV3 setNotHealth(boolean notHealth) {
du.setNotHealth(notHealth);
return this;
}

}
Loading

0 comments on commit 4dff32d

Please sign in to comment.