Overriding location parameter

Hi @mseaton,

I have a use case where I want to populate the location parameter for a report definition with specific values depending on who logs in the system, for example; I want a super user to have access to all locations and any other user to only access to one location supplied by a global property. Is there a way I can override encounter cohort definition to supply those?

@darius @raff @dkayiwa


@ningosi, assuming you are using the legacy ui interface, the parameter widgets are defined in the ‘htmlwidgets’ module, and can be customized there. They can also be overridden by a custom widget in your own module by supplying a (lower numbered) sort weight in the annotation on the class.

Basically, in your module you would:

  1. Copy the default Location Handler defined here. Rename it and change the sort weight to, say, 50.

  2. Change the implementation to render a widget that behaves like you want (eg. a drop-down list that contains certain locations based on privilege).