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:

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

return its name node

To flesh this out a little, let us consider the act.customerAccountChargesInvoice and the party.customerperson archetypes which display (in part) as follows:

If you look at the Path column you can see 8 types of entries as follows:

Type

Name

Path

Access via

Simple

amount

/total

total

Simple/Detail

reference

/details/reference

reference

Participation

location

/participations

location.entity.xxx

SourceAct

items

/sourceActRelationships

items.target.xxx

TargetAct

reverses

/targetActRelationships

reverses.source.xxx

EntityLink

practice

/entityLinks

practice.target.xxx

Contact

contacts

/contacts

[function]

Classification

tax

/classifications

[function]

Lookup

title

/details/title

title
title.xxx

Lookup Local

status

/status

status
status.xxx

In the above xxx indicates one nodes of the entity, target or source - eg location.target.name - the way to figure out whether it should be entity or target or source is to look at the archetype for the coupling archetype, eg participation.location, actRelationship.customerAccountInvoiceItem, entityLink.customerLocation.

The [function] entry indicates that for these nodes (which can have multiple occurances - eg a customer can have multiple contacts), one needs to use one of the party:get() functions to access the information.

For items which have their values constrained by either one of the Lookups (eg title) or a set of local settings in the archetype (eg status) then using the simple reference (eg title or status) will access the stored value (eg MRS or IN_PROGRESS). However, you can also used the .xxx form as follows:

title.code -> MRS

title.name -> Mrs

title.id -> 123 (the id of the lookup)

title.shortName -> lookup.personTitle (the archetype)

title.displayName -> the display name of the lookup

status.code -> IN_PROGRESS

status.name -> In Progress

Application Fields

The following fields are available to all reports1, and represent the current selections in the application, if any. Note that if on the Workflow|Scheduling or |Work Lists screen you select an appointment or task, these become the current aqppointment or task. However, the fact that the associated customer and patient details are displayed in the left panel does NOT mean that these become the current customer and patient. The current customer and patient are those displayed on the Customers|Information and Patients|Information screens.

These fields may also be used in XPath expressions, by prefixing the field name with a $ (i.e. they are available in expressions as variables).

Field

Archetype

Description

OpenVPMS.patient

party.patientpet

The current patient

OpenVPMS.customer

party.customerperson

The current customer

OpenVPMS.practice

party.organisationPractice

The current practice

OpenVPMS.location

party.organisationLocation

The current practice location

OpenVPMS.stockLocation

party.organisationStockLocation

The current stock location

OpenVPMS.supplier

party.supplier*

The current supplier

OpenVPMS.product

product.*

The current product

OpenVPMS.deposit

party.organisationDeposit

The current deposit account

OpenVPMS.till

party.organisationTill

The current till

OpenVPMS.clinician

security.user

The current clinician

OpenVPMS.user

security.user

The current user

OpenVPMS.invoice

act.customerAccountChargesInvoice

The current invoice. Only valid:

if in checkin, consult, checkout workflows

if an invoice is selected in the charges workspace

OpenVPMS.visit

act.patientClinicalEvent

The visit for the current patient. Only valid:

if a patient visit is selected

if in the checkin, consult, or checkout workflow

OpenVPMS.appointment

act.customerAppointment

The current appointment. Only valid:

when checking, consulting or checking out using an appointment

if an appointment is selected

OpenVPMS.task

act.customerTask

The current task. Only valid:

when consulting or checking out using a task

if a task is selected

1 With the exception of JasperReports SQL sub-reports

Field Samples

Field

JasperReports

Word MERGEFIELD/OpenOffice User Field

Field

Expression Class

Practice name

$F{OpenVPMS.practice.name}

java.lang.String

OpenVPMS.practice.name

Customer first name

$F{OpenVPMS.customer.firstName}

java.lang.String

OpenVPMS.customer.firstName

Customer last name

$F{OpenVPMS.customer.lastName}

java.lang.String

OpenVPMS.customer.lastName

Patient identifier

$F{OpenVPMS.patient.id}

java.lang.Long

OpenVPMS.patient.id

Appointment date/time

$F{OpenVPMS.appointment.startTime}

java.util.Date

OpenVPMS.appointment.startTime

User name

$F{OpenVPMS.user.name}

java.lang.String

OpenVPMS.user.name

Expression Samples

Description

Expression

Practice telephone

[party:getTelephone($OpenVPMS.practice)]

Practice Location address

[party:getCorrespondenceAddress($OpenVPMS.location)]

The current appointment start time as date with 'No current ...' check

Note that the expr:var() function needs the name of the variable to test (eg 'OpenVPMS.appointment.startTime') whereas the date:format functions needs the actual variable, eg $OpenVPMS.appointment.startTime or

For WORK_IN_PROGRESS_CHARGES, the report is supplied with Invoices, Credits and Counter charges (act.customerAccountChargesInvoice, act.customerAccountChargesCredit, and act.customerAccountChargesCounter archetypes respectively), that have an In Progress, Complete or On Hold status.

The available fields are therefore the nodes present in each of these archetypes.

JasperReports Expressions

JasperReports can evaluate xpath expressions by declaring a variable that uses the EVALUATE() function. This takes a single argument, the expression to evaluate e.g.:

EVALUATE("party:getAccountBalance(.)")

Report parameters can be accessed by the function by prefixing their names with $P. SQL-based JasperReports can also access the report fields, by prefixing their names with $F. e.g.:

EVALUATE("product:price($F.productId, $F.unitPrice, $P.includeTax)")

The above calls the product:price() function, supplying the values of the productId and unitPrice fields, and the includeTax parameter.