1.7 Alpha CSH query - databean contents

I want to start looking at knocking up the various reports that are missing (see https://openvpms.atlassian.net/browse/OVPMS-1320).

Since I can't use the trick of 'clone from existing' for these, how do I get information on the available fields for each report type.  ie if I want to build a template and document for Workflow|Appointment|Print where do I go to get the fields available.

I you give me the recipe for this, then I will add it to the CSH reference section (as well as start work on the missing stuff).

[I don't know whether the correct term is 'data bean' - I saw this used in a response to a specific query of mine some 6 months ago.]

Regards, Tim

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Re: 1.7 Alpha CSH query - databean contents

Data source as opposed to data bean would be a more appropriate term.

The archetypes for the missing templates are:

  • Appointment - act.customerAppointment
  • Customer Refund - act.customerAccountRefund
  • Stock Adjustment - act.stockAdjust
  • Stock Transfer - act.stockTransfer
  • Supplier Credit - act.supplierAccountChargesCredit
  • Supplier Delivery - act.supplierDelivery
  • Supplier Invoice - act.supplierAccountChargesInvoice
  • Supplier Remittance - act.supplierAccountPayment
  • Task - act.customerTask
  • Problem - act.patientClinicalProblem (entity.documentTemplate needs to be updated)

You can determine the available fields to use in the report by looking at the corresponding archetypes.

E.g., the act.customerAppointment has the following nodes:

         <node name="id" path="/id" type="java.lang.Long" hidden="true" readOnly="true" />
        <node name="name" type="java.lang.String" path="/name" hidden="true" minCardinality="1" derived="true"
            derivedValue="'Appointment'" />
        <node name="customer" path="/participations" type="java.util.HashSet" minCardinality="1" maxCardinality="1"
            filter="participation.customer" />
        <node name="patient" path="/participations" type="java.util.HashSet" minCardinality="0" maxCardinality="1"
            filter="participation.patient" />
        <node name="appointmentType" path="/participations" type="java.util.HashSet" minCardinality="1" maxCardinality="1"
            filter="participation.appointmentType" />
        <node name="startTime" path="/activityStartTime" type="java.util.Date" minCardinality="1" />
        <node name="endTime" path="/activityEndTime" type="java.util.Date" minCardinality="1" />
 

Each of these nodes may be used in reports as follows:

Node Jasper Expression Class Jasper Field
id java.lang.Long $F{id}
name java.lang.String $F{name}
customer java.lang.String $F{customer.entity.name}
patient java.lang.String $F{patient.entity.name}
appointmentType java.lang.String $F{appointmentType.entity.name}
startTime java.util.Date $F{startTime}
endTime java.util.Date $F{endTime}

Where a node refers to an archetype (e.g. the customer node is a collection of participation.customer), you can use "." to drill down on the nodes of that archetype.

In the above, "customer.entity.name" means:

1. retrieve the object associated with "customer.entity"; and

2. return its name node

-Tim

Re: 1.7 Alpha CSH query - databean contents

Thanks Tim - I have created http://www.openvpms.org/documentation/csh/1.7/reference/reportFields from the above.

Question: what happens with the template types like 'Customer Account Balance' and 'Grouped Reminders' where there is no archetype and the thing in the archetype column is in caps (eg CUSTOMER_BALANCE and GROUPED_REMINDERS)

Note also that I suspect I should also create a 'Document Fields' page which deals with fields in .odt and .dot documents but I just have not yet played enough with these to write the article yet.

Regards, Tim G

 

Re: 1.7 Alpha CSH query - databean contents

These are special reports that are generated by running queries that:

  • derive values
  • return partial objects
  • return multiple objects

For CUSTOMER_BALANCE, the fields are:

Field Type Description
customer.objectReference org.openvpms.component.business.domain.im.common.IMObjectReference The customer reference.
customer.name java.lang.String The customer name.
balance java.math.BigDecimal The customer balance
overdueBalance java.math.BigDecimal The customer overdue balance
creditBalance java.math.BigDecimal The customer credit balance
lastPaymentDate java.util.Date The customer's last payment date
lastPaymentAmount java.math.BigDecimal The customer's last payment amount
lastInvoiceDate java.util.Date The customer's last invoice date
lastInvoiceAmount java.math.BigDecimal The customer's last invoice amount
unbilledAmount java.math.BigDecimal The customer's unbilled amount

For GROUPED_REMINDERS, the fields are:

Field Type Description
customer party.customerperson The reminder customer
patient party.patientpet The reminder patient
reminderType entity.reminderType The reminder type
product product.* The reminder product
clinician security.user The reminder clinician
startTime java.util.Date The reminder start date
endTime java.util.Date The reminder due date
reminderCount java.lang.Integer The reminder count
act act.patientReminder The reminder act

-Tim

Re: 1.7 Alpha CSH query - databean contents

Thanks Tim, I have updated these into the CSH page.  The only one we are missing is WORK_IN_PROGRESS_CHARGES - see http://www.openvpms.org/documentation/csh/1.7/reference/reportFields

Regards, Tim G

Re: 1.7 Alpha CSH query - databean contents

I've added a note for this report.

-Tim A

Syndicate content