Query re custom demographic update

OPV has a demographic update facility.  It also allows for adding fields to the patient data via the entity.customPatient* facility.

However, am I correct in thinking that if one is wanting to port RxWork's facility to update custom fields when a product is sold (eg date of last worming, worming type), then although one can add fields for these, there is no way to 'demographic update' them because there is no facility to do setCustomPatient(entity,node,value) function.

Regards, Tim

Comment viewing options

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

Re: Query re custom demographic update

Products can have "Demographic Update" lookups associated with them. These are accessed via a products "Updates" tab.

Demographic updates are applied when an invoice is finalised.

E.g. to create a Demographic Update to set a patient's desexed status:

1. Go to Administration -> Lookups

2. Select New -> Demographic Update. Populate the fields as follows:

Name: Desex

Expression: party:setPatientDesexed(.)

Node: patient.entity

3. Add the Desex demographic update to a product (e.g. a service).

Note that the updates are invoked relative to an invoice item. The "patient.entity" node therefore resolves to the "patient" node of act.customerAccountInvoiceItem which is a participation.patient, and the "entity" node refers to the "entity" in participation.patient.

-Tim A

Re: Query re custom demographic update

Tim A - thanks for this and all your other replies.

I understand how the current desexed and deceased updates work and I have them running.

What I was trying to clarify whether there is a mechanism available to set (and get) the custom fields.

I think that the answer is NO - one can add custom fields but there is no mechanism to update them via the demographic update mechanism because no expressions are provided that allow the custom fields to be updated, ie there is no such thing as a party:setCustom(node,value) expression.

Regards, Tim

Re: Query re custom demographic update

Correct - there isn't a generic function to access and update nodes.

I'd be a little reluctant to implement one; typically this sort of thing can be done more efficiently and with greater security via functions implemented specifically for the purpose.

-Tim A

Re: Query re custom demographic update

Its just been pointed out to me that I implemented such a function back in 2009 for this very purpose for OVPMS-814

Arg.

-Tim

Syndicate content