FHIR Chat · Cloning all data · implementers

Stream: implementers

Topic: Cloning all data


view this post on Zulip Rik Smithies (Oct 29 2019 at 16:58):

I want to copy all resources on one server to another. Firstly is there an easy way to do that - without writing a lot of procedural code? Secondly, I have created a script that does it ;-) but it fails to PUT the record on the second server if the Id already exists - but is a different resource type (this is a HAPI server). The Ids don't have to all be the same, but I can't see an easy way to fix up every reference if the Ids are not the same. I want this to work an any server type, so can't rely on special operations or even Batch inserts.

view this post on Zulip Grahame Grieve (Oct 29 2019 at 19:32):

there's 2 different things here:
- see the discussion on bulk-data around import
- the logical question of id management - see http://hl7.org/fhir/managing.html#distributed

view this post on Zulip Rik Smithies (Oct 29 2019 at 20:03):

thanks. I've found the bulk-data thread now. What i need is $import, but that's not available yet. I understand the issues of id management, and that there is no need for the ids to be the same across multiple systems. I'm still looking for a practical way to import a lot of data though. I will work on my scripts...

view this post on Zulip Rik Smithies (Oct 29 2019 at 21:05):

@Alexander Zautke can Vonkloader load a series of Patients then a series of Observations and link them to the right patients?

view this post on Zulip Alexander Zautke (Oct 30 2019 at 09:14):

No sorry, you would have to create transactions bundles for it. Though, you could use conditional references, Vonk will create the correct ids for you

view this post on Zulip Rik Smithies (Oct 30 2019 at 10:44):

ok thanks Alexander. I would like to use transaction bundles but some servers don't support them. My current efforts are a workaround for that exact issue in fact. So instead I am now using conditional references in my scripts. It means all Patients need a unique identifier, which may not always be the case (usually is though).

view this post on Zulip René Spronk (Oct 31 2019 at 16:32):

Does you script look for the root node in a graph (mostly: patient) and then walk the graph in the direction of leaf-nodes (i.e. without inbound references)? Circular references A->B->C->A are a nightmare if one can't use transactions. POST A,B,C and fix the references in a seconds processing step, that might do it.


Last updated: Apr 12 2022 at 19:14 UTC