Thursday, January 8, 2009

Ask OSCAR Anything

OSCAR provides an extensible interface that gives you the ability to ask the system anything and it will tell you what it knows. More importantly, this interface allows you to format the answer in a way that can be easily exported to another package.

For example, perhaps you wish to send a newsletter to your active patients.

Wouldn't it be nice if you could ask OSCAR to export the relevant demographic information to a spreadsheet so that you could print labels and form letters for the mailing?

This task is easily accomplished using OSCAR's Report By Template feature.

First, construct your query and save it as a text file on your laptop/desktop computer. (You can cut and paste the following query into a file if you wish to give it a try.)

<report title="Newletter Report"
    description="Reports Patient Addresses -
    Active, Letter Only" active="1">
        select last_name, first_name, address,
        city, province, postal
        from demographic
        where provider_no = {provider_no}
        and patient_status = 'AC'
        and newsletter = 'Paper'
        order by last_name, address
    <param id="provider_no" type="list"
        description="Provider Number">
       <param-query>select provider_no,
            CONCAT(last_name, ', ', first_name,
            ' (', provider_no, ')')
            from provider
            order by last_name;

Second, load your query into OSCAR, via the Admin->Report By Template window.

The third and final step is to click on the report to run it.

This particular query asks OSCAR to find all active tagged patients for a specific provider, patients that have had their Newsletter field set to paper, and when it finds them, to output a list of their names and addresses, sorted on their last name and their address.

The results can then be viewed, printed, or easily exported to another format.

Many more examples of report templates can be found on the OSCAR Canada website.

1 comment:

Robbie Coull said...

That's great.

Is there a list of the allowable parameter types anywhere for writing your own templates?