How do I insert patient breed without it being in capitals

Hi,

I'm using the following expression in an email template:

', openvpms:get($patient,'name') ,' is a ', openvpms:get($patient,'age') ,' old ', openvpms:get($patient,'breed') ,'.

 

It is creating the following info. The breed is in all caps and has underscores.

Spike is a 9 Years old CROSSBRED_GERMAN_SHEPHERD_DOG.

 

is there something I need to edit in my expression to make it just normal text.

For bonus points, is there a way for it to say: 9 year (instead of 9 Years)?

 

Thanks,

Greta

Comment viewing options

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

Re: How do I insert patient breed without it being in capitals

You don't need to use the openvpms:get() form when you have a variable like $patient.
You can access the nodes directly: $patient.name etc, which is a little less verbose.

The openvpms:get($patient,'breed') call returns the breed code which is used to uniquely identify the breed.
To get the breed name, use $patient.breed

So the following should handle the your first query:

concat($patient.name,' is a ', $patient.age ,' old ', $patient.breed)

Your second query can be handled using toLowerCase() to convert 'Years' to 'year' followed by replaceAll() to remove the 's' e.g.:

concat($patient.name,' is a ', replaceAll(toLowerCase($patient.age), "s", "") ,' old ', $patient.breed)

-Tim

Re: How do I insert patient breed without it being in capitals

Thanks so much Tim

Syndicate content