...
- Cohort Builder
- Go into Cohort Builder and click on the Patient Attributes tab
- Next to age, enter a minimum age of 15, and click search. This will return all patients at least 15 years old.
- To the right of the results here, click on the Save icon, and name this "Adults"
- Manage Patient Searches
- Click Manage Patient Searches from the Admin page
- Click into the "Adults" patient search that you created. You'll see that this is defined as a 'org.openmrs.reporting.PatientCharacteristicFilter' with an attribute of "minAge" set to 15.
- Now, to know exactly what other attributes are available, you may need to look at the Java code. In this case, looking at the PatientCharacteristicFilter java class, we can see that the following are available to set: gender, minBirthdate, maxBirthdate, minAge, maxAge, aliveOnly, deadOnly, effectiveDate. We can add in any of these that we want at this point - most should have been available to set via our search in step 1 with Cohort Builder, but others, such as effective date, need to be added here.
- Under "Add a new search argument:", add in:
- Name: "effectiveDate" -- this must match exactly with the property name from PatientCharacteristicFilter
- Value: ${date} -- the important thing here is that the value contains ${ }. This tells the reporting engine that this is a parameter, not a fixed value
- Java Class: "java.util.Date" -- this should be set to the Java class name of the parameter (in this case, it's a Date)
- Manage Reports
- Click Manage Reports on the Admin page
- Click Create Cohort Report (to create), or click on the name of an existing Cohort Report (to edit)
- Fill in a name and description and save. Once saved, you will have access to the next workflow steps.
- Click to the 'Parameters' tab
- Click 'Add new parameter' for each parameter your report contains. Typically you will want "name" to contain no spaces. In our case we want: Name: reportDate; Display Label: Date of the Report; Type: Date
- Click to the 'Indicators' tab and follow the instructions as listed. In our case, we're just going to add one indicator using the saved Patient Search we created above:
- Indicator: 1
- Description: Number of adults on the date of the report
- Click into the text field for Indicator Specification. Then click, from the right hand menu, the patient search you want (in our case, it should be [Adults|effectiveDate=${?}].
- Replace the "?" in the above indicator specification with the parameter name from your report. In our case, it would change to: [Adults|effectiveDate=${reportDate}]
- Run Report
- Click Run Reports on the Admin page
- Click on the Test Report link
- Try entering different values for the "Report Date" parameter and clicking Run Report for Cohort report web preview. It should work!
Release Notes
- 1.5.7
- Fixed Row per obs data export editing: RCM-66
- 1.5.3
- Changed dependencies so that there are no 1.8 dependencies and is compatible with 1.5.x and up.
- Copied the PatientSetService/Impl/DAO/HibernateDAO into the module as the ReportingCompatibilityService, changed references in DataExportFunctions to refer to this service
- Changed the implementation of 2 methods: getPatientPrograms and getDrugOrders, to improve DataExport performance - RCM-46
- 1.5.2.1
- Added NPE catch in report controller in case someone didn't provide a reportId - RCM-45
- 1.5.2
- Sped up data exports and forced them to use less memory (less OOMs) - RCM-20 (requires 1.8 for full speed up effect)
- Fixed some spelling errors in translation messages
- 1.5.1.5
- Fixed a few messages.properties translation elements
- Significant speedup for program and drugorder data exports
- Significant speedup for identifier data exports (1.8+ only)