The pagination of response set
List of content:
Description:
Using the HTTP GET method without specifying the resource primary key could return a set of resources. In that case, the response is represented as FHIR Bundle resource.
The entire result set is split into the page (page number can be changed by using the query parameter i.e. page-offset=2
). The page size depends on module configuration (default value) or can be configured by the query parameter (i.e. _count=2
).
FHIR Resource:
https://www.hl7.org/fhir/STU3/bundle.html#Bundle.link
Fields meaning:
Field name | Description |
---|---|
entry | set of result FHIR resources |
total | the total number of resources |
link | set of links which can be used to change the result page (“Previous/Next” links) |
Query parameters:
Parameter name | Description | Example |
---|---|---|
_count | can be used to change the page size | _count=2 |
page-offset | can be used to choose a specific page | page-offset=2 |
Module configuration:
Configuration key | Description | Default value |
---|---|---|
default_response_page_size | default value which for page size | "default_response_page_size": 10, |
Example JSON representation of content:
Used HTTP operation: GET
Used URL: http://127.0.0.1:8000/api_fhir/Patient/?_count=2
{
"resourceType": "Bundle",
"entry": [
{
"fullUrl": "http://127.0.0.1:8000/api_fhir/Patient/4",
"resource": {
"resourceType": "Patient",
"address": [
{
"text": "address",
"type": "physical",
"use": "home"
},
{
"text": "geolocation",
"type": "both",
"use": "home"
}
],
"birthDate": "2000-01-02",
"gender": "female",
"id": 4,
"identifier": [
{
"type": {
"coding": [
{
"code": "ACSN",
"system": "https://hl7.org/fhir/valueset-identifier-type.html"
}
]
},
"use": "usual",
"value": "4"
},
{
"type": {
"coding": [
{
"code": "SB",
"system": "https://hl7.org/fhir/valueset-identifier-type.html"
}
]
},
"use": "usual",
"value": "chfid"
},
{
"type": {
"coding": [
{
"code": "PPN",
"system": "https://hl7.org/fhir/valueset-identifier-type.html"
}
]
},
"use": "usual",
"value": "passport"
}
],
"maritalStatus": {
"coding": [
{
"code": "U",
"system": "https://www.hl7.org/fhir/STU3/valueset-marital-status.html"
}
]
},
"name": [
{
"family": "test patient",
"given": [
"test patient"
],
"use": "usual"
}
],
"telecom": [
{
"system": "phone",
"use": "home",
"value": "phoneNum"
},
{
"system": "email",
"use": "home",
"value": "email@email.com"
}
]
}
},
{
"fullUrl": "http://127.0.0.1:8000/api_fhir/Patient/5",
"resource": {
"resourceType": "Patient",
"address": [
{
"text": "address",
"type": "physical",
"use": "home"
},
{
"text": "geolocation",
"type": "both",
"use": "home"
}
],
"birthDate": "2000-01-02",
"gender": "female",
"id": 5,
"identifier": [
{
"type": {
"coding": [
{
"code": "ACSN",
"system": "https://hl7.org/fhir/valueset-identifier-type.html"
}
]
},
"use": "usual",
"value": "5"
},
{
"type": {
"coding": [
{
"code": "SB",
"system": "https://hl7.org/fhir/valueset-identifier-type.html"
}
]
},
"use": "usual",
"value": "chfid"
},
{
"type": {
"coding": [
{
"code": "PPN",
"system": "https://hl7.org/fhir/valueset-identifier-type.html"
}
]
},
"use": "usual",
"value": "passport"
}
],
"maritalStatus": {
"coding": [
{
"code": "U",
"system": "https://www.hl7.org/fhir/STU3/valueset-marital-status.html"
}
]
},
"name": [
{
"family": "test patient",
"given": [
"test patient"
],
"use": "usual"
}
],
"telecom": [
{
"system": "phone",
"use": "home",
"value": "phoneNum"
},
{
"system": "email",
"use": "home",
"value": "email@email.com"
}
]
}
}
],
"link": [
{
"relation": "self",
"url": "http://127.0.0.1:8000/api_fhir/Patient/?_count=2"
},
{
"relation": "next",
"url": "http://127.0.0.1:8000/api_fhir/Patient/?_count=2&page-offset=2"
}
],
"total": 9,
"type": "searchset"
}
Did you encounter a problem or do you have a suggestion?
Please contact our Service Desk
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. https://creativecommons.org/licenses/by-sa/4.0/