How To Use the New Date formats in OO reports

I'm trying to create an updated vax certificate.

My certificate is currently generated from an .ODT file.  In Patients | Documents| New | Form I enter a date one year hence in Date field.  In OO, Ctrl-F2 | UserField I add NextVax in Name and StartTime in Value

I place NextVax in my ODT file and the OpenVPMS generated certificate says:
"Next Vaccination due: 20/04/2015"

This is the way it's been up to now.  But now with v1.7, I want the certificate to say: 
"Next Vaccination due: April 2015"

I tried changing the userfield NextVax in the ODT file to date:format(startTime, "MMMM yyyy") but get an error message saying "Invalid Property Name: date:format(startTime, "MMMM yyyy")".  I've tried various combinations of dates and styles but all return a similar error message. I'm obviously doing something wrong, but I don't know what.

Any help appreciated.

Yuri.

Comment viewing options

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

Re: How To Use the New Date formats in OO reports

Yuri - after some experimentation, herewith the answer

 

This is the output

As you can see, in order to get date:format to work, you have to give it not the 'raw' date field, but rather the date field retrieved by openvpms:get.  If you just use the raw date field (as in the second line in the above) then nothing comes out.

Note that there is nothing significant about my use of the patient DOB - I happened to have a patient letter that dumped the patient DOB so I started playing with that, and when I got the DOB formatted as required then I added in the startTime field to check that that also worked.

Note that I probably need Tim A to add a comment as to why you have to do it this way, and then I will update the CSH text to reflect the above behaviour.

Regards, Tim G

Re: How To Use the New Date formats in OO reports

Thanks, Tim, much appreciated: I'll give that a try at work tomorrow: I had fiddled with openvpms:get and had placed it both outside and inside (as you did) but I left out the ., in front of StartTime (and didn't enclose StartTime in quotes - coming from "ye olden times DOS" Paradox DBMS, variables were never enclosed in quotes, only text).  It's obvious I don't understand how OV retrieves data from the database and the intricacies of what everything means:  more bedtime reading I suspect <g!>.

Yuri.

Re: How To Use the New Date formats in OO reports

No problems Yuri. I don't know whether its a typo on your part, but note that it is 'startTime' rather than 'StartTime'. Thanks to you I now understand that it is possible to access the document's date - my certificates all use today's date - which may not be correct. I will look editing them to use the document date.

Regards, Tim G

Re: How To Use the New Date formats in OO reports

Yes, I used the correct form of startTime (as in OP).   I was slack in my subsequent reply <g!>.

Yuri.

Syndicate content