correct syntax for retreiving a customer/patient id
Submitted by Matt C on Wed, 12/08/2009 - 18:39
Hi everyone,
I was wondering if someone could point me in the right direction to get the patient or customer id in the context of the ScheduleView or Worklist view expressions.
I've tried
openvpms:get(., 'patient.entity_id'),
openvpms:get(., 'patient.id'),
but both return expression errors.
Is there somewhere I can see what properties the patient and customer return so I don't bother the developers with such inane queries?
:)
Cheers,
Matt C
Re: [OpenVPMS Developers] correct syntax for retreiving a custom
Try the following:
openvpms:get(., 'patient.objectReference')/id
openvpms:get(., 'customer.objectReference')/id
Neither of these calls are very efficient as the relevent objects are retrieved first in order to determine their ids.
Performance can be improved by exposing the PropertySet used to cache the properties as a Map.
You could then access the properties via jxpath something like
properties/patient.objectReference/id
properties/customer.objectReference/id
without the requirement to retrieve the corresponding patient/customer objects.
Also note that neither of the above properties are visible to the 'Edit Display Expression' editor.
You'll get an 'Expression Error' message if you click 'Test'.
All of the properties it knows about are listed in the 'Expression Properties' box.
The full set of available properties are:
act.objectReference
act.startTime
act.endTime
act.status
act.statusName
act.reason
act.reasonName
act.description
schedule.objectReference
schedule.name
customer.objectReference
customer.name
patient.objectReference
patient.name
scheduleType.objectReference
scheduleType.name
clinician.objectReference
clinician.name
arrivalTime
If you want to access customer and patient properties other than the above, you need to consult their corresponding archetype descriptors.
You'll need to access their properties using the references as described above.
E.g to get a patient breed you can do:
openvpms:lookup(openvpms:get(., 'patient.objectReference'), 'breed')
Re: New or updated comment for General developer's discussion Fo
Hi Tim and Tony,
Thanks so much for the help.
Tim your syntax did work nicely. Thanks for the property listing as well.
I've saved it in my hand to know file.
Tony also tried patient.entity.id but that threw an expression error within
the workflow.
We only need it for one particular list which we are going to use for
entering patient data into our digital imaging. I fugure it might be handy
to have patient IDs stored there for future integration.
Cheers once more,
Matt C
Re: [OpenVPMS Developers] correct syntax for retreiving a custom
patient.entity.id I beleive.
everthing is referenced from the specific archetype so knowing the nodes for a specific archetype is a good start. The participation and entityRelationship archetypes have some special syntax i.e patient.entity.idreferences the the patient participation, the entity object linked to this participation and the id node associated with this entity.
Cheers Tony
On Wed, Aug 12, 2009 at 5:41 PM, wrote:
> Hi everyone, > > I was wondering if someone could point me in the right direction to get the > patient or customer id in the context of the ScheduleView or Worklist view > expressions. > > I've tried > openvpms:get(., 'patient.entity_id'), > openvpms:get(., 'patient.id'), > > but both return expression errors. > > Is there somewhere I can see what properties the patient and customer > return so I don't bother the developers with such inane queries? > > :) > Cheers, > Matt C > _______________________________________________ > OpenVPMS Developers Mailing List > developers@lists.openvpms.org > To unsubscribe or change your subscription visit: > http://lists.openvpms.org/listinfo/developers > Posts from this mailing list can be viewed online and replied to in the > OpenVPMS Developer's forum- http://tinyurl.com/openvdf >