Expression error trying to get visit date

I am trying to merge in the date of the last visit in patient letter.

The expression in the Word document is:

[date:formatDate(openvpms:get(party:getPatientVisit(.,openvpms:get('patient.entity')),'startTime'))] 

Can anyone tell me what causes the above to give 'Invalid property name'

Regards, Tim G

Comment viewing options

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

Re: Expression error trying to get visit date

The party:getPatientVisit() function takes a patient argument rather than '.'; this represents the expression context object, which will be an act.patientDocumentLetter.

I also think you're also missing a '.' to openvpms:get('patient.entity'). You're trying to get the patient associated with the act.patientDocumentLetter.

Try:

date:formatDate(openvpms:get(party:getPatientVisit(openvpms:get(.,'patient.entity')),'startTime'))

If that doesn't work, break the expression down, till you can find where its failing.

Syndicate content