Thoughts about report enhancements
This is posted here rather than in the User's Forum because a) I am still clarifying my ideas; and b) some of the details are in the developers/integrators are rather than the end user area.
I would like to suggest report enhancements in three areas:
1) add the current customer, patient (and possibly supplier) as automatically provided report parameters (like Email is currently), say as CurCustId, CurPatId, and CurSupId. These would have value 0 if there is no current value. [We currently use an @cid and @pid macro to provide these, but it is a kludge solution.]
2) add a Reports item to the left panel menu of the Customers, Patients and Suppliers workspaces. This would have the same functionality as the current Reporting|Reports screen, but the Type would be present to Custmer, Patient, or Supplier respectively.
3) add a new report type "Query" (where the content contains the SQL query). The output could be displayed on the screen using a tablular output with the column headings taken from the SQL field names. Esentially, one could use the MySQL Workbench to develop the query, and then save the query and upload it into a document template and set the Report Type to Query. Although this would not enable a non technical person to extract arbitary data from the system, it would allow semi-technical people to get data out of the system without having to fully master iReports.
Comments and feedback appreciated.
Regards, Tim G
Re: Thoughts about report enhancements
1) What circumstances would you use this in? There is the issue that the current object may not be relevant to the thing being reported on. E.g. viewing an old owner of a patient as opposed to the current owner.
2) Sounds fine. It could be useful to be able to configure buttons for common reports too.
3). Not so keen. Its not a big jump from MySQL Workbench to iReport, and the presentation options would be limited to displaying tabular results in the browser. Further development would be needed to replicate the CSV, PDF and text conversions already provided by jasperreports.
Re: Thoughts about report enhancements
Tim - responses as follows:
a) circumstances: I currently have the following reports which use the Current Patient (@pid macro): Patient Weight History (lists and charts current patient weight history); the following use the Current Customer (@cid macro): Extended Statement (generates statement over multiple months, with back to time that the openening balance was zero, or the last time the running balance was zero), Customer Running Balance, Customer Notes and/or Alerts (for either specific or all customers); and I currently have no 'current supplier' reports.
The concept of reporting on the current patient/customer is that the customer and patient workspaces have nice select facilities for finding the customer/patient you are interested in, but if you want to run a report on that customer/patient, then without the @cid/@pid kludge the only way to do this is to write down the customer/patient ID and then enter this number as a report parameter.
b) buttons for common reports - this would be neat - I was trying to keep things as simple as possible and figured that simply using the current Reporting|Reports code with the report type preselected would be good enough.
c) query report type - I was envisioning that the ONLY output from a 'query' report was columns to the screen, no PDF, no export, no print, no email - just the screen output. In fact, I might not object if only screen output was available from Customers|Reports and Patients|Reports. In fact, maybe we should add not Reports, but rather Queries, and just as Reporting|Reports selects only document templates of type 'Report', then Customer|Queries selects only document templates of type Query. However, this may be throwing the baby out with the bathwater since the current reporting system is so powerful and flexible. If we were not tight on left panel real estate (and used a drop down menu system) then I perhaps would suggest adding both - however, with a drop down it would be just as fast to select Reports/Queries from the Customer menu as the Reports menu. [I did say that my ideas were not fully formed.]
I also must admit that I have not thought about whether the the SQL query could delete or update records - is some ways it might be neat to run an update query for some things - but it might be wiser (if possible) to make sure that the SQL connection is in readonly mode.
Regards, Tim G
Re: Thoughts about report enhancements
a) Another approach would be to:
c) I think Workbench or phpMyAdmin are better suited to running arbitrary queries
Re: Thoughts about report enhancements
Tim A:
a) I agree with the 'define new report archetypes' approach. Two questions:
a1) Do you envisage that a report of the new archetypes would not be available on the Reporting|Reports screen? [ie Reporting|Reports would only show those with archetype 'REPORT'] - My vote is YES - ie patient/customer/supplier specific reports are accessed via Patients/Reports etc, and general reports via Reporting|Reports.
I have just realised that if I changed all my current Supplier reports from archetype 'REPORT' to 'party.supplier*' then they would all move to the Supplier|Reports page - and the fact that none of the (currently) use the current supplier, is neither here nor there. This will be quite logical - supplier reports are accessed via Suppliers|Reports.
The same applies for the Patient and customer reports - if I want the 'List all customers who spent more than $$$' report to be available via Customers|Reports, then I just change its archetype. Neat.
a2) Do you envisage keeping the rest of the Reporting|Reports facilities (ie we keep the Type pulldown and the report level handling? - My vote is YES.
c) Ok - I withdraw the Query idea.
I think we are now ready to proceed to the project spec/cost stage. Do we need to float this in the user forum?
Regards, Tim G
Re: Thoughts about report enhancements
I retract the idea to add "party.patientpet", "party.customerperson", and "party.supplier*" report types. It hindsight its not that useful.
At the moment, only a single template is supported per archetype report type (e.g. there can only one Invoice template for act.customerAccountChargesInvoice). This would prevent having both a customer mailing label template, and one that printed a customer summary, keyed to 'party.customerperson'.
This could be changed to support multiple templates, but then there would need to be a facility of defining the default template for particular workflows (e.g. always use the A4 invoice template at checkout).
Instead I think:
then these will be automatically populated with the current selected values.
If a parameter cannot be set, then reporting will fail with an error.
Given these parameters, it should be possible to access the id, name, and description e.g:
I'm not sure if the extension functions can be used on parameters. Will need to do some testing.
Re: Thoughts about report enhancements
Tim A - I think we need to pick this up again. I am starting on my 'renovate the standard reports' project, and the first one I picked to work on is the current 'Customer Reconciliation Report' - which will be functionally replaced by the 'Customer Running Balance Report' [which adds a running balance column].
This needs the customer id as a parameter. My version uses a text field to allow you to use the @cid macro to get the current customer id - but this is a kludge and I do not really want to use it in the standard reports.
Hence my need for an auto filled $P{CurCustID} parameter - I have a suspicion that we should stay away from 'customer' or 'customerID' as the name of the parameter to avoid conflicts with current reports that users may have. [The 'Customer Reconciliation Report' uses 'customerId'.]
Also - if it is easier, I would not error the report if there was no current customer, just set it to null and leave it to the report writer to generate an appropriate message.
I would also be happy to go with just setting the CurCustID, CurSuppID, and CurPatID parameters when running a report from Reporting|Reports - and not worry about the other sexy bits for the time being.
Regards, Tim G
Re: Thoughts about report enhancements
I can do CurrentCustomerID, CurrentSupplierID, and CurrentPatientID. I won't have time in the next few weeks to look at this however, so stick in a JIRA.
Re: Thoughts about report enhancements
I've had some offline discussions with a user that wants something similar, but wants to be able to access the objects rather than the ids.
I think this can be done by passing the context, or a subset of it, to the report as key/value pairs, and exposing them as fields. These would be prefixed with something unlikely to clash with existing nodes.
E.g. for JasperReports:
The NodeResolver syntax could be used to support operations like $F{OpenVPMS.location.id}.
Re: Thoughts about report enhancements
Tim A - OK by me. Just tell me what you end up with and when I can get a snapshot to test with.
Regards, Tim G
Re: Thoughts about report enhancements
New project here for comment: http://www.openvpms.org/project/access-application-context-reports