Agata Reporting Engine
From FreemedDeveloperWiki, the FreeMED developers' Wiki.
The Agata Reporting Engine is a PHP-based reporting package. FreeMED had been using a version forked from their version 5 codebase, but has (as of the 0.8.3 release) started using the upstream versions of Agata, beginning with 7.6 beta.
It is not only suggested, but highly recommended that Agata's GUI builder be used to generate reports.
Contents |
Creating a FreeMED Report in Agata
- Make sure that the Agata reporting client is installed on your machine along with all requisite PHP and Gtk+ components, and that you have an available connection to the MySQL server running FreeMED and can connect with a CLI client.
- Start up the Agata reporting engine client (by using either "agata.bat" or "php agata.php", depending on your OS)
- ... (in progress) ...
Creating Parameters for Reports
Parameters are set either in the Agata frontend or in the XML format in the '<parameters>' section of the file. An example would be:
<Parameters>
<provider>
<mask></mask>
<value>Provider:module:providermodule</value>
</provider>
</Parameters>
This would create a single parameter with the name "Provider", type of "module" and option of "providermodule".
Parameter Types/Options
| Type | Option | Description |
|---|---|---|
| date | - | Date selection widget |
| module | Module class name | Module picklist widget for MaintenanceModules |
| patient | - | Patient selection widget |
| select | CSV list of possible options | Picklist of arbitrary values |
| text | - | Free text entry |
SQL Tips and Tricks
- Use ROUND(column, 2) to force a column to display in a financial format.
- Create your SQL query outside of the report, run it, then reformat it. It's almost impossible to debug inside of the file.
- Use FIND_IN_SET(id, '1,2,3,4') to find id in the set of numbers. Don't use compound WHERE clauses to do work they don't need to do.
