-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathbundle.html
More file actions
775 lines (719 loc) · 60.8 KB
/
Copy pathbundle.html
File metadata and controls
775 lines (719 loc) · 60.8 KB
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
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
<!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://cdnjs.cloudflare.com/ajax/libs/material-design-lite/1.3.0/material.deep_purple-pink.min.css">
<link rel="stylesheet" href="styles.css">
<link rel="stylesheet" href="css/language-switcher.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 lang-en">
<!-- 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">
<span class="lang-content lang-en">FHIR<sup>®</sup> tutorials</span>
<span class="lang-content lang-ru">FHIR<sup>®</sup> уроки</span>
</span>
<nav class="mdl-navigation">
<a href="./index.html" class="mdl-navigation__link">
<span class="lang-content lang-en">Overview</span>
<span class="lang-content lang-ru">Обзор</span>
</a>
<a href="./simple-patient.html" id="simple-patient" class="mdl-navigation__link">
<span class="lang-content lang-en">Simple Patient</span>
<span class="lang-content lang-ru">Пациент </span>
</a>
<a href="./simple-search.html" id="simple-search" class="mdl-navigation__link">
<span class="lang-content lang-en">Simple Search</span>
<span class="lang-content lang-ru">Поиск</span>
</a>
<a href="./patient-with-references.html" id="patient-with-references" class="mdl-navigation__link">
<span class="lang-content lang-en">Patient with References</span>
<span class="lang-content lang-ru">Пациент со ссылками</span>
</a>
<a href="./bundle.html" id="bundle" class="mdl-navigation__link is-active-tab">
<span class="lang-content lang-en">Bundle</span>
<span class="lang-content lang-ru">Пакет</span>
</a>
<a href="./operations.html" id="operations" class="mdl-navigation__link">
<span class="lang-content lang-en">Operations</span>
<span class="lang-content lang-ru">Операции</span>
</a>
<a href="./ValueSet-And-CodeSystem.html" id="ValueSet-And-CodeSystem" class="mdl-navigation__link">
<span class="lang-content lang-en">ValueSet & CodeSystem</span>
<span class="lang-content lang-ru">ValueSet и CodeSystem</span>
</a>
<a href="./conceptmap.html" id="conceptmap" class="mdl-navigation__link">
<span class="lang-content lang-en">ConceptMap</span>
<span class="lang-content lang-ru">ConceptMap</span>
</a>
<a href="./fhir-api.html" id="conceptmap" class="mdl-navigation__link">
<span class="lang-content lang-en">FHIR APIs</span>
<span class="lang-content lang-ru">FHIR API</span>
</a>
<a href="#" class="mdl-navigation__link"></a>
<a href="./exercises.html" class="mdl-navigation__link">
<span class="lang-content lang-en">FHIR exercises</span>
<span class="lang-content lang-ru">FHIR упражнения</span>
</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">
<!-- English Content -->
<div class="lang-content lang-en">
<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/R4/bundle.html">Bundle</a> page, and on the <a href="http://hl7.org/fhir/R4/http.html#transaction">RESTful API</a> pages of the FHIR specification, with specific bundle types like transactions, 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 and the total amount of entries (some which may not be visible because of paging).</li>
<li>The <code>Bundle.link</code> element provides navigation links for the Bundle, including links to retrieve the Bundle later ("self"), paginate through results ("next", "previous", "first", "last"), or access related content. These links enable efficient navigation through large result sets and Bundle retrieval.</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 annotated example Bundle you'd receive from the server when searching:</p>
</div>
<!-- Russian Content -->
<div class="lang-content lang-ru">
<h4>Урок по Bundle (Пакетам)</h4>
<p>Bundle - это контейнер для ресурсов, позволяющий группировать и передавать ресурсы все сразу. Руководство по ресурсу в целом доступно на странице <a href="http://hl7.org/fhir/R4/bundle.html">Bundle</a>, а также на страницах <a href="http://hl7.org/fhir/R4/http.html#transaction">RESTful API</a> спецификации FHIR, при этом конкретные типы пакетов, такие как транзакции, сообщения и документы, имеют свою собственную документацию.</p>
<ul class="toc">
<h4>Содержание</h4>
<a href="#bn-about-bundle">Шаг 1: О Bundle</a>
<a href="#bn-paging">Шаг 2: Пагинация</a>
<a href="#bn-bundle-types">Шаг 3: Типы Bundle</a>
<a href="#bn-upload-endpoints">Шаг 4: Конечные точки загрузки</a>
<a href="#bn-reference-resolution">Шаг 5: Разрешение ссылок</a>
</ul>
<h5 id="bn-about-bundle">Шаг 1: О Bundle</h5>
<p>Мы упоминали в предыдущем <a href="patient-with-references.html#pr-observe-contained-references">уроке по ссылкам на ресурсы</a>, что ресурсы могут "содержать" другие ресурсы. Так чем же отличаются Bundle? Спецификация FHIR довольно полезна в этом отношении:</p>
<note><ul><li>Содержащиеся ресурсы находятся "внутри" контейнерного ресурса - они могут интерпретироваться и/или изменяться только в контексте контейнера</li>
<li>Bundle - это коллекция ресурсов, которые имеют независимое существование - например, к ним также можно получить прямой доступ с помощью RESTful API</li></ul></note>
<p>Таким образом, содержащиеся ресурсы нельзя получить, обновить или удалить отдельно с помощью GET, PUT и DELETE, или даже ссылаться на них индивидуально извне содержащего ресурса. Ресурсы внутри Bundle, в зависимости от типа Bundle и способа загрузки, создаются индивидуально на сервере и, таким образом, могут обрабатываться независимо.</p>
<p>Вот как выглядит общая структура bundle:</p>
<a href="images/bundle-explanation.png" data-lightbox="bundle-explanation"><img src="images/bundle-explanation.png"/></a>
<ol>
<li>Метаданные, описывающие тип Bundle и общее количество записей (некоторые из которых могут быть не видны из-за пагинации).</li>
<li>Элемент <code>Bundle.link</code> предоставляет навигационные ссылки для Bundle, включая ссылки для получения Bundle позже ("self"), для пагинации результатов ("next", "previous", "first", "last") или для доступа к связанному содержимому. Эти ссылки обеспечивают эффективную навигацию по большим наборам результатов и получение Bundle.</li>
<li>Суть ресурса, так сказать - здесь хранятся ресурсы, которые содержит Bundle. Вместе с ресурсами включены URL-адреса, которые можно использовать для получения ресурса индивидуально.</li>
<li>Используется при загрузке Bundle - здесь вы указываете серверу, что делать с каждым ресурсом.</li>
<li>Используется сервером при ответе на ваш запрос загрузки - здесь он сообщает, как прошла каждая операция.</li>
</ol>
<p>Вот аннотированный пример Bundle, который вы получили бы от сервера при поиске:</p>
</div>
<textarea class="fhir-resource-json">
{
"resourceType": "Bundle",
"id": "fdcc9869-0bd6-4422-876b-1d0b53a2db",
"meta": {
"lastUpdated": "2016-11-04T01:35:48Z"
},
// bundle type: this is from as a search result. See below on other bundle types
// тип пакета: это результат поиска. См. ниже для других типов пакетов.
"type": "searchset",
// if this is a search or history type, it'll also report how many resources matched in total.
// если это тип поиска или истории, также будет указано, сколько всего найдено ресурсов.
"total": 253,
"link": [
{
// a link to retrieve this bundle again later
// ссылка, чтобы получить этот пакет снова позже
"relation": "self",
"url": "http://fhir3.healthintersections.com.au/open/Patient?_format=application/fhir+json&search-id=d3479951-64ed-43de-a8f3-e6cd7ddb20&&_sort=_id"
},
{
// 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": "first",
"url": "http://fhir3.healthintersections.com.au/open/Patient?_format=application/fhir+json&search-id=d3479951-64ed-43de-a8f3-e6cd7ddb20&&_sort=_id&search-offset=0&_count=3"
},
{
// a link to the next page to get more search results
// ссылка на следующую страницу для получения дополнительных результатов поиска
"relation": "next",
"url": "http://fhir3.healthintersections.com.au/open/Patient?_format=application/fhir+json&search-id=d3479951-64ed-43de-a8f3-e6cd7ddb20&&_sort=_id&search-offset=3&_count=3"
},
{
// a link to the last page of search results
// ссылка на последнюю страницу результатов поиска
"relation": "last",
"url": "http://fhir3.healthintersections.com.au/open/Patient?_format=application/fhir+json&search-id=d3479951-64ed-43de-a8f3-e6cd7ddb20&&_sort=_id&search-offset=252&_count=3"
}
],
// 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": "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": {
"resourceType": "Patient",
"id": "1",
"meta": {
"versionId": "1",
"lastUpdated": "2016-11-03T06:01:40Z"
},
"text": {
"status": "generated",
"div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><h1>Eve Everywoman</h1></div>"
},
"active": true,
"name": [
{
"text": "Eve Everywoman",
"family": "Everywoman1",
"given": ["Eve"]
}
],
"telecom": [
{
"system": "phone",
"value": "555-555-2003",
"use": "work"
}
],
"gender": "female",
"birthDate": "1955-01-06",
"address": [
{
"use": "home",
"line": ["2222 Home Street"]
}
]
},
// 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": "match"
}
},
// similar layout as above entry
// аналогично как в записи выше
{
"fullUrl": "http://fhir3.healthintersections.com.au/open/Patient/10",
"resource": {
"resourceType": "Patient",
"id": "10",
"meta": {
"versionId": "1",
"lastUpdated": "2016-11-03T06:15:27Z"
},
"text": {
"status": "generated",
"div": "<div xmlns=\"http://www.w3.org/1999/xhtml\">Betterhalf, Boris. SSN: 444888888</div>"
},
"identifier": [
{
"type": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/v2-0203",
"code": "SS"
}
]
},
"system": "http://hl7.org/fhir/sid/us-ssn",
"value": "444888888"
}
],
"active": true,
"name": [
{
"use": "official",
"family": "Betterhalf",
"given": ["Boris"]
}
],
"telecom": [
{
"system": "phone",
"value": "555-555-2008",
"use": "work"
}
],
"gender": "male",
"address": [
{
"use": "home",
"line": ["2222 Home Street"]
}
],
"managingOrganization": {
"reference": "Organization/hl7"
}
},
"search": {
"mode": "match"
}
},
{
"fullUrl": "http://fhir3.healthintersections.com.au/open/Patient/100",
"resource": {
"resourceType": "Patient",
"id": "100",
"meta": {
"versionId": "1",
"lastUpdated": "2016-11-03T06:14:41Z"
},
"text": {
"status": "generated",
"div": "<div xmlns=\"http://www.w3.org/1999/xhtml\">Garrett, Gordon. MRN: 577419</div>"
},
"identifier": [
{
"type": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/v2-0203",
"code": "SS"
}
]
},
"system": "https://github.com/projectcypress/cypress/patient",
"value": "577419"
}
],
"active": true,
"name": [
{
"use": "official",
"family": "Garrett",
"given": ["Gordon"]
}
],
"gender": "male",
"birthDate": "1935-05-08",
"managingOrganization": {
"reference": "Organization/1"
}
},
"search": {
"mode": "match"
}
}
]
}
</textarea>
<!-- English Content Continues -->
<div class="lang-content lang-en">
<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>
</div>
<!-- Russian Content Continues -->
<div class="lang-content lang-ru">
<h5 id="bn-paging">Пагинация</h5>
<p>Когда Bundle слишком большой для отправки за один раз, поскольку он содержит много ресурсов, сервер может разбить его на части (называемые "страницами"). Чтобы позволить вам легко переходить от одной страницы к следующей, Bundle предоставляет ссылки на следующую страницу внутри себя. Таким образом, клиент, получив страницу, может запросить следующую страницу и так далее до конца. Кроме того, в каждом Bundle также предоставляются ссылки на предыдущую, первую и последнюю страницы (см. пример ниже):</p>
</div>
<textarea id="codesystem-1" class="fhir-resource-json">
// ... snipped ...
"link": [
{
"relation": "first",
"url": "http://example.org/Patient?name=peter&stateid=23&page=1"
},
{
"relation": "previous",
"url": "http://example.org/Patient?name=peter&stateid=23&page=2"
},
{
"relation": "next",
"url": "http://example.org/Patient?name=peter&stateid=23&page=4"
},
{
"relation": "last",
"url": "http://example.org/Patient?name=peter&stateid=23&page=26"
}
]
// ... snipped ...
</textarea>
<br>
<div class="lang-content lang-en">
<p>See <a href="http://hl7.org/fhir/R4/http.html#paging">more information on paging</a> on the FHIR spec.</p>
</div>
<div class="lang-content lang-ru">
<p>См. <a href="http://hl7.org/fhir/R4/http.html#paging">больше информации о пагинации</a> в спецификации FHIR.</p>
</div>
<div class="lang-content lang-en">
<h5 id="bn-bundle-types">Step 3: Bundle Types</h5>
<p>There are <a href="http://hl7.org/fhir/R4/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.</p>
</div>
<div class="lang-content lang-ru">
<h5 id="bn-bundle-types">Шаг 3: Типы Bundle</h5>
<p>FHIR определяет <a href="http://hl7.org/fhir/R4/valueset-bundle-type.html#expansion">несколько типов</a> Bundle: document, message, transaction, transaction-response, batch, batch-response, history, searchset и collection.</p>
</div>
<table class="table-fill">
<thead>
<tr>
<th class="text-left">
<span class="lang-content lang-en">Bundle type</span>
<span class="lang-content lang-ru">Тип Bundle</span>
</th>
<th class="text-left">
<span class="lang-content lang-en">Bundle description</span>
<span class="lang-content lang-ru">Описание Bundle</span>
</th>
</tr>
</thead>
<tbody class="table-hover">
<tr>
<td class="text-left">searchset</td>
<td class="text-left">
<span class="lang-content lang-en">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.</span>
<span class="lang-content lang-ru">Используется при поиске - операция, с которой вы уже знакомы - это Bundle, который объединяет результаты поиска в один ответ. Поскольку некоторые результаты поиска могут возвращать большое количество результатов, здесь появляется идея пагинации.</span>
</td>
</tr>
<tr>
<td class="text-left">document, message, collection</td>
<td class="text-left">
<span class="lang-content lang-en">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.</span>
<span class="lang-content lang-ru">Используются в специфических парадигмах обмена данными. Грубо говоря, можно думать о Bundle типа <i>document</i> как о представляющих CDA документ, Bundle типа <i>message</i> как о представляющих V2 сообщение, а <i>collection</i> как об общем универсальном типе.</span>
</td>
</tr>
<tr>
<td class="text-left">history</td>
<td class="text-left">
<span class="lang-content lang-en">Similar to searchset, but is specialised for the <a href="http://hl7.org/fhir/R4/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.</span>
<span class="lang-content lang-ru">Похож на searchset, но специализирован для операций <a href="http://hl7.org/fhir/R4/http.html#history">_history</a>, когда вы просматриваете историю операций над одним экземпляром ресурса. Например, просмотр всех изменений, внесенных в один ресурс Patient.</span>
</td>
</tr>
<tr>
<td class="text-left">batch, transaction</td>
<td class="text-left">
<span class="lang-content lang-en">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.</span>
<span class="lang-content lang-ru">Позволяет объединить несколько операций в одну - скажем, вы хотите загрузить 5 ресурсов, но не хотите делать это 5 раз. Вы можете собрать все ресурсы в bundle и загрузить все сразу. Разница между batch и transaction заключается в том, как обрабатываются ситуации при возникновении проблем. Когда одна из операций <i>transaction</i> терпит неудачу, вся транзакция терпит неудачу и никаких изменений на сервере в результате транзакции не происходит. Если одна из операций <i>batch</i> терпит неудачу, то остальные операции все еще могут завершиться успешно.</span>
</td>
</tr>
<tr>
<td class="text-left">batch-response, transaction-response</td>
<td class="text-left">
<span class="lang-content lang-en">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.</span>
<span class="lang-content lang-ru">То, чем сервер ответит, где он сообщает вам, что произошло с каждой операцией в вашем Bundle типа <i>batch</i> или <i>transaction</i>.</span>
</td>
</tr>
</tbody>
</table>
<div class="lang-content lang-en">
<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>
</div>
<div class="lang-content lang-ru">
<h5 id="bn-upload-endpoints">Шаг 4: Эндпоинты для загрузки</h5>
<p>Если вы загружаете Bundle в <code><b>[Service Root URL]/Bundle</b></code>, ваш Bundle будет сохранен как есть, как и любой другой ресурс. Иногда это желаемое поведение - но обычно вы хотите, чтобы сервер обработал Bundle. Например, чтобы транзакции в вашем transaction Bundle были выполнены. Чтобы заставить сервер распаковать и обработать ваш Bundle, вам нужно загрузить его непосредственно в <code><b>[Service Root URL]</b></code>. Это наиболее надежно работает для типов Bundle: transaction, batch и document. То, как сервер обрабатывает другие типы Bundle, зависит от него. Вот полный список конечных точек, в которые могут быть загружены Bundle:</p>
</div>
<table class="table-fill fixed">
<thead>
<tr>
<th class="text-left">
<span class="lang-content lang-en">Endpoint</span>
<span class="lang-content lang-ru">Конечная точка</span>
</th>
<th class="text-left">
<span class="lang-content lang-en">Bundle type</span>
<span class="lang-content lang-ru">Тип Bundle</span>
</th>
<th class="text-left">
<span class="lang-content lang-en">Effect on the Bundle</span>
<span class="lang-content lang-ru">Влияние на Bundle</span>
</th>
</tr>
</thead>
<tbody class="table-hover">
<tr>
<td class="text-left"><a href="http://hl7.org/fhir/R4/http.html#transaction"><code>[Service Root URL]</code></a></td>
<td class="text-left">batch, transaction</td>
<td class="text-left">
<span class="lang-content lang-en">Bundle is processed by the server - individual operations/resources are unpacked and acted upon.</span>
<span class="lang-content lang-ru">Bundle обрабатывается сервером - отдельные операции/ресурсы распаковываются и обрабатываются.</span>
</td>
</tr>
<tr>
<td class="text-left"><a href="http://hl7.org/fhir/R4/http.html#other-bundles"><code>[Service Root URL]</code></a></td>
<td class="text-left">history</td>
<td class="text-left">
<span class="lang-content lang-en">Bundle may be be processed by the server as its structure is very similar to batch/transaction type.</span>
<span class="lang-content lang-ru">Bundle может быть обработан сервером, поскольку его структура очень похожа на тип batch/transaction.</span>
</td>
</tr>
<tr>
<td class="text-left"><a href="http://hl7.org/fhir/R4/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">
<span class="lang-content lang-en">Bundle may be processed by the server as create/update operations.</span>
<span class="lang-content lang-ru">Bundle может быть обработан сервером как операции создания/обновления.</span>
</td>
</tr>
<tr>
<td class="text-left"><a href="http://hl7.org/fhir/R4/binary.html"><code>[Service Root URL]/Binary</code></a></td>
<td class="text-left">document</td>
<td class="text-left">
<span class="lang-content lang-en">Bundle is stored as-is by the server as binary content and not acted upon.</span>
<span class="lang-content lang-ru">Bundle сохраняется сервером как есть в виде двоичного содержимого и не обрабатывается.</span>
</td>
</tr>
<tr>
<td class="text-left"><a href="http://hl7.org/fhir/R4/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">
<span class="lang-content lang-en">Bundle is stored as-is by the server and not acted upon, same as if you uploaded a Patient resource.</span>
<span class="lang-content lang-ru">Bundle сохраняется сервером как есть и не обрабатывается, так же как если бы вы загрузили ресурс Patient.</span>
</td>
</tr>
<tr>
<td class="text-left"><a title="Asynchronous Messaging using the RESTful API" href="http://hl7.org/fhir/R4/messaging.html#rest"><code>[Service Root URL]/Bundle</code></a></td>
<td class="text-left">message</td>
<td class="text-left">
<span class="lang-content lang-en">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</span>
<span class="lang-content lang-ru">Bundle обрабатывается сервером - сервер сохранит Bundle как есть, проиндексирует его по MessageHeader и обработает сообщение. Это RESTful конечная точка для message Bundle</span>
</td>
</tr>
<tr>
<td class="text-left"><a href="http://hl7.org/fhir/R4/messaging.html#process"><code>[Service Root URL]/$process-message</code></a></td>
<td class="text-left">message</td>
<td class="text-left">
<span class="lang-content lang-en">Bundle is processed by the server as if it is a message.</span>
<span class="lang-content lang-ru">Bundle обрабатывается сервером как сообщение.</span>
</td>
</tr>
</tbody>
</table>
<div class="lang-content lang-en">
<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/R4/bundle.html#references">Resolving references in Bundles</a> </p>
<p>The table below describes the effect Bundle type can have on uploading Bundles:</p>
</div>
<div class="lang-content lang-ru">
<h5 id="bn-reference-resolution">Шаг 5: Разрешение ссылок</h5>
<p>Ссылки между ресурсами внутри Bundle могут быть двух типов. Либо ссылки на ресурсы, где каждый ресурс находится внутри Bundle, но еще не на сервере.</p>
<a href="images/BundleOutOfServer.PNG" data-lightbox="bundleOutOfServer"><img src="images/BundleOutOfServer.PNG" width="50%"/></a>
<p>Или ссылки от ресурсов в bundle на ресурсы, которые находятся на сервере, но не найдены в bundle.</p>
<a href="images/BundleInOfServer.PNG" data-lightbox="bundleOutOfServer"><img src="images/BundleInOfServer.PNG" width="50%"/></a>
<p>При загрузке bundle ресурсов на сервер, как в первом случае, может быть не совсем понятно, как формировать ссылку между ресурсами. Как можно ссылаться на ресурс, если сервер еще не назначил ему ID?</p>
<p>Ответ заключается в том, что создатель bundle может назначить временные ID ресурсов для создания ссылок между каждым ресурсом. Затем, в зависимости от способа загрузки Bundle на сервер, сервер может использовать ваши ID для понимания связи между ресурсами и назначит свои собственные серверные ID и обновит все существующие ссылки новыми ID. В этих случаях сервер затем ответит возвращаемым Bundle, который информирует отправителя об этих обновленных ID. Если вы вернетесь к изображению структуры Bundle в начале этой страницы, вы можете увидеть элемент '<code>Bundle/entry/response/location</code>', где эти новые ID будут возвращены как URI. Выполняет ли сервер эту идентификацию или нет, зависит от типа Bundle, который вы загружаете, и конечной точки, в которую вы его загружаете. Таблица ниже более подробно рассматривает этот момент.</p>
<p>В отличие от общих ресурсов, вам нужно быть осторожным при разрешении ссылок между ресурсами в Bundle, вы не можете просто предполагать, что ссылка указывает на ресурс на сервере, это может быть ссылка на ресурс внутри того же Bundle, и вы должны предполагать это в первую очередь. Для получения дополнительной информации по этой теме обратитесь к спецификации FHIR здесь: <a href="http://hl7.org/fhir/R4/bundle.html#references">Разрешение ссылок в Bundle</a></p>
<p>Таблица ниже описывает влияние, которое тип Bundle может оказать на загрузку Bundle:</p>
</div>
<table class="table-fill">
<thead>
<tr>
<th class="text-left">
<span class="lang-content lang-en">Bundle type</span>
<span class="lang-content lang-ru">Тип Bundle</span>
</th>
<th class="text-left">
<span class="lang-content lang-en">Effect on Bundle upload</span>
<span class="lang-content lang-ru">Влияние на загрузку Bundle</span>
</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">
<span class="lang-content lang-en">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/R4/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).</span>
<span class="lang-content lang-ru">Вы можете создать свои собственные ID для ресурсов и использовать их как ссылки для других ресурсов внутри Bundle. Document Bundle обычно сохраняется как есть на сервере, без распаковки - хотя если вы загружаете его в <code><b>[Service Root URL]</b></code> вместо <a href="http://hl7.org/fhir/R4/documents.html#bundle">обычных конечных точек</a>, то сервер может распаковать Bundle и заменить ваши назначенные ID ресурсов своими собственными (хотя он не обязан это делать).</span>
</td>
</tr>
<tr>
<td class="text-left">batch</td>
<td class="text-left">
<span class="lang-content lang-en">You cannot reference other resources inside the Bundle - thus all resources inside a batch Bundle must be completely independent, only reference resources already created on the server, or resources available on other servers.</span>
<span class="lang-content lang-ru">Вы не можете ссылаться на другие ресурсы внутри Bundle - таким образом, все ресурсы внутри batch Bundle должны быть полностью независимыми, ссылаться только на ресурсы, уже созданные на сервере, или ресурсы, доступные на других серверах.</span>
</td>
</tr>
<tr>
<td class="text-left">transaction</td>
<td class="text-left">
<span class="lang-content lang-en">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/R4/http.html#2.42.0.16.2">Transaction Processing Rules</a> for more.</span>
<span class="lang-content lang-ru">Вы можете ссылаться на другие ресурсы внутри Bundle, используя их бизнес-идентификаторы в упрощенном поисковом запросе. Затем сервер должен заменить поисковый запрос на ID ресурсов при обработке Bundle. См. раздел Условные ссылки в <a href="http://hl7.org/fhir/R4/http.html#2.42.0.16.2">Правилах обработки транзакций</a> для получения дополнительной информации.</span>
</td>
</tr>
<tr>
<td class="text-left">message</td>
<td class="text-left">
<span class="lang-content lang-en">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.</span>
<span class="lang-content lang-ru">Похоже на document - вы создаете свои собственные ID и используете их как ссылки внутри Bundle. В случае, если вы загружаете message Bundle в RESTful API на конечную точку <code><b>[Service Root URL]/Bundle</b></code> (вместо обычной <code>[Service Root URL]/Bundle/$process-message</code>), Bundle не распаковывается и индексируется только MessageHeader.</span>
</td>
</tr>
<tr>
<td class="text-left">collection, searchset, history</td>
<td class="text-left">
<span class="lang-content lang-en">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.</span>
<span class="lang-content lang-ru">Вы можете создать свои собственные ID для ресурсов и использовать их как ссылки внутри Bundle - хотя сервер, скорее всего, сохранит эти ресурсы как есть и не будет действовать на них, поскольку эти типы Bundle обычно предназначены для отправки серверами клиентам.</span>
</td>
</tr>
</tbody>
</table>
<br>
<div class="lang-content lang-en">
<p>That's about it for the difficult parts of a Bundle! Have a look at the <a href="http://hl7.org/fhir/R4/bundle.html">FHIR page for Bundle</a> now for things like uniqueness rules and search parameters of a Bundle.</p>
</div>
<div class="lang-content lang-ru">
<p>Это все о сложных частях Bundle! Теперь взгляните на <a href="http://hl7.org/fhir/R4/bundle.html">страницу FHIR для Bundle</a> для изучения таких вещей, как правила уникальности и параметры поиска Bundle.</p>
</div>
</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">
<span class="lang-content lang-en">The Agency</span>
<span class="lang-content lang-ru">Агентство</span>
</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">
<span class="lang-content lang-en">My Health Record</span>
<span class="lang-content lang-ru">Моя медицинская карта</span>
</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="https://confluence.hl7.org/spaces/FHIR/pages/391191767/2026-01+Connectathon+41" title="Virtual FHIR Connectathon, January 13-15, 2026">Connectathon 41</a></li>
<li><a href="http://hl7.org/fhir/R4" title="FHIR R4 Release">FHIR R4 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>
<!-- Language Selector -->
<div class="mdl-mega-footer--drop-down-section">
<input class="mdl-mega-footer--heading-checkbox" type="checkbox" checked>
<h1 class="mdl-mega-footer--heading">
<span class="lang-content lang-en">Language</span>
<span class="lang-content lang-ru">Язык</span>
</h1>
<div class="language-selector">
<select id="language-dropdown" class="lang-dropdown" onchange="switchLanguage(this.value)">
<option value="en">English</option>
<option value="ru" title="Russian language support for Central Asian countries adopting FHIR">Русский</option>
</select>
</div>
</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://cdnjs.cloudflare.com/ajax/libs/material-design-lite/1.3.0/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>
<script src="js/language-switcher.js"></script>
</body>
</html>