Reporting Module Parameters

The reporting module allows you to define parameters to collect information from the user. You're able to add parameters in the reporting module design process. Click + Add in the header of the Parameters box to add a parameter to the report.

Type

Collection Type: The first drop down box allows you to collect a single parameter a list of parameters or a set of parameters. The list and set types present a plus box next to the input allowing users to add as many parameters as they like.

Parameter Type: The second drop down box allows you to choose one of the many java and OpenMRS parameter types that are defined throughout the system. The list is exhaustive, but common parameter types include boolean which allows you to collect 0 or 1 values, date which pops up the date picker widget, integer, long which collects long integers, float which collects decimal point numbers and string. These parameters are displayed to the user using the presentation that is defined in the HTML Widgets Module.

Name

This field is the name that is used to reference the parameter within the report. In a SQL data set definition, you would use a semicolon to preface the name of the parameter. For example, select * from openmrs.person where id=:id;

Label

This is the value that's displayed to the user. Note that these labels are not affected by translations.

Advanced Configuration

The "Advanced Configuration" area provides an additional means of controlling how a particular parameter widget is rendered for entry. The expected format is as "properties" (key=value pairs, one pair per line). Each property is passed in as an "attribute" to the htmlwidget handler that is responsible for rendering the widget for that parameter, based on it's chosen type. These supported attributes, if they were documented at all, would be listed here: HTML Widgets Module. Each parameter type listed above has a unique set of attributes that can be added in this section.

Here are a few concrete examples:

Type: String

The following entry converts a string to a drop down window with the selected value forwarded to the report:

codedOptions=One,Two,Three

If you need your options to contain commas, you can change the separator by adding the following value in a new line:

optionSeparator=new_separator

Type: Concept

If your parameter is of type Concept, you could have an entry that looks like this:

includeClasses=4

This would limit the available Concepts to choose from for this parameter to only those that are Diagnoses.

Or, you could have an entry that looks like this:

This would limit the available Concepts to choose from for this parameter to only those that are configured as valid answers to this Concept.

If your parameter is of type Concept, you could have an entry that looks like this:

And this would display this text, rather than an empty value, as what appears in the select list for a Location parameter.

Notes:

  • Each of the available attributes can be found in the source code of the HTML Widgets module. 

  • These parameters are not as robust as the HTML form entry module.

  • There doesn't appear to be any method to add validation to the parameters in the reporting module.