Skip to content

O3-5253: Create flags domain in Initializer#309

Open
brandones wants to merge 13 commits intomekomsolutions:mainfrom
brandones:flags
Open

O3-5253: Create flags domain in Initializer#309
brandones wants to merge 13 commits intomekomsolutions:mainfrom
brandones:flags

Conversation

@brandones
Copy link
Contributor

https://openmrs.atlassian.net/browse/O3-5253

This creates a domain for flags, provided by https://github.com/openmrs/openmrs-module-patientflags

Domains are flags, flagpriorities, and flagtags.

@brandones
Copy link
Contributor Author

Requesting review from @ibacher, @mseaton

@pirupius
Copy link

pirupius commented Jan 8, 2026

ping @kdaud

Copy link
Member

@ibacher ibacher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is mostly some minor points that should be fixed, but a few larger comments:

  1. Most module domains should go exclusively in the api project unless they actually rely on platform APIs that aren't available. That doesn't seem to be the case here.
  2. Please update the changelog part of the README as well.

* Parses a list of DisplayPoint identifiers (UUID or name) and fetches the corresponding
* DisplayPoint entities.
*/
@Component("initializer.displayPointListParser")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally the component name is namespaced, i.e., `initializer.flagDisplayPointListParser)

@Override
public Flag bootstrap(CsvLine line) throws IllegalArgumentException {
String uuid = line.getUuid();
Flag flag = flagService.getFlagByUuid(uuid);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be a good idea to have a check if UUID is blank here as well. This will probably run an unncessary database query at best and at worst error out.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, but I would note that the other CsvParsers I looked at don't do this check. Hopefully getXByUuuid generally returns null fast for a blank uuid (but I suspect it might not).

/**
* Loads Flags from CSV files.
*/
@Component
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Component here should be given a prefixed name

/**
* Parses CSV files for Priority entities.
*/
@Component
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Component here should be given a prefixed name, especially for something like "Priority"

// Optional roles
String rolesStr = line.getString(HEADER_ROLES, "");
if (StringUtils.isNotBlank(rolesStr)) {
Set<Role> roles = new HashSet<Role>(roleListParser.parseList(rolesStr));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Set<Role> roles = new HashSet<Role>(roleListParser.parseList(rolesStr));
Set<Role> roles = new HashSet<>(roleListParser.parseList(rolesStr));

@brandones
Copy link
Contributor Author

brandones commented Jan 20, 2026

Sorry, looking at the wrong thing.

@ibacher openmrs-module-tasks relies on ProviderRole, so it requires platform 2.8 (it's not unthinkable that it could be made compatible with previous versions, but I have no plans to do so). Should I still move this from api-2.8/ to api/?

@brandones
Copy link
Contributor Author

@ibacher Ok, yeah it's nonsense that it's in api-2.4. The patientflags module requires platform 2.2.0. But I assume that since the loader itself doesn't depend on platform 2.2 APIs it's okay if it's in the api directory?

@brandones brandones requested a review from ibacher January 20, 2026 15:33
@brandones
Copy link
Contributor Author

Ping @ibacher , when you have the chance

pom.xml Outdated
<fhir2Version>1.6.0</fhir2Version>
<billingVersion>1.1.0</billingVersion>
<stockmanagementVersion>2.0.2</stockmanagementVersion>
<patientflagsVersion>3.0.9-SNAPSHOT</patientflagsVersion>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we cut a release of the flags module? That will make it easier to release Iniz with these chagnes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, anything I need to do before cutting a release in Bamboo?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to 3.0.9

README.md Outdated
* Bahmni I.e Apps 1.1.0 (*compatible*)
* Billing 1.1.0 (*compatible*)
* Data Filter 1.0.0 (*compatible*)
* Flags 3.0.8 (*compatible*)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems not to match the declaration in the POM.xml?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I thought there was no API change (so it would be compatible) but then I changed the API. Changed to 3.0.9 (*compatible*)

@brandones brandones requested a review from ibacher February 3, 2026 22:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants