Implement caching in schedule and work list tables to improve performance rendering Display Expressions

Description

Complex Display Expressions in Schedule and Work List Views can impact performance if they trigger a lot of database accesses. E.g. the following expression for a Work List View:

1 concat(openvpms:get(.,'clinician.name'),':',openvpms:get(.,'patient.name'),' ',openvpms:get(.,'customer.objectReference.lastName'),' =',substring(openvpms:get(.,'act.status'),1,2),' ', openvpms:get(.,'waiting'),'{',date:format(openvpms:get(., 'act.objectReference.appointments.source.startTime'), "HH:mm"),'}',openvpms:get(.,'customer.objectReference.type.name'),'\n','[',openvpms:lookup(openvpms:get(.,'patient.objectReference'),'breed'),'] ',openvpms:get(.,'scheduleType.name'),':',openvpms:get(.,'act.objectReference.author.entity.name'),'\n',openvpms:get(.,'act.description'))

Means that:

  • the customer is retrieved twice

  • the patient is retrieved once

  • the task is retrieved twice

  • the appointment is retrieved once

  • the author is retrieved once

Using caching during rendering will improve performance for expressions where the same object is retrieved more than once, or that access common objects such as the author.

Environment

None

Status

Assignee

Tim Anderson

Reporter

Tim Anderson

Labels

None

Components

Fix versions

Priority

Minor