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 |
|
|
Resource Type |
|
|
All Resources |
|
|
The result of 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.
resourceType: Bundletype: historytotal: 1entry:- resource:name:- family: Historyid: patient123resourceType: Patientmeta:lastUpdated: '2018-11-27T11:33:59.497Z'versionId: '54'tag:- system: https://aidbox.appcode: createdrequest:method: POSTurl: Patient
resourceType: Bundletype: historytotal: 2entry:- resource:name:- family: HistorybirthDate: '1967-03-14'id: patient123resourceType: Patientmeta:lastUpdated: '2018-11-27T21:58:51.396Z'versionId: '57'tag:- system: https://aidbox.appcode: updatedrequest:method: PUTurl: Patient- resource:name:- family: Historyid: patient123resourceType: Patientmeta:lastUpdated: '2018-11-27T11:33:59.497Z'versionId: '54'tag:- system: https://aidbox.appcode: createdrequest:method: POSTurl: Patient
resourceType: Bundletype: historytotal: 3entry:- resource:name:- family: HistorybirthDate: '1967-03-14'id: patient123resourceType: Patientmeta:lastUpdated: '2018-11-27T22:01:16.609Z'versionId: '58'tag:- system: https://aidbox.appcode: deletedrequest:method: DELETEurl: Patient- resource:name:- family: HistorybirthDate: '1967-03-14'id: patient123resourceType: Patientmeta:lastUpdated: '2018-11-27T21:58:51.396Z'versionId: '57'tag:- system: https://aidbox.appcode: updatedrequest:method: PUTurl: Patient- resource:name:- family: Historyid: patient123resourceType: Patientmeta:lastUpdated: '2018-11-27T11:33:59.497Z'versionId: '54'tag:- system: https://aidbox.appcode: createdrequest:method: POSTurl: Patient
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 |
{{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