Macro expression testing for the presence of a selected Patient
Submitted by Matt C on Fri, 03/07/2020 - 11:59
Hi guys,
I thought I had this sorted but I dont :-)
I had thought this;
expr:if(boolean($patient), $patient.name,'NO PATIENT')
would work in say, a SMS macro where only a Customer has been selected but instead the macro just doesn't expand (fails).
Is my expression bogus?
Cheers
Matt
Re: Macro expression testing for the presence of a selected ...
If you use $patient.name, and there is no patient, you will get an expression error.
You need to use the expr:var(name, value) function. This returns the value of the named variable if it exists, otherwise returns value.
In your case:
Re: Macro expression testing for the presence of a selected ...
Thats great.
Thanks Tim.
Matt