GET method to filter resource records that meet specified conditions for dates, years, time ranges, or update times.Parameter Name | Type | Required | Description |
HTTP Method | String | Yes | Fixed as GET. |
URL | String | Yes | The search address, in the format [baseUrl]/[resourceType]?[searchParams]. |
Authorization | String | Yes | The access token, in the format Bearer <AccessToken>. For details on how to obtain it, see Calling Method. |
Accept | String | No | The response format. It is recommended to use application/fhir+json. |
birthdate | String | No | Search by birthdate. Supports full dates (for example, 1974 - 02 - 13) or partial dates (for example, passing only the year 1974). |
date | String | No | Search by date field. It can be combined with comparison prefixes such as ge and le. |
_lastUpdated | String | No | Search by the last update time of the resource. The value is usually an ISO 8601 date-time. |
subject | String | No | A reference search parameter. It can be used in combination with date parameters, for example, Patient/{id}. |
_lastUpdated parameter can be used for any resource type to filter data that was updated after or before a specified point in time.ge, gt, le, lt, eq, and others.200 OK is typically returned. The response body is usually a Bundle resource, which contains a list of resources that meet the criteria and pagination information.Field | Type | Description |
resourceType | String | Returns the resource type, usually Bundle. |
id | String | Unique ID of the Bundle resource, usually a UUID. |
meta | Object | Metadata of the Bundle, containing fields such as lastUpdated. |
meta.lastUpdated | String | Generation time of the Bundle. |
type | String | The Bundle type is usually searchset in search scenarios. |
total | Integer | The total number of matched records. Returned only when _total=accurate is passed in the request; this field may not be included if the parameter is not passed. |
link | Array | Pagination link information, containing relation and url. |
link[].relation | String | Type of the link relation, such as self, next, and previous. |
link[].url | String | The complete request URL for the corresponding pagination. |
entry | Array | The list of search results. |
entry[].fullUrl | String | The complete access URL of the resource. |
entry[].resource | Object | The matched resource content. |
entry[].resource.id | String | Unique ID of the resource. |
entry[].resource.meta | Object | Metadata of the resource, containing fields such as versionId and lastUpdated. |
entry[].search.mode | String | The search hit mode, such as match. |
total field may not be returned by default. To obtain the total number of hits, include _total=accurate in the request parameters. The server will then calculate and return the total. If the _total parameter is not included, the response body may not contain the total field.GET /INSTANCE_ID/fhir/Patient?birthdate=1974-02-13 HTTP/1.1Host: HOSTNAMEAuthorization: Bearer <AccessToken>Accept: application/fhir+json
GET /INSTANCE_ID/fhir/Patient?birthdate=1974 HTTP/1.1Host: HOSTNAMEAuthorization: Bearer <AccessToken>Accept: application/fhir+json
GET /INSTANCE_ID/fhir/Encounter?subject=Patient/ef2c19c4-ea06-473d-8781-368e4441c5c0&date=ge2009-06-01&date=le2009-07-31 HTTP/1.1Host: HOSTNAMEAuthorization: Bearer <AccessToken>Accept: application/fhir+json
GET /INSTANCE_ID/fhir/Patient?_lastUpdated=ge2017-01-01T00:00:00Z HTTP/1.1Host: HOSTNAMEAuthorization: Bearer <AccessToken>Accept: application/fhir+json
{"resourceType": "Bundle","id": "180f7368-790e-4f2b-b24a-550eb027d747","meta": {"lastUpdated": "2022-10-10T07:07:33.086-04:00"},"type": "searchset","link": [{"relation": "self","url": "https://HOSTNAME/INSTANCE_ID/fhir/Patient?birthdate=1974-02-13"}],"entry": [{"fullUrl": "https://HOSTNAME/INSTANCE_ID/fhir/Patient/199963","resource": {"resourceType": "Patient","id": "199963","meta": {"versionId": "1","lastUpdated": "2022-10-10T07:07:33.086-04:00"},"birthDate": "1974-02-13"},"search": {"mode": "match"}}]}
Error Code | Description |
400 Bad Request | The date parameter format is incorrect, or the comparison prefix is used illegally. |
401 Unauthorized | Not authenticated, and valid credentials are missing. |
403 Forbidden | Authenticated but not authorized to search the resource. |
404 Not Found | The specified resource type does not exist. |
422 Unprocessable Entity | The search parameter syntax is correct, but it fails business or rule validation. |
500 Internal Server Error | Internal server processing exception. |
フィードバック