Tying myself in knots.

So Ive moved on to adding reminders...which as I understand it involves adding a new 

act.patientreminder 

also a 

participation.remindertype 

and a

participation.patient.

I am trying to do this using the loader and Kettle.

I have successfully loaded my patients. and so i have known "loader ids" for them

Initially when I examined act.remindertype I figured I could just drop a <party.patientpet>$value into the 

<act.patientReminder>patient  and be done, but I am now assuming that isnt the case...

 

Secondly with respect to 

<act.patientReminder>reminderType  - this has to be  a <participation.reminderType> collection

So I am a little confused, because the way I see it I cant generate a Act.reminderType with out knowing  the ID of the participation.reminderType. which itself requires the act.reminderType.? 

the startTime and endTime seemed self explantory for act.reminderType. and I assumed i could ignore status for the load and let it default.

So is it possible to load this is the kettle loader. 

My understanding is the participations link the acts.  to entitities and acts to parties. 

But given the parcipation needs to know the act and party when its generated and the act needs to know the participation on generation which comes first.

What i have so mapped so far is

PATIENT_ID <act.patientReminder>patient[0]<participation.patient>entity <party.patientpet>$value
REMINDERtype  <act.patientReminder>reminderType[0]<participation.reminderType>entity <entity.reminderType>name=$value
DATE_COMPL <act.patientReminder>startTime  
DUE_DATE <act.patientReminder>endTime  

Is that right? because the trouble I have been having is that I get 

2012/03/07 15:16:09 - OpenVPMS Loader.0 - Failed to process row RT_2571: Invalid reference: <entity.reminderType>name=C5 Vaccination And Annual Health Check

which means I am probably searching the wrong way tips appreciated.

Comment viewing options

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

Re: Tying myself in knots.

You've got the right idea, but unfortunately your scenario isn't supported.

The 'value' part of the <archetype>node=value expression is limited to the characters A-Z, a-z, _ and 0-9. i.e, it cannot contain spaces.

That particular expression was designed to support lookups - AFAIK your the first person to try it for other archetypes.

An alternative would be to use the id node of entity.reminderType.

i.e.. <entity.reminderType>id=$value

You might have to jump though some hoops to transform the reminder type name to its corresponding OpenVPMS id to set $value however.

-Tim

Re: Tying myself in knots.

I tried this what I thought was the proper way ie

I loaded the remindertypes via etl and then referenced them via the loader ID.

ie <entity.reminderType>$value

Which I think worked but I failed to validate the Act of ReminderType 

error: 

 

2012/03/08 18:14:47 - OpenVPMS Loader.0 - Failed to process row RT_2293: Failed to retrieve object: <party.patientpet>2293
2012/03/08 18:14:48 - OpenVPMS Loader.0 - Signaling 'output done' to 0 output rowsets.
2012/03/08 18:14:48 - OpenVPMS Loader.0 - Failed to process: Failed to validate Act of Reminder Type: value is required
2012/03/08 18:14:48 - OpenVPMS Loader.0 - Failed to process row RT_1: Failed to validate Act of Reminder Type: value is required
2012/03/08 18:14:48 - OpenVPMS Loader.0 - Failed to process row RT_1: Failed to validate Act of Reminder Type: value is required
2012/03/08 18:14:48 - OpenVPMS Loader.0 - Failed to process row RT_1007: Failed to validate Act of Reminder Type: value is required
2012/03/08 18:14:48 - OpenVPMS Loader.0 - Failed to process row RT_1008: Failed to validate Act of Reminder Type: value is required

Given I provided the following 

 

2012/03/08 18:14:46 - Select values 2.0 - Got row from previous step: [2567], [Canine C5 Vacc], [28/01/2012], [27/01/2013], [RT_2567], [Canine C5 Vacc], [Canine C5 Vacc], [ 0365], [1], [Canine C5 Vacc]
2012/03/08 18:14:46 - Select values 2.0 - Wrote row to next step: [2567], [28/01/2012], [27/01/2013], [RT_2567], [1]
above is the data provided to the loader. the last number is the ReminderType ETL ref ID
 
PATIENT_NU <act.patientReminder>patient[0]<participation.patient>entity <party.patientpet>$value    
REMINDERID <act.patientReminder>reminderType[0]<participation.reminderType>entity <entity.reminderType>$value    
DATE_COMPL <act.patientReminder>startTime      
DUE_DATE <act.patientReminder>endTime      
REMSTAT <act.patientReminder>status      

I assume to fail validation I must have screwed up one of my refs ....because these are the only 5 params with a min cardinality of 1

I guess Ill try with the referring to the actual id..ie id=$value ....and try some sort of db ref

Side Note:
does the ETLHelper package still exist..I noticed it referenced a while back but couldnt find it in any jars to examine the functions it can provide.

I thought it was part of the Packages.org.openvpms.etl.ETLHelper but couldnt find it in the source anymore.

Also can I say when I first started manipulating OPVPMS I found the structure completely frustrating, coming from traditional databases.  When you understand HOW it works it's quite amazing.  Thanks for taking the time to help explain it as well.

 

Re: Tying myself in knots.

Also I guess I should have asked - if people dont load Reminders via Kettle do they do it via the dataloader, and convert all the data to xml?
 

Regards
 
Ben 
OpenVPMS Installer and Helper 
Ph: +61423044823 
Email: info[at]charltonit.com[dot]au

Re: Tying myself in knots.

The <act.patientReminder>reminderType[0] refers to a participation.reminderType.
You've set the entity node of this correctly - you also need to set the act node, which must refer to the parent act.patientReminder.

The loader should be smart enough to do this for you, but you'll have to do it manually for now.

Hopefully you have an ID for the act.patientReminder handy - call it REMINDERACTID. Your mapping would look something like:

REMINDERID <act.patientReminder>reminderType[0]<participation.reminderType>entity <entity.reminderType>$value
REMINDERACTID <act.patientReminder>reminderType[0]<participation.reminderType>act <act.patientReminder>$value

 

WRT ETLHelper. I don't recall that class. Its referred to in http://www.openvpms.org/fileuploads/customer%20-%20information.ktr but not used.

 

-Tim

Re: Tying myself in knots.

Awesome thanks Tim, I guess I thought the loader woulder just reflect the id into those participations...

as a closing note the same applies to the

 

PATIENT_NU <act.patientReminder>patient[0]<participation.patient>entity <party.patientpet>$value
REMINDERACTID <act.patientReminder>patient[0]<participation.patient>act <act.patientReminder>$value

it must be implicitly set and the act pass's validation.

Regards
 
Ben 
OpenVPMS Installer and Helper 
Ph: +61423044823 
Email: info[at]charltonit.com[dot]au

Re: Tying myself in knots.

I don't see how the patient participation would pass validation without a mapping that links it to the reminder act.

Your participation mappings should look something like:

REMINDERID <act.patientReminder>reminderType[0]<participation.reminderType>entity <entity.reminderType>$value
REMINDERACTID <act.patientReminder>reminderType[0]<participation.reminderType>act <act.patientReminder>$value
PATIENT_NU <act.patientReminder>patient[0]<participation.patient>entity <party.patientpet>$value
REMINDERACTID <act.patientReminder>patient[0]<participation.patient>act <act.patientReminder>$value
PRODUCTID <act.patientReminder>product[0]<participation.product>entity <product.*>$value
REMINDERACTID <act.patientReminder>product[0]<participation.product>act <act.patientReminder>$value

 

-Tim

Syndicate content