Skip to content

Commit

Permalink
Merge pull request #1954 from ojwanganto/show-all-patient-flags
Browse files Browse the repository at this point in the history
show all patient flags in 2.x based on eligibility criteria
  • Loading branch information
makombe authored Jul 17, 2024
2 parents 2303686 + bace3a9 commit 125b1c0
Showing 1 changed file with 0 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,27 +78,8 @@ public class PatientUtilsFragmentController {
public List<SimpleObject> getFlags(@RequestParam("patientId") Integer patientId, @SpringBean CalculationManager calculationManager) {

List<SimpleObject> flags = new ArrayList<SimpleObject>();
List<String> openFlags = Arrays.asList(
"NeedsCACXTestCalculation",
"NotVaccinatedCalculation",
"IsPregnantCalculation",
"EligibleForIliScreeningCalculation",
"EligibleForSariScreeningCalculation",
"EligibleForCholeraCalculation",
"EligibleForDysenteryCalculation",
"EligibleForMalariaCalculation",
"EligibleForHaemorrhagicCalculation",
"EligibleForChikungunyaCalculation",
"EligibleForMeaslesCalculation",
"EligibleForPoliomyelitisCalculation",
"EligibleForRiftValleyFeverCalculation"
); // flags that don't require specific role
// Gather all flag calculations that evaluate to true
for (PatientFlagCalculation calc : calculationManager.getFlagCalculations()) {
if (openFlags.isEmpty() || !openFlags.contains(calc.getClass().getSimpleName())) {
// TODO: check if logged in user has the globally required role/privilege
continue;
}
try {
CalculationResult result = Context.getService(PatientCalculationService.class).evaluate(patientId, calc);
if (result != null && (Boolean) result.getValue()) {
Expand Down

0 comments on commit 125b1c0

Please sign in to comment.