Macro expression testing for the presence of a selected Patient

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

Comment viewing options

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

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:

expr:var('patient.name', 'NO PATIENT')

Re: Macro expression testing for the presence of a selected ...

Thats great.

Thanks Tim.

Matt

Syndicate content