Patient Flags Descriptor enables Flags on Start of Module

module
Tags: #<Tag:0x00007fbad4d93708>

(Samuel Lubwama) #1

We have been having an issue of patient flags enabling the flags automatically when ever it starts even after disabling them via the interface. We discovered that this is attributed to the Descriptor which has the flags enabled automatically on start.

public Boolean enabled() { return Boolean.TRUE; }

Wondering what would be the best approach removing the option of automatic enable of flags on start. @dkayiwa @maimoonak @ssmusoke Any thoughts


(Daniel Kayiwa) #2

What do you have in mind?


(Samuel Lubwama) #3

Removing the enabled method from the Descriptor


(Daniel Kayiwa) #4

Can you share a link to the line of code that you are referring to?


(Samuel Lubwama) #5

This is the Code Class I am referring to


(Samuel Lubwama) #6

There is a possibility of having the method an abstract.


(Daniel Kayiwa) #7

That looks like simply making flags enabled by default. But then overridden by the value stored in the database. https://github.com/openmrs/openmrs-module-patientflags/blob/7e59726ed24535ae97a1472d94de1c5c02a40082/api/src/main/java/org/openmrs/module/patientflags/db/hibernate/HibernateFlagDAO.java#L61