-
Notifications
You must be signed in to change notification settings - Fork 8
/
bundle.html
537 lines (487 loc) · 31.1 KB
/
bundle.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
<!doctype html>
<!--
FHIR Drills
Copyright 2016 Australian Digital Health Agency. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License
-->
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="description" content="FHIR Tutorials by the Australian Digital Health Agency to help you understand FHIR and its spec! No technical experience required.">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
<title>Bundle | FHIR® tutorials</title>
<!-- Add to homescreen for Chrome on Android -->
<!-- <meta name="mobile-web-app-capable" content="yes">
<link rel="icon" sizes="192x192" href="images/android-desktop.png"> -->
<!-- Add to homescreen for Safari on iOS -->
<!-- <meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-title" content="Material Design Lite">
<link rel="apple-touch-icon-precomposed" href="images/ios-desktop.png"> -->
<!-- Tile icon for Win8 (144x144 + tile color) -->
<!-- <meta name="msapplication-TileImage" content="images/touch/ms-touch-icon-144x144-precomposed.png">
<meta name="msapplication-TileColor" content="#3372DF"> -->
<link rel="shortcut icon" href="images/favicon.ico">
<!-- SEO: If your mobile URL is different from the desktop URL, add a canonical link to the desktop page https://developers.google.com/webmasters/smartphone-sites/feature-phones -->
<!--
<link rel="canonical" href="http://www.example.com/">
-->
<!-- CodeMirror -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.13.4/codemirror.min.css"></link>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:regular,bold,italic,thin,light,bolditalic,black,medium&lang=en">
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel="stylesheet" href="https://code.getmdl.io/1.1.3/material.deep_purple-pink.min.css">
<link rel="stylesheet" href="styles.css">
<style>
#view-source {
position: fixed;
display: block;
right: 0;
bottom: 0;
margin-right: 40px;
margin-bottom: 40px;
z-index: 900;
}
</style>
<link href="css/lightbox.min.css" rel="stylesheet">
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-80290058-1', 'auto');
ga('send', 'pageview');
</script>
</head>
<body class="mdl-demo mdl-color--grey-100 mdl-color-text--grey-700 mdl-base">
<!-- The drawer is always open in large screens. The header is always shown,
even in small screens. -->
<div class="mdl-layout mdl-js-layout mdl-layout--fixed-drawer
mdl-layout--fixed-header">
<header class="mdl-layout__header">
<div class="mdl-layout__header-row">
<div class="mdl-layout-spacer"></div>
<div class="mdl-textfield mdl-js-textfield mdl-textfield--expandable
mdl-textfield--floating-label mdl-textfield--align-right">
<label class="mdl-button mdl-js-button mdl-button--icon"
for="fixed-header-drawer-exp">
<i class="material-icons">search</i>
</label>
<div class="mdl-textfield__expandable-holder">
<input class="mdl-textfield__input" type="text" name="sample"
id="fixed-header-drawer-exp">
</div>
</div>
</div>
</header>
<div class="mdl-layout__drawer">
<span class="mdl-layout-title">FHIR<sup>®</sup> tutorials</span>
<nav class="mdl-navigation">
<a href="./index.html" class="mdl-navigation__link">Overview</a>
<a href="./simple-patient.html" id="simple-patient" class="mdl-navigation__link">Simple Patient</a>
<a href="./simple-search.html" id="simple-search" class="mdl-navigation__link">Simple Search</a>
<a href="./patient-with-references.html" id="patient-with-references" class="mdl-navigation__link">Patient with References</a>
<a href="./bundle.html" id="bundle" class="mdl-navigation__link is-active-tab">Bundle</a>
<a href="./operations.html" id="operations" class="mdl-navigation__link">Operations</a>
<a href="./ValueSet-And-CodeSystem.html" id="ValueSet-And-CodeSystem" class="mdl-navigation__link">ValueSet & CodeSystem</a>
<a href="./conceptmap.html" id="conceptmap" class="mdl-navigation__link">ConceptMap</a>
<a href="./fhir-api.html" id="conceptmap" class="mdl-navigation__link">FHIR APIs</a>
<a href="#" class="mdl-navigation__link"></a>
<a href="./exercises.html" class="mdl-navigation__link">FHIR exercises</a>
</nav>
</div>
<main class="mdl-layout__content">
<section class="section--center mdl-grid mdl-grid--no-spacing mdl-shadow--2dp">
<div class="mdl-card mdl-cell mdl-cell--12-col-desktop mdl-cell--6-col-tablet mdl-cell--4-col-phone">
<div class="mdl-card__supporting-text">
<h4>Bundle tutorial</h4>
<p>Bundle is a container for resources, enabling you to group and transmit resources altogether at once. Guidance on the resource in general is available on the <a href="http://hl7.org/fhir/STU3/bundle.html">Bundle</a> page, and on the <a href="http://hl7.org/fhir/STU3/http.html#transaction">RESTful API</a> pages of the FHIR specification, with specific bundle types like transations, messaging and documents having their own documentation.</p>
<ul class="toc">
<h4>Contents</h4>
<!-- pr prefix stands for 'patient references'-->
<a href="#bn-about-bundle">Step 1: About Bundle</a>
<a href="#bn-paging">Step 2: Paging</a>
<a href="#bn-bundle-types">Step 3: Bundle types</a>
<a href="#bn-upload-endpoints">Step 4: Upload endpoints</a>
<a href="#bn-reference-resolution">Step 5: Reference resolution</a>
</ul>
<h5 id="bn-about-bundle">Step 1: About Bundle</h5>
<p>We've mentioned in the previous <a href="patient-with-references.html#pr-observe-contained-references">tutorial on resource references</a> that resources can "contain" other resources. So how are Bundles different? The FHIR spec is quite helpful in this regard:</p>
<note><ul><li>Contained resources are "in" the container resource - they can only ever be interpreted and/or changed in the context of the container</li>
<li>A Bundle is a collection of resources that have an independent existence - for example, they can also be accessed directly using the RESTful API</li></ul></note>
<p>So, contained resources cannot be GET'd, PUT'd and DELETE'd separately, or even referenced individually from outside the containing resource. Resources inside a Bundle, depending on your Bundle type and how you've uploaded it, do get created individually on the server and thus can be acted on independently.</p>
<p>Here is how the general layout of a bundle looks like:</p>
<a href="images/bundle-explanation.png" data-lightbox="bundle-explanation"><img src="images/bundle-explanation.png"/></a>
<ol>
<li>Metadata describing the Bundle type, the total amount of entries (some which may not be visible because of paging), and a link if you need to retrieve this Bundle later.</li>
<li>The meat of the resource, so to speak - this is where the resources that the Bundle has are stored. Included with resources are URLs which you can use to retrieve the resource individually.</li>
<li>Used when you're uploading Bundles - this is where you specify to the server what to do with each resource.</li>
<li>Used by the server when it's responding to your upload request - this is where it says how each operation went.</li>
</ol>
<p>Here's an annoted example Bundle you'd receive from the server when searching:</p>
<textarea class="fhir-resource-xml">
<Bundle xmlns="http://hl7.org/fhir">
<id value="fdcc9869-0bd6-4422-876b-1d0b53a2db"/>
<meta>
<lastUpdated value="2016-11-04T01:35:48Z"/>
</meta>
<!-- bundle type: this is from as a search result. See below on other
bundle types -->
<type value="searchset"/>
<!-- if this is a search or history type, it'll also report how many
resources matched in total. note that not all of them might
fit into one bundle -->
<total value="253"/>
<link>
<!-- a link to retrieve this exact bundle again later -->
<relation value="self"/>
<url value="http://fhir3.healthintersections.com.au/open/Patient?_format=text/xml+fhir&search-id=d3479951-64ed-43de-a8f3-e6cd7ddb20&&_sort=_id"/>
</link>
<link>
<!-- a link to the first 'page' of the bundle to get more resources
that didn't fit in this bundle - see below for how
pagination works -->
<relation value="first"/>
<url value="http://fhir3.healthintersections.com.au/open/Patient?_format=text/xml+fhir&search-id=d3479951-64ed-43de-a8f3-e6cd7ddb20&&_sort=_id&search-offset=0&_count=3"/>
</link>
<link>
<!-- a link to the next page to get more search results -->
<relation value="next"/>
<url value="http://fhir3.healthintersections.com.au/open/Patient?_format=text/xml+fhir&search-id=d3479951-64ed-43de-a8f3-e6cd7ddb20&&_sort=_id&search-offset=3&_count=3"/>
</link>
<link>
<!-- a link to the last page of search results -->
<relation value="last"/>
<url value="http://fhir3.healthintersections.com.au/open/Patient?_format=text/xml+fhir&search-id=d3479951-64ed-43de-a8f3-e6cd7ddb20&&_sort=_id&search-offset=252&_count=3"/>
</link>
<!-- the bundle will have many entries, each entry containing a found
resource and some other data related to it -->
<entry>
<!-- a direct link to access this resource on its own, outside
of the bundle -->
<fullUrl value="http://fhir3.healthintersections.com.au/open/Patient/1"/>
<!-- resource itself in full - nothing is different about being
in a bundle compared to just retrieving it directly -->
<resource>
<Patient xmlns="http://hl7.org/fhir">
<id value="1"/>
<meta>
<versionId value="1"/>
<lastUpdated value="2016-11-03T06:01:40Z"/>
</meta>
<text>
<status value="generated"/>
<div xmlns="http://www.w3.org/1999/xhtml">
<h1>Eve Everywoman</h1>
</div>
</text>
<active value="true"/>
<name>
<text value="Eve Everywoman"/>
<family value="Everywoman1"/>
<given value="Eve"/>
</name>
<telecom>
<system value="phone"/>
<value value="555-555-2003"/>
<use value="work"/>
</telecom>
<gender value="female"/>
<birthDate value="1955-01-06"/>
<address>
<use value="home"/>
<line value="2222 Home Street"/>
</address>
</Patient>
</resource>
<!-- reason why this resource is included in search results. In this
case, because it matched the search query. Resources can also be
included because they were included by a matching resource -->
<search>
<mode value="match"/>
</search>
</entry>
<!-- similar layout as above entry -->
<entry>
<fullUrl value="http://fhir3.healthintersections.com.au/open/Patient/10"/>
<resource>
<Patient xmlns="http://hl7.org/fhir">
<id value="10"/>
<meta>
<versionId value="1"/>
<lastUpdated value="2016-11-03T06:15:27Z"/>
</meta>
<text>
<status value="generated"/>
<div xmlns="http://www.w3.org/1999/xhtml">Betterhalf, Boris. SSN: 444888888</div>
</text>
<identifier>
<type>
<coding>
<system value="http://hl7.org/fhir/v2/0203"/>
<code value="SS"/>
</coding>
</type>
<system value="http://hl7.org/fhir/sid/us-ssn"/>
<value value="444888888"/>
</identifier>
<active value="true"/>
<name>
<use value="official"/>
<family value="Betterhalf"/>
<given value="Boris"/>
</name>
<telecom>
<system value="phone"/>
<value value="555-555-2008"/>
<use value="work"/>
</telecom>
<gender value="male"/>
<address>
<use value="home"/>
<line value="2222 Home Street"/>
</address>
<managingOrganization>
<reference value="Organization/hl7"/>
</managingOrganization>
</Patient>
</resource>
<search>
<mode value="match"/>
</search>
</entry>
<entry>
<fullUrl value="http://fhir3.healthintersections.com.au/open/Patient/100"/>
<resource>
<Patient xmlns="http://hl7.org/fhir">
<id value="100"/>
<meta>
<versionId value="1"/>
<lastUpdated value="2016-11-03T06:14:41Z"/>
</meta>
<text>
<status value="generated"/>
<div xmlns="http://www.w3.org/1999/xhtml">Garrett, Gordon. MRN: 577419</div>
</text>
<identifier>
<type>
<coding>
<system value="http://hl7.org/fhir/v2/0203"/>
<code value="SS"/>
</coding>
</type>
<system value="https://github.com/projectcypress/cypress/patient"/>
<value value="577419"/>
</identifier>
<active value="true"/>
<name>
<use value="official"/>
<family value="Garrett"/>
<given value="Gordon"/>
</name>
<gender value="male"/>
<birthDate value="1935-05-08"/>
<managingOrganization>
<reference value="Organization/1"/>
</managingOrganization>
</Patient>
</resource>
<search>
<mode value="match"/>
</search>
</entry>
</Bundle></textarea>
<h5 id="bn-paging">Paging</h5>
<p>When the Bundle is too big to send in one go, because it has many resources within it, the server can choose to break it up into pieces (called "pages"). To allow you to easy navigate from one page to the next the Bundle provides links to the next page within it. So the client, after getting a page, can request the next page and so on until the end. In addition, there are also links to the previous, first, and last pages provided in each Bundle (see the example below):</p>
<textarea id="codesystem-1" class="fhir-resource-xml">
<!-- ... snipped ... -->
<link>
<relation value="first"/>
<url value="http://example.org/Patient?name=peter&stateid=23&page=1"/>
</link>
<link>
<relation value="previous"/>
<url value="http://example.org/Patient?name=peter&stateid=23&page=2"/>
</link>
<link>
<relation value="next"/>
<url value="http://example.org/Patient?name=peter&stateid=23&page=4"/>
</link>
<link>
<relation value="last"/>
<url value="http://example.org/Patient?name=peter&stateid=23&page=26"/>
</link>
<!-- ... snipped ... -->
</textarea>
<br>
<p>See <a href="http://hl7.org/fhir/STU3/http.html#paging">more information on paging</a> on the FHIR spec.</p>
<h5 id="bn-bundle-types">Step 3: Bundle Types</h5>
<p>There are <a href="http://hl7.org/fhir/STU3/valueset-bundle-type.html#expansion">several types</a> of Bundles defined by FHIR: document, message, transaction, transaction-response, batch, batch-response, history, searchset, and collection.
<table class="table-fill">
<thead>
<tr>
<th class="text-left">Bundle type</th>
<th class="text-left">Bundle description</th>
</tr>
</thead>
<tbody class="table-hover">
<tr>
<td class="text-left">searchset</td>
<td class="text-left">Used in searching - an operation you're already familiar with - it's the Bundle that collates search results into a single response. As some search results can return a large number of results, this is where the idea of <a href="#bn-paging">paging</a> comes in.</td>
</tr>
<tr>
<td class="text-left">document, message, collection</td>
<td class="text-left">Used in specific data exchange paradigms. Loosely speaking, you can think of <i>document</i>-type Bundles as those representing a CDA document, a <i>message</i>-type Bundle representing a V2 message, and a <i>collection</i> as a general catch-all type.</td>
</tr>
<tr>
<td class="text-left">history</td>
<td class="text-left">Similar to searchset, but is specialised for the <a href="http://hl7.org/fhir/STU3/http.html#history">_history</a> operations when you're looking at the history of operations on single instance of a resource. For example, looking at all the edits made to a single Patient resource.</td>
</tr>
<tr>
<td class="text-left">batch, transaction</td>
<td class="text-left">Allows you to condense multiple operations into one - say you'd like to upload 5 resources but don't want to do it 5 times. You can gather all of the resources up into a bundle and upload it all at once. The difference between a batch and a transaction is how things are handled when an issue happens. When one of the operations of a <i>transaction</i> fails, the entire transaction fails and no changes happen on the server as a result of the transaction. If one of the operations of a <i>batch</i> fails, then the rest of the operations can still complete successfully.</td>
</tr>
<tr>
<td class="text-left">batch-response, transaction-response</td>
<td class="text-left">What the server will respond with where it tells you what happened with each operation within your <i>batch</i> or <i>transaction</i> Bundle.</td>
</tr>
</tbody>
</table>
<h5 id="bn-upload-endpoints">Step 4: Upload endpoints</h5>
<p>If you upload a Bundle to <code><b>[Service Root URL]/Bundle</b></code>, your Bundle will be stored as-is, just like any other resource. Sometimes this is the desired behaviour, alternatively, you may like the server to actually process the Bundle. For example, the transactions in your transaction Bundle to actually be acted upon. In order to get the server to unpack and process your Bundle, you need to upload to the <code><b>[Service Root URL]</b></code> directly. This most reliably works for transaction, batch, and document Bundle types. How the server deals with other Bundle types is up to it. Here is a complete list of endpoints that Bundles may be uploaded to:</p>
<table class="table-fill fixed">
<thead>
<tr>
<th class="text-left">Endpoint</th>
<th class="text-left">Bundle type</th>
<th class="text-left">Effect on the Bundle</th>
</tr>
</thead>
<tbody class="table-hover">
<tr>
<td class="text-left"><a href="http://hl7.org/fhir/STU3/http.html#transaction"><code>[Service Root URL]</code></a></td>
<td class="text-left">batch, transaction</td>
<td class="text-left">Bundle is processed by the server - individual operations/resources are unpacked and acted upon.</td>
</tr>
<tr>
<td class="text-left"><a href="http://hl7.org/fhir/STU3/http.html#other-bundles"><code>[Service Root URL]</code></a></td>
<td class="text-left">history</td>
<td class="text-left">Bundle may be be processed by the server as its structure is very similar to batch/transaction type.</td>
</tr>
<tr>
<td class="text-left"><a href="http://hl7.org/fhir/STU3/http.html#other-bundles"><code>[Service Root URL]</code></a></td>
<td class="text-left">document, message, transaction-response, batch-response, history, searchset, collection</td>
<td class="text-left">Bundle may be processed by the server as create/update operations.</td>
</tr>
<tr>
<td class="text-left"><a href="http://hl7.org/fhir/STU3/binary.html"><code>[Service Root URL]/Binary</code></a></td>
<td class="text-left">document</td>
<td class="text-left">Bundle is stored as-is by the server as binary content and not acted upon.</td>
</tr>
<tr>
<td class="text-left"><a href="http://hl7.org/fhir/STU3/bundle.html"><code>[Service Root URL]/Bundle</code></a></td>
<td class="text-left">document, transaction, transaction-response, batch, batch-response, history, searchset, and collection</td>
<td class="text-left">Bundle is stored as-is by the server and not acted upon, same as if you uploaded a Patient resource.</td>
</tr>
<tr>
<td class="text-left"><a title="Asynchronous Messaging using the RESTful API" href="http://hl7.org/fhir/STU3/messaging.html#rest"><code>[Service Root URL]/Bundle</code></a></td>
<td class="text-left">message</td>
<td class="text-left">Bundle is processed by the server - server will store the Bundle as-is, index it on the MessageHeader, and act on the message. This is the RESTful endpoint for a message Bundle</td>
</tr>
<tr>
<td class="text-left"><a href="http://hl7.org/fhir/STU3/messaging.html#process"><code>[Service Root URL]/$process-message</code></a></td>
<td class="text-left">message</td>
<td class="text-left">Bundle is processed by the server as if it is a message.</td>
</tr>
</tbody>
</table>
<h5 id="bn-reference-resolution">Step 5: Reference resolution</h5>
<p>References between resources within a Bundle can come in two types. Either references to resources where each resource is within the Bundle but not as yet on the server.</p>
<a href="images/BundleOutOfServer.PNG" data-lightbox="bundleOutOfServer"><img src="images/BundleOutOfServer.PNG" width="50%"/></a>
<p>Or references from resources in the bundle to resources that are on the server but not found in the bundle.</p>
<a href="images/BundleInOfServer.PNG" data-lightbox="bundleOutOfServer"><img src="images/BundleInOfServer.PNG" width="50%"/></a>
<p>When uploading a bundle of resources to a server, as in the first case, it can be a little confusing to understand how to form the reference between the resources. How can you reference a resource if the server has not as yet assigned an ID to it?</p>
<p>The simple answer is that the bundle creator can assign temporary resource IDs to resources in order to create the references between each resource. Then depending on the way you upload the Bundle to the server the server can use your IDs to understand the linkage between resources and will assign its own server IDs and update all the existing references with the new IDs. In these cases, the server will then reply with a return Bundle that informs the sender of these updated IDs. If you refer back the Bundle layout image at the beginning of this page you can see the '<code>Bundle/entry/response/location</code>' element where these new IDs would be returned as a URI. Whether the server performs this identification or not is dependant on the Bundle type you are uploading and the endpoint you are uploading it to. The table below talks more to this point.</p>
<p>Unlike general resources you need to take care when resolving references between resources in Bundles, you can not just assume the reference is to a resource on a server, it may be a reference to a resource within the same Bundle and you should assume this first. For more on this topic refer to the FHIR specification here:<a href="http://hl7.org/fhir/STU3/bundle.html#references">Resolving references in Bundles</a> </p>
<p>The table below describes the effect Bundle type can have on uploading Bundles:</p>
<table class="table-fill">
<thead>
<tr>
<th class="text-left">Bundle type</th>
<th class="text-left">Effect on Bundle upload</th>
</tr>
</thead>
<tbody class="table-hover">
<tr>
<td class="text-left">document</td>
<!-- GG's response on server replacing IDs: https://chat.fhir.org/#narrow/stream/implementers/subject/Document.20references -->
<td class="text-left">You can create your own IDs for resources and use them as references for other resources within the Bundle. A document Bundle typically is stored as-is on the server, without it getting unpacked - although if you upload it to the <code><b>[Service Root URL]</b></code> instead of the <a href="http://hl7.org/fhir/STU3/documents.html#bundle">usual endpoints</a> then it will be up to the server to unpack the Bundle and replace your assigned resource ID's with its own (though it doesn't have to).</td>
</tr>
<tr>
<td class="text-left">batch</td>
<td class="text-left">You cannot reference other resources inside the Bundle - thus all resources inside a batch Bundle must be completely independant, only reference resources already created on the server, or resources available on other servers.</td>
</tr>
<tr>
<td class="text-left">transaction</td>
<td class="text-left">You can reference other resources inside the Bundle using their business identifiers in a simplified search query. It is then on the server to replace the search query with the resource ID's when processing the Bundle. See Conditional References section of <a href="http://hl7.org/fhir/STU3/http.html#2.42.0.16.2">Transaction Processing Rules</a> for more.</td>
</tr>
<tr>
<td class="text-left">message</td>
<td class="text-left">Similar to document - you create your own IDs and use those as references within the Bundle. In the event that you upload a message Bundle to the RESTful API on the <code><b>[Service Root URL]/Bundle</b></code> endpoint (instead of the usual <code>[Service Root URL]/Bundle/$process-message</code>), the Bundle is not unpacked and only the MessageHeader is indexed.</td>
</tr>
<tr>
<td class="text-left">collection, searchset, history</td>
<td class="text-left">You can create your own IDs for resources and use them as references within the Bundle - although the server will most likely store these resources as-is and not act on them, since these types of Bundles are typically for servers to send to clients.</td>
</tr>
</tbody>
</table>
<br>
<p>That's about it for the difficult parts of a Bundle! Have a look at the <a href="http://hl7.org/fhir/STU3/bundle.html">FHIR page for Bundle</a> now for things like uniqueness rules and search parameters of a Bundle.</p>
</div>
</div>
</section>
<footer class="mdl-mega-footer">
<div class="mdl-mega-footer--middle-section">
<div class="mdl-mega-footer--drop-down-section">
<input class="mdl-mega-footer--heading-checkbox" type="checkbox" checked>
<h1 class="mdl-mega-footer--heading">The Agency</h1>
<ul class="mdl-mega-footer--link-list">
<li><a href="https://www.digitalhealth.gov.au/">digitalhealth.gov.au</a></li>
<li><a href="https://myhealthrecord.gov.au/internet/mhr/publishing.nsf/content/home" title="Australian national health record">My Health Record</a></li>
</ul>
</div>
<div class="mdl-mega-footer--drop-down-section">
<input class="mdl-mega-footer--heading-checkbox" type="checkbox" checked>
<h1 class="mdl-mega-footer--heading">FHIR</h1>
<ul class="mdl-mega-footer--link-list">
<li><a href="http://wiki.hl7.org/index.php?title=FHIR_Connectathon_15" title="Next FHIR get-together in Madrid in May 2017">Connectathon 15</a></li>
<li><a href="http://hl7.org/fhir/STU3" title="Latest release of FHIR, for use in Madrid Connectathon">FHIR STU3 Release</a></li>
<li><a href="http://build.fhir.org/" title="The latest FHIR as it is in development">FHIR Continuous Integration Build</a></li>
</ul>
</div>
</div>
</footer>
</main>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.13.4/codemirror.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.13.4/mode/xml/xml.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.14.2/mode/javascript/javascript.min.js"></script>
<script src="https://code.getmdl.io/1.1.3/material.min.js"></script>
<script src="js/lightbox-plus-jquery.min.js"></script>
<!-- lua.vm.js -->
<script src="js/lua.vm.js/dist/lua.vm.js"></script>
<!-- main javascript for this page-->
<script src="js/main.js"></script>
<!-- supporting javascript to actually do the uploading -->
<script src="js/post-resources.js"></script>
</body>
</html>