Logic Data Set Definitions

Overview

Logic Data Set Definitions were added to the Reporting module in version 0.5.

They are similar to Data Exports in that you can define custom columns that then produce a row-per-patient report. Each column is defined by an Logic expression like this (assuming you have a concept called WEIGHT (KG):

last "WEIGHT (KG)"

See the Logic Service for more details on the expression format (at the time of writing the format is not documented)

At present these data sets do not have the full functionality of data exports, but this will change as the logic module progresses. But they allow you to define complex calculations for columns, and to use the same logic calculations in a report as in other places in the system (for example on alerts in the patient dashboard header using the Patient Flags Module).

Usage

  1. Go to the Manage Report Definitions page
  2. Create a new Row-Per-Patient Report (this is a shortcut for creating a generic report with a single Logic Data Set)
  3. Define your columns
    1. "Name" is the name this column will have when you export it
    2. "Label" is the name this column will have when you view it
    3. "Logic" is the logic expression that defines the column
      1. Start typing you should see suggestions based on the logic tokens you have registered.
      2. Tokens with a space in them need double quotes around them. (This happens automatically if you pick the suggested option.)
      3. Try putting "first" or "last" (without quotes) before the token
      4. If you don't see any tokens suggested then you need to "Register Default Logic Rules" from the Administration page before you can do anything.
    4. "Format" describes how the logic result should be displayed
      1. Value: display the result value
      2. Date: display the result date
      3. Boolean (X): if the result exists, display an X, otherwise leave the column blank
    5. Reorder columns by dragging them up and down
  4. Go to the Reporting page (linked from the header) and run the report
    1. Render as a "Row-per-patient Web Report" and you'll be able to page through your patients 25 at a time. (So running this report against 20000 patients won't kill your server, although you might get bored before you page through them all.)
    2. Rendering to a file could take a very long time if you do this for lots of patients. The calculations are done in batches of 1000 patients at a time, so it shouldn't kill your server.

Example Screenshots

Editing a Logic Data Set

Running a Logic Data Set Report