adding patients via kettle
Submitted by dadmin on Thu, 26/01/2012 - 22:53
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.
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
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
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
-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.