adding patients via kettle

Hi,

I am trying to workout a kettle transform to get new client and pet info from a webform. I can get the client data to load OK but can't get the relationship between patients and customers to work. 

I first add the client and thought I would add the pet using the following mapping:

 

 <party.customerperson>patients[0]<party.patientpet>name 

but when I run it i get this error:

 

 2012/01/26 22:51:18 - OpenVPMS Loader.0 - Failed to process row xxx: No such accessible method: addEntityRelationship() on object: org.openvpms.component.business.domain.im.party.Party 

Any tips as to where I am going wrong?

Matt Y.

Comment viewing options

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

Re: adding patients via kettle

Try doing it in 3 transformations, one to load customers, one to load patients, and one to load their relationships.

E.g. If the customer table has fields customer_id, first_name, and last_name, and the patient table has fields name, species, and breed, and there is a customer_patient table which links them, your transforms would be:

1. Load customers.
   A Table Input step which selects rows from the customer table, with a hop to an OpenVPMS Loader step with:
   Id Field Name = customer_id

Field Name Map To Value
first_name <party.customerperson>firstName  
last_name <party.customerperson>lastName  

2. Load patients
   A Table Input step which selects rows from the patients table, with a hop to an OpenVPMS Loader step with:

   Id Field Name = patient_id

Field Name Map To Value
name <party.patientpet>name  
species <party.patientpet>species  
breed <party.patientpet>breed  

3. Load customer/patient relationships
   A Table Input step which selects rows from the customer_patients table, with a hop to an OpenVPMS Loader step with:
   Id Field Name = patient_id

Field Name Map To Value
patient_id <entityRelationship.patientOwner>target <party.patientpet>$value
customer_id <entityRelationship.patientOwner>source <party.customerperson>$value

 

-Tim

Re: adding patients via kettle

Thanks Tim,

I'll give that a try.

Matt.

Re: adding patients via kettle

What would be the best way of doing this if I don't have customer and patient id's? There is a submission id for each entry in the drupal database but no unique customer or patient id.

It gets created if I add the customer or patient through kettle but I can't work out how to get the id that is created.

Thanks,

Matt.

Re: adding patients via kettle

Try using the submission id for both patient_id and customer_id above.

Syndicate content