Customer Insurance Name in OpenOffice Document
Submitted by EastsideVetEmerg on Mon, 04/07/2016 - 20:36
Hi,
Can someone tell me what field information I use to get the customer insurance name in an open office document.
Thanking you,
Adrian
Re: Customer Insurance Name in OpenOffice Document
Also, account balance. I tried [party:getAccountBalance($customer)] to no avail.
Re: Customer Insurance Name in OpenOffice Document
Adrian - I proceeded by working from the sample documents in <Openvpms-Home>/Reports/Samples - and by looking at http://www.openvpms.org/documentation/csh/1.9/reference/reportFields
With the odt document looking like:
Running this both as a Customer Form and a Patient Form (or letter) I got:
As always, there are other solutions - for example if we use:
we get:
So what is happening is that the openvpms:get(.,"customer.entity.insurancePlan") is looking at the current item (the .) - which in this case is a customer form - and then looking at its customer node which points at an entity and then grabbing the insurancePlan node from that. As you can see this retrieves the actual value of the field - which is the code of the lookup.customerInsurance.
If we want the actual value we need to use openvpms:lookup().
However, the easiest form is the original OpenVPMS.customer.insurancePlan - this says 'get the current customer then grab the value of its insurancePlan node - and if this is a lookup do the lookup for me'.
What about $customer.insurancePlan ? This is the form we need in a macro - where the variable $customer accesses the current customer.
Why $customer in a macro and OpenVPMS.customer in an odt document? Basically evolution. The macro facility uses 'variables' - eg $number, $customer, $patient etc. When the 'report fields' facility was added in 1.8, the same syntax could not be used.
Regards, Tim G