Stream: implementers
Topic: Batch Processing
Paul Barry (May 09 2016 at 05:18):
I would like to process a batch on my FHIR Server will some conditional logic. The batch will contain a MedicationOrder entry, a Patient and Prescriber(Practitioner). The client will not know the logical identifiers when it submits the bundle (my FHIR creates logical ids during create) but the client will know the business identifiers for each of these resources. If my logic is to only create a Patient if they don't already exist, then what value should i put to reference the Patient to the MedicationOrder in the bundle. Should I reference using the business identifier?
e.g. <reference value="Patient?Identifier=1234123512341235"/>
Grahame Grieve (May 09 2016 at 08:30):
well, see the discussion for the Conditional Reference connectathon track:
Grahame Grieve (May 09 2016 at 08:31):
http://wiki.hl7.org/index.php?title=201605_Conditional_Reference_Connectathon_Proposal
Grahame Grieve (May 09 2016 at 08:32):
note that what is proposed there is a change to the specification; having implemented it, it's far from clear to me that this is the overall correct approach to implement this.
Grahame Grieve (May 09 2016 at 08:32):
and note that you need transaction not batch for this
Simone Heckmann (May 09 2016 at 14:17):
Hi Paul,
Simone Heckmann (May 09 2016 at 14:17):
please note that the conditional Reference will not create the Patient if it's missing!
Simone Heckmann (May 09 2016 at 14:18):
In that case you should use a conditional create on the patient resource instead
Simone Heckmann (May 09 2016 at 14:20):
...or maybe a conditional update, depending on whether you want your patient resource to update an existing resource on the server in case it already exists.
Kind of like this:
<Bundle xmlns="http://hl7.org/fhir"> <id value="20160508123402" /> <type value="transaction" /> <entry> <fullUrl value="urn:uuid:f9935843-19a2-4a1a-4016-7bea52de77f6" /> <resource> <Patient> <meta> <tag> <code value="CLOVERLEAF" /> </tag> </meta> <identifier> <use value="usual" /> <type> <coding> <system value="http://hl7.org/fhir/v2/0203" /> <code value="MR" /> </coding> </type> <system value="http://www.ghh.org/identifiers" /> <value value="presentation2" /> <assigner> <display value="TCPAS" /> </assigner> </identifier> <name> <use value="official" /> <family value="CondRef" /> <given value="Guy" /> </name> <telecom> <system value="phone" /> <value value="277543" /> <use value="home" /> </telecom> <gender value="female" /> <birthDate value="1928-05-24" /> <address> <line value="22 Stable Road" /> <city value="Whitstable" /> <state value="Kent" /> <country value="CR5 1EL" /> </address> <contact> <relationship> <coding> <system value="http://hl7.org/fhir/patient-contact-relationship" /> <code value="parent" /> </coding> </relationship> <name> <family value="CondRef" /> <given value="Dad" /> </name> </contact> </Patient> </resource> <request> <method value="PUT" /> <url value="Patient?identifier=http://www.ghh.org/identifiers|presentation2" /> </request> </entry> <entry> <fullUrl value="urn:uuid:0aa4e89f-90dc-446a-4234-ad9caaff20e6" /> <resource> <Encounter> <meta> <tag> <code value="CLOVERLEAF" /> </tag> </meta> <identifier> <use value="usual" /> <type> <coding> <system value="http://hl7.org/fhir/v2/0203" /> <code value="MR" /> </coding> </type> <system value="http://general-hospital.co.uk/Identifiers" /> <value value="presentation1" /> <assigner> <display value="GENHOS" /> </assigner> </identifier> <status value="in-progress" /> <class value="inpatient" /> <patient> <reference value="urn:uuid:f9935843-19a2-4a1a-4016-7bea52de77f6" /> <display value="CondRef, Guy(*24.05.1928)" /> </patient> <period> <start value="2015-05-02T09:00:00+01:00" /> </period> </Encounter> </resource> <request> <method value="PUT" /> <url value="Encounter?identifier=http://general-hospital.co.uk/Identifiers|presentation1" /> </request> </entry> </Bundle>
Simone Heckmann (May 09 2016 at 14:22):
Note how the uuid assigned in the fullurl of the bundle entry can be used to create references within the bundle...
Paul Barry (May 09 2016 at 22:46):
Thanks Simone,
So just to clarify, the full URL you provided on the patient entry was just a randomly generated Guid by the client?
<fullUrl value="urn:uuid:f9935843-19a2-4a1a-4016-7bea52de77f6" />
You use this uuid to link the patient to the Encounter entry?
<reference value="urn:uuid:f9935843-19a2-4a1a-4016-7bea52de77f6" />
If the patient did exist in this scenario, how would you save the Encounter entry? Would you update the Encounter patient reference to use the Logical Id of the pre-existing Patient?
Paul Barry (May 10 2016 at 00:29):
Thanks Grahame, I am hoping to attend the NCTS connectathon in Melbourne next week. So possibly I could show you a working implementation of this scenario on our FHIR Server?
Grahame Grieve (May 10 2016 at 00:54):
ok
Last updated: Apr 12 2022 at 19:14 UTC