History
History operation

Overview

The history operation retrieves the history of either a particular resource, all resources of a given type, or all resources supported by the system. The operation is performed by HTTP GET command. See the FHIR documentation http://hl7.org/fhir/http.html#history for more details.
All sample requests are available in the Postman collection:
Operation Scope
Request
Aidbox
Specific Resource
GET /<RESOURCE_TYPE>/<ID>/_history{?[parameters]&_format=[mime-type]}
Supported
Resource Type
GET /<RESOURCE_TYPE>/_history{?[parameters]&_format=[mime-type]}
Supported
All Resources
GET /_history{?[parameters]&_format=[mime-type]}
Not Supported
The result of the history operation is a Bundle with type history containing the specified version history, sorted with newest versions first, and including deleted resources.
The request element provides information about the interaction that occurred and caused the new version of the resource.
Only operations create, update, and delete create history entries. Conditional creates, updates and deletes are converted to direct updates and deletes in a history list.

Example of the create (POST, PUT) operation in history:

1
resourceType: Bundle
2
type: history
3
total: 1
4
entry:
5
- resource:
6
name:
7
- family: History
8
id: patient123
9
resourceType: Patient
10
meta:
11
lastUpdated: '2018-11-27T11:33:59.497Z'
12
versionId: '54'
13
tag:
14
- system: https://aidbox.app
15
code: created
16
request:
17
method: POST
18
url: Patient
Copied!

Example of the update (PUT, PATCH) operation in history:

1
resourceType: Bundle
2
type: history
3
total: 2
4
entry:
5
- resource:
6
name:
7
- family: History
8
birthDate: '1967-03-14'
9
id: patient123
10
resourceType: Patient
11
meta:
12
lastUpdated: '2018-11-27T21:58:51.396Z'
13
versionId: '57'
14
tag:
15
- system: https://aidbox.app
16
code: updated
17
request:
18
method: PUT
19
url: Patient
20
- resource:
21
name:
22
- family: History
23
id: patient123
24
resourceType: Patient
25
meta:
26
lastUpdated: '2018-11-27T11:33:59.497Z'
27
versionId: '54'
28
tag:
29
- system: https://aidbox.app
30
code: created
31
request:
32
method: POST
33
url: Patient
Copied!

Example of the delete (DELETE) operation in history:

1
resourceType: Bundle
2
type: history
3
total: 3
4
entry:
5
- resource:
6
name:
7
- family: History
8
birthDate: '1967-03-14'
9
id: patient123
10
resourceType: Patient
11
meta:
12
lastUpdated: '2018-11-27T22:01:16.609Z'
13
versionId: '58'
14
tag:
15
- system: https://aidbox.app
16
code: deleted
17
request:
18
method: DELETE
19
url: Patient
20
- resource:
21
name:
22
- family: History
23
birthDate: '1967-03-14'
24
id: patient123
25
resourceType: Patient
26
meta:
27
lastUpdated: '2018-11-27T21:58:51.396Z'
28
versionId: '57'
29
tag:
30
- system: https://aidbox.app
31
code: updated
32
request:
33
method: PUT
34
url: Patient
35
- resource:
36
name:
37
- family: History
38
id: patient123
39
resourceType: Patient
40
meta:
41
lastUpdated: '2018-11-27T11:33:59.497Z'
42
versionId: '54'
43
tag:
44
- system: https://aidbox.app
45
code: created
46
request:
47
method: POST
48
url: Patient
Copied!

History Parameters

The parameters to the history interaction may include:
Parameter
Type
Description
_count
integer
Number of return records requested. The server is not bound to return the number requested, but cannot return more.
_txid
integer
Logical transaction id (aidbox logical clock)
_since
instant
Only include resource versions that were created at or after the given instant in time.
_at
date
Only include resource versions that were current at some point during the time period specified in the date time value (may be more than one).
_format
enum
Result format: yaml, json, xml, edn, transit

Examples of the history requests with parameters:

{{base}}/Patient/_history?_count=3
{{base}}/Patient/_history?_since=2018-11-27T22:00:16.609Z
{{base}}/Patient/_history?_at=2018-11-27
{{base}}/Patient/_history?_format=yaml
Last modified 8mo ago