Editing Reports

The following is an advanced section about modifying report formats.

There are two types of reports available,

  1. individual reports, and
  2. statistical reports.

All reports are template based. That is, for each available report in PHMS, a template file must exist either in the Template Path or in the program's installation path. Templates consist of HTML files that specify the contents and formatting rules for a given report. The formatting may include most of the basic elements, including bold, italic, and underline as well as tables and lists. Currently supported HTML authoring editors are,

Of course you may edit the HTML "by-hand" using your favorite text editor. If you do that, make sure you save your work as a plain text file and preview it to make sure your modifications were correct.

NOTE: The default reports are present in the program's installation directory, but you should never place your own or modified reports into that directory. You should create a separate directory under "My Documents" or on a network drive and set the Template Path accordingly. Any templates located in the installation directory may be removed or overwritten upon software upgrades.

While the formatting of each report is provided by HTML and regular text, the areas where data is to be inserted are enclosed between two pound signs (#) and represent fields names located in the database. For example, the field delimiting weight of a given patient is represented by #weight# entry. For a complete list of possible data fields, please see the default reports located in the installation directory.

Another important feature available for all reports are something called conditional statements. For example, let's say you wish to describe someone's weight as being obese if he or she is 150% of their ideal body weight (IBW). You would then write in the report,

Weight: #weight#  {#weight#/#iwb#>1.5?(Obese)}

For normal weight this will result in report stating

Weight: 75kg

But for obese weights,

Weight: 75kg (obese)

The syntax for these conditional statements is,

{ condition ? true text }

where,

condition - any logical or mathematical statement that can be evaluated. For example 1+2>0 (which is true) or 1+2>5 (which is false). This statement usually contains data from the report as in the weight example above.

true text - text that will be inserted in place of the conditional statement if and only if the condition is true. If the condition is false, then than nothing will be displayed.

Individual Reports

Individual reports only deal with single individual on a test-by-test basis. That is, each reports only contains data dealing with a single test for a given individual. These reports are,

Report Type Report Filename
Assessment assessment.html
Follow-up followup.html
Vasodilator Challenge (response) response.html
6-min Walk walk.html

For a list of all possible fields that may be used in customized format reports, please look at the above files.

Statistical Reports

Statistical reports only deal with statistical functions defined in the Reports section of the Preferences window. The formatting of statistical reports is still HTML, but only data fields defined as reports in the Preferences window may be used. Once reports are compiled, they should be saved in the Template Path with a filename, <Report Name>.html. For example, if you wish to create a report called "My Report", you should save your template file that defines the content of such a report with the filename My Report.html. After PHMS is restarted, the report should be available from the Patients menu of the main window.