Example
Bundle/bundle-transaction
(XML)
Raw
XML
(
canonical
form
+
also
see
XML
Format
Specification
)
An
example
transaction
(id
=
"bundle-transaction")
<?xml version="1.0" encoding="UTF-8"?>
<!-- actually, in a transaction, you don't specify the [base],
so [base]/Patient becomes just 'Patient': -->
<!-- actually, in a transaction, you don't specify the [base],
so [base]/Patient becomes just 'Patient': -->
<!-- the conditional header: only add this resource if
there isn't already one for this patient. If there is one,
the content of this resource will be ignored -->
<!-- actually, in a transaction, you don't specify the [base],
so [base]/Patient becomes just 'Patient': -->
<!-- actually, in a transaction, you don't specify the [base],
so [base]/Patient?params becomes just 'Patient?params': -->
<!-- actually, in a transaction, you don't specify the [base],
so [base]/Patient/234 becomes just 'Patient/234': -->
<!-- btw, couldn't re-use Patient/123 for the delete, since
the transaction couldn't do two different operations on the
same resource -->
<!-- actually, in a transaction, you don't specify the [base],
so [base]/Patient?params becomes just 'Patient?params': -->
<!-- can do more than just create/update/delete.
This is how to invoke an operation with a set of parameters -->
<!-- POST to [base]/ValueSet/$lookup - invoking a lookup operation (see Terminology Service)
-->
<!-- can also do read-only operations.
Note that these do not 'fail' - see discussion on transaction
atomicity for further information
-->
<?xml version="1.0" encoding="UTF-8"?>
<Bundle xmlns="http://hl7.org/fhir"> <id value="bundle-transaction"/> <meta> <lastUpdated value="2014-08-18T01:43:30Z"/> </meta> <type value="transaction"/> <entry> <fullUrl value="urn:uuid:61ebe359-bfdc-4613-8bf2-c5e300945f0a"/> <resource> <Patient> <text> <status value="generated"/> <div xmlns="http://www.w3.org/1999/xhtml">Some narrative</div> </text> <active value="true"/> <name> <use value="official"/> <family value="Chalmers"/> <given value="Peter"/> <given value="James"/> </name> <gender value="male"/> <birthDate value="1974-12-25"/> </Patient> </resource> <request> <method value="POST"/>
<url value="Patient"/> </request> </entry> <entry> <fullUrl value="urn:uuid:88f151c0-a954-468a-88bd-5ae15c08e059"/> <resource> <Patient> <text> <status value="generated"/> <div xmlns="http://www.w3.org/1999/xhtml">Some narrative</div> </text> <identifier> <system value="http:/example.org/fhir/ids"/> <value value="234234"/> </identifier> <active value="true"/> <name> <use value="official"/> <family value="Chalmers"/> <given value="Peter"/> <given value="James"/> </name> <gender value="male"/> <birthDate value="1974-12-25"/> </Patient> </resource> <request> <method value="POST"/>
<url value="Patient"/>
<ifNoneExist value="identifier=http:/example.org/fhir/ids|234234"/> </request> </entry> <entry> <fullUrl value="http://example.org/fhir/Patient/123"/> <resource> <Patient> <id value="123"/> <text> <status value="generated"/> <div xmlns="http://www.w3.org/1999/xhtml">Some narrative</div> </text> <active value="true"/> <name> <use value="official"/> <family value="Chalmers"/> <given value="Peter"/> <given value="James"/> </name> <gender value="male"/> <birthDate value="1974-12-25"/> </Patient> </resource> <request> <method value="PUT"/>
<url value="Patient/123"/> </request> </entry> <entry> <fullUrl value="urn:uuid:74891afc-ed52-42a2-bcd7-f13d9b60f096"/> <resource> <Patient> <text> <status value="generated"/> <div xmlns="http://www.w3.org/1999/xhtml">Some narrative</div> </text> <identifier> <system value="http:/example.org/fhir/ids"/> <value value="456456"/> </identifier> <active value="true"/> <name> <use value="official"/> <family value="Chalmers"/> <given value="Peter"/> <given value="James"/> </name> <gender value="male"/> <birthDate value="1974-12-25"/> </Patient> </resource> <request> <method value="PUT"/>
<url value="Patient?identifier=http:/example.org/fhir/ids|456456"/> </request> </entry> <entry> <fullUrl value="http://example.org/fhir/Patient/123a"/> <resource> <Patient> <id value="123a"/> <text> <status value="generated"/> <div xmlns="http://www.w3.org/1999/xhtml">Some narrative</div> </text> <active value="true"/> <name> <use value="official"/> <family value="Chalmers"/> <given value="Peter"/> <given value="James"/> </name> <gender value="male"/> <birthDate value="1974-12-25"/> </Patient> </resource> <request> <method value="PUT"/> <url value="Patient/123a"/> <ifMatch value="W/"2""/> </request> </entry> <entry> <request> <method value="DELETE"/>
<url value="Patient/234"/> </request> </entry> <entry> <request> <method value="DELETE"/>
<url value="Patient?identifier=123456"/> </request> </entry> <entry> <fullUrl value="urn:uuid:79378cb8-8f58-48e8-a5e8-60ac2755b674"/> <resource>
<Parameters> <parameter> <name value="coding"/> <valueCoding> <system value="http://loinc.org"/> <code value="1963-8"/> </valueCoding> </parameter> </Parameters> </resource> <request>
<method value="POST"/> <url value="http://hl7.org/fhir/ValueSet/$lookup"/> </request> </entry> <entry>
<request> <method value="GET"/> <url value="Patient?name=peter"/> </request> </entry> <entry> <request> <method value="GET"/> <url value="Patient/12334"/> <ifNoneMatch value="W/"4""/> <ifModifiedSince value="2015-08-31T08:14:33+10:00"/> </request> </entry>
</
Bundle
>
Usage
note:
every
effort
has
been
made
to
ensure
that
the
examples
are
correct
and
useful,
but
they
are
not
a
normative
part
of
the
specification.