• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

DataBiosphere / consent / #6225

28 Jul 2025 12:14PM UTC coverage: 81.088% (+0.4%) from 80.694%
#6225

push

web-flow
DT-2026: Bring feature branch into develop (#2621)

Co-authored-by: Elliot Otchet <otchet@broadinstitute.org>
Co-authored-by: Rachel Johanek <55256690+rjohanek@users.noreply.github.com>
Co-authored-by: rjohanek <rjohanek@broadinstitute.org>
Co-authored-by: Matt Bemis <MatthewBemis@users.noreply.github.com>
Co-authored-by: otchet-broad <111771148+otchet-broad@users.noreply.github.com>

397 of 437 new or added lines in 34 files covered. (90.85%)

10775 of 13288 relevant lines covered (81.09%)

0.81 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

98.85
/src/main/java/org/broadinstitute/consent/http/rules/RuleImplementationInterface.java
1
package org.broadinstitute.consent.http.rules;
2

3
import org.apache.commons.lang3.StringUtils;
4
import org.broadinstitute.consent.http.models.DataAccessRequest;
5
import org.broadinstitute.consent.http.models.DataAccessRequestData;
6
import org.broadinstitute.consent.http.models.DataUse;
7
import org.broadinstitute.consent.http.models.Dataset;
8

9
public interface RuleImplementationInterface {
10

11
  DACAutomationRuleType getRuleType();
12

13
  boolean compare(Dataset dataset, DataAccessRequest dataAccessRequest);
14
  default boolean hasNoModifiers(DataUse data) {
15
    if (Boolean.TRUE.equals(data.getCollaboratorRequired())) {
1✔
16
      return false;
1✔
17
    }
18
    if (Boolean.TRUE.equals(data.getSexualDiseases())) {
1✔
19
      return false;
1✔
20
    }
21
    if (Boolean.TRUE.equals(data.getEthicsApprovalRequired())) {
1✔
22
      return false;
1✔
23
    }
24
    if (Boolean.TRUE.equals(data.getMethodsResearch())) {
1✔
25
      return false;
1✔
26
    }
27
    if (Boolean.TRUE.equals(data.getNonProfitUse())) {
1✔
28
      return false;
1✔
29
    }
30
    if (Boolean.TRUE.equals(data.getGeneticStudiesOnly())) {
1✔
31
      return false;
1✔
32
    }
33
    if (Boolean.TRUE.equals(data.getPopulationOriginsAncestry())) {
1✔
34
      return false;
1✔
35
    }
36
    if (Boolean.TRUE.equals(data.getPublicationResults())) {
1✔
37
      return false;
1✔
38
    }
39
    if (Boolean.TRUE.equals(data.getIllegalBehavior())) {
1✔
40
      return false;
1✔
41
    }
42
    if (Boolean.TRUE.equals(data.getControls())) {
1✔
43
      return false;
1✔
44
    }
45
    if (Boolean.TRUE.equals(data.getNotHealth())) {
1✔
46
      return false;
1✔
47
    }
48
    if (Boolean.TRUE.equals(data.getPopulation())) {
1✔
49
      return false;
1✔
50
    }
51
    if (Boolean.TRUE.equals(data.getPediatric())) {
1✔
52
      return false;
1✔
53
    }
54
    if (Boolean.TRUE.equals(data.getPsychologicalTraits())) {
1✔
55
      return false;
1✔
56
    }
57
    if (Boolean.TRUE.equals(data.getStigmatizeDiseases())) {
1✔
58
      return false;
1✔
59
    }
60
    if (Boolean.TRUE.equals(data.getVulnerablePopulations())) {
1✔
61
      return false;
1✔
62
    }
63
    if (!Boolean.TRUE.equals(data.getDiseaseRestrictions() == (null))
1✔
64
        && !Boolean.TRUE.equals(data.getDiseaseRestrictions().isEmpty())) {
1✔
65
      return false;
1✔
66
    }
67
    if (Boolean.TRUE.equals(!StringUtils.isBlank(data.getPublicationMoratorium()))) {
1✔
68
      return false;
1✔
69
    }
70
    if (Boolean.TRUE.equals(!StringUtils.isBlank(data.getOther()))) {
1✔
71
      return false;
1✔
72
    }
73
    if (Boolean.TRUE.equals(!StringUtils.isBlank(data.getGeographicalRestrictions()))) {
1✔
74
      return false;
1✔
75
    }
76
    if (Boolean.TRUE.equals(!StringUtils.isBlank(data.getSecondaryOther()))) {
1✔
77
      return false;
1✔
78
    }
79
    return !Boolean.TRUE.equals(!StringUtils.isBlank(data.getGender()));
1✔
80
  }
81

82
  default boolean secondaryConditionChecks(DataAccessRequestData data) {
83
    // Secondary condition checks, part 1
84
    if (Boolean.TRUE.equals(data.getControls())) {
1✔
85
      return false;
1✔
86
    }
87
    if (Boolean.TRUE.equals(data.getPopulation())) {
1✔
88
      return false;
1✔
89
    }
90
    if (Boolean.TRUE.equals(data.getForProfit())) {
1✔
91
      return false;
1✔
92
    }
93

94
    // Secondary condition checks, part 2
95
    if (!StringUtils.isBlank(data.getGender())) {
1✔
96
      return false;
1✔
97
    }
98
    if (Boolean.TRUE.equals(data.getPediatric())) {
1✔
99
      return false;
1✔
100
    }
101
    if (Boolean.TRUE.equals(data.getVulnerablePopulation())) {
1✔
102
      return false;
1✔
103
    }
104

105
    // Secondary condition checks, part 3
106
    if (Boolean.TRUE.equals(data.getIllegalBehavior())) {
1✔
107
      return false;
1✔
108
    }
109
    if (Boolean.TRUE.equals(data.getSexualDiseases())) {
1✔
110
      return false;
1✔
111
    }
112
    if (Boolean.TRUE.equals(data.getPsychiatricTraits())) {
1✔
113
      return false;
1✔
114
    }
115
    if (Boolean.TRUE.equals(data.getNotHealth())) {
1✔
116
      return false;
1✔
117
    }
118
    if (Boolean.TRUE.equals(data.getStigmatizedDiseases())) {
1✔
119
      return false;
1✔
120
    }
121
    if (Boolean.TRUE.equals(data.getAddiction())) {
1✔
122
      return false;
1✔
123
    }
124
    return true;
1✔
125
  }
126

127
  default boolean requestIsOnlyHMB(DataAccessRequestData data) {
128
    // Primary condition checks
129
    if (Boolean.TRUE.equals(data.getDiseases())) {
1✔
130
      return false;
1✔
131
    }
132
    if (!StringUtils.isBlank(data.getOtherText())) {
1✔
133
      return false;
1✔
134
    }
135
    if (Boolean.TRUE.equals(data.getOther())) {
1✔
136
      return false;
1✔
137
    }
138

139
    if (!secondaryConditionChecks(data)) {
1✔
140
      return false;
1✔
141
    }
142

143
    return Boolean.TRUE.equals(data.getHmb());
1✔
144
  }
145

146
  default boolean requestHasDiseases(DataAccessRequestData data) {
147
    if (!Boolean.TRUE.equals(data.getDiseases())) {
1✔
148
      return false;
1✔
149
    }
150

151
    if (!StringUtils.isBlank(data.getOtherText())) {
1✔
152
      return false;
1✔
153
    }
154
    if (Boolean.TRUE.equals(data.getOther())) {
1✔
155
      return false;
1✔
156
    }
157

158
    if (!secondaryConditionChecks(data)) {
1✔
NEW
159
      return false;
×
160
    }
161

162
    return Boolean.TRUE.equals(!data.getOntologies().isEmpty());
1✔
163
  }
164
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc