We're updating the issue view to help you get more done. 

Change Medical Records.jrxml to use $OpenVPMS.patient instead of patient node

Description

The Medical Records.jrxml accesses the patient using:
1. openvpms:get(.,'patient.entity') for fields; and
2. $P{dataSource}.getDataSource("patient") for the letterhead subreport

These can fail if the report is customised to change the order of records. If the first record happens to be an Investigation Version, Attachment Version or Image Version, the report fails, as none of these archetypes have a patient node.
An error might present as:

1 Error evaluating expression for source text: $F{patient.entity.dateOfBirth}

(Note that at present, the actual object passed to the Letterhead.jrxml report is immaterial. It is required so the record set is non-empty).

To avoid this:

  • use OpenVPMS.patient to access the patient. This is a field supplied to the report

  • use $P{dataSource}.getExpressionDataSource("$OpenVPMS.patient") for the Letterhead.jrxml datasource expression

Environment

None

Status

Assignee

Tim Anderson

Reporter

Tim Anderson

Labels

None

Components

Fix versions

Affects versions

1.9

Priority

Minor