WorkList View Display Expression
Submitted by EastsideVetEmerg on Thu, 22/05/2014 - 12:25
Hi,
i was wanting to add the referring vet associated with a patient to the work list view display expression but can't work out if it is possible and if so what is the correct expression to use. I looked in the context sensitive help but not listed as an option here.
Can someone help?
thanks,
Adrian
Re: WorkList View Display Expression
Adrian - you need one of the party:getPatientReferral... functions - see http://www.openvpms.org/documentation/csh/1.7/reference/jxpath#party
You may also want to make use of the substring function (see http://www.openvpms.org/documentation/csh/1.7/reference/xpath ) to limit the length of the output (so that the column widths are controlled. Below is an example of its use:
concat(substring(concat(openvpms:get(.,'clinician.name'),':',openvpms:get(.,'patient.name'),' ',openvpms:get(.,'customer.objectReference.lastName'),' =',substring(openvpms:get(.,'act.status'),1,2)),1,60),'\n', substring(concat('[',openvpms:lookup(openvpms:get(.,'patient.objectReference'),'breed'),'] ',openvpms:get(.,'scheduleType.name'),':',openvpms:get(.,'act.reasonName')),1,60),'\n',openvpms:get(.,'act.description'))
Here you can see that it is being used to limit the width to 60 characters.
I do not have the ability to experiment at the moment, but I suspect that party:getPatientReferralVet(.) and party:getPatientReferralVetPractice(.) will get you what you want - but you may have to call up the patient, ie use party:getPatientReferralVet(openvpms:get(., "patient.entity")) and similarly for the practice.
Regards, Tim G
Re: WorkList View Display Expression
Hi,
Sorry, coming back to this. I never got this to work but I would love to be able to do it now. Tried all of those functions and the test came back with an expression error.
Can I please have some more assistance. I would also love to get signalment (Age, Sex, Breed) in the format
"2Y MN Birman" as well if possible...
Thanks,
Adrian
Re: WorkList View Display Expression
Tim A - I have been playing with this. I have worklist view expressions that use openvpms:get - eg
concat('name=',openvpms:get(.,'customer.objectReference.lastName'),' xx')
These work. But an equivalent using the party functions do not - ie
concat('name=',party:getPartyFullName(.),' xx') gives Expression error
Are party: functions not allowed in worklist view expressions?
Regards, Tim G
Re: WorkList View Display Expression
The expression test facility is fairly basic; the various .objectReference properties aren't populated as these weren't intended to be used by end-users. They can be responsible for performance issues.
The following expression includes the patient age, sex and breed, and the referring practice, if there is one:
Re: WorkList View Display Expression
Bingo! Works wonderfully! Thanks a heap! Much appreciated. Have a lovely holidays to you both!