Conditional Text
Submitted by gretalloyd on Fri, 29/03/2019 - 21:03
Hi,
Sorry if this has been posted somewhere else, but my search only came up with posts from 2013.
Are the conditional text functions for male/female he/she?
I thought it might be something to do with the expr:if(openvpms:get(.,'sex')='MALE','M')
But I can't get it to work within a macro
ie:
concat('Please feed ', openvpms:get($patient,'name') ,' as much food as expr:if(openvpms:get(.,'sex')='MALE','he', 'she') wants ')
Thanks,
Greta
Re: Conditional Text
The expression openvpms:get(.,'sex') will probably not work as the period will generally not refer to a patient.
Replace it with: openvpms:get($patient,'sex')
Secondly, there are some single quotes and commas missing. It should be:
Thirdly, there are a couple of simplications:
This gives the overall expression:
Re: Conditional Text
Awesome! Thanks so much Tim.
Greta