Expression error trying to get visit date
Submitted by Guest on Sun, 04/08/2013 - 19:48
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
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.