Skip to content

Commit

Permalink
FLAG-69: improved the performance of generate flags for patient
Browse files Browse the repository at this point in the history
  • Loading branch information
ManojLL committed Aug 3, 2024
1 parent 96ea6db commit a653c7e
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ public List<Flag> generateFlagsForPatient(Patient patient, Map<Object, Object> c
/**
* @see org.openmrs.module.patientflags.api.FlagService#generateFlagsForPatient(Patient, Filter, Map<Object, Object>)
*/
public List<Flag> generateFlagsForPatient(final Patient patient, Filter filter, final Map<Object, Object> context) {
final List<Flag> results = Collections.synchronizedList(new ArrayList<>());
public List<Flag> generateFlagsForPatient(final Patient patient, Filter filter, Map<Object, Object> context) {
List<Flag> results = Collections.synchronizedList(new ArrayList<>());

// we can get rid of this once onStartup is implemented
if (!isInitialized)
Expand All @@ -109,9 +109,11 @@ public List<Flag> generateFlagsForPatient(final Patient patient, Filter filter,
if (flag.eval(patient, context)) {
results.add(flag);
}
} catch (Exception e) {
}
catch (Exception e) {
log.error("Unable to test flag " + flag.getName() + " on patient #" + patient.getId(), e);
} finally {
}
finally {
Context.closeSession();
}
});
Expand Down

0 comments on commit a653c7e

Please sign in to comment.