FHIR Appointment

Base Path: /fhir/4.0/Appointment

Version: 1.0.0

This API allows the retrieval of information about documents (e.g. those documents stored in the XDS document registry) as well as links for retrieving the documents. This API allows you to:

  • Retrieve all DocumentReference resources that match a search criteria for a given patient.
  • Retrieve a specific DocumentReference resource based on its FHIR ID.

The data returned in this API is subject to privacy and permissions settings, refer to the Working with Privacy guide to learn how this might affect your application.

The Appointment API aggregates data from multiple sources, to learn about working with aggregated APIs refer to the Aggregated APIs guide in the Knowledge Hub.

This API is based on the R4 release of the FHIR standard, for more information on this API refer to the official FHIR documentation.


Methods

Retrieve Appointments for a Patient

GET /fhir/4.0/Appointment/

This method returns all appointments for the patient identified either by patient.identifier or by patient. Optionally filtering by the appointment's date, type and status.


Parameters

Name

Type

Data Type

Description


Name:

patient.identifier

required

Type:

query

Data Type:

string

Description:

The patient identifier consists of patient identifier namespace (also known as the system) and identifier, separated using a URL encoded | character i.e. %7c.

Note: You must either define the patient.identifier or patient, not both.


Sample Value: ORION|AAAA-0124-8



Name:

patient

required

Type:

query

Data Type:

string

Description:

The patient resource id.

Note: You must either define the patient.identifier or patient, not both.


Sample Value: IFAUCQJNGAYTENBNHBAE6USJJ5HA



Name:

date

optional

Type:

query

Data Type:

array

Description:

Filters the appointments to those with a start date on, before, or after a specific date, date-time, or date range. The supported prefixes are gt, ge, lt, le and eq. If no prefix is used, exact date or date-time matching is implied. Dates must be formatted according to ISO 8601 either as a date only (e.g. 1997-07-16) or as a date-time including the timezone (e.g. 1997-07-16T19:20:30+13:00). Ensure that special characters such as + are URL encoded i.e. %2B.


Sample Value: gt2013-01-01T01:00:00%2B13:00



Name:

appointment-type

optional

Type:

query

Data Type:

array

Description:

Filters the appointments that match the specified type of appointment or patient.

The appointment-type consists of comma separated list of appointment-type codingSystem and type-code, separated using a URL encoded | character i.e. %7c.


Sample Value: ROUTINE



Name:

status

optional

Type:

query

Data Type:

array

Description:

Filters the appointments that match the specified status.

The supported values are:

  • proposed
  • pending
  • booked
  • arrived
  • fulfilled
  • cancelled
  • noshow
  • entered-in-error
  • checked-in
  • waitlist

    The supported appointment status formats can either be a comma separated list of {codingSystem}|{status} or a list of {status}.


Sample Value: booked



Name:

-include-sources

optional

Type:

query

Data Type:

array

Description:

The -include-sources parameter defines which sources should be queried for the results.

Note: Either -include-sources or -exclude-sources parameters can be specified, not both. If -include-sources is specified, ONLY the specified sources will be searched. Note that the sources specified should be enabled.


Sample Value: Orion%20Health%E2%84%A2%20R4%20HL7V2%20Appointments



Name:

-exclude-sources

optional

Type:

query

Data Type:

array

Description:

The -exclude-sources parameter defines which sources should NOT be queried for the results.

Note: Either -include-sources or -exclude-sources parameter can be specified, not both. If -exclude-sources is specified, the specified sources will NOT be searched. Note that the sources specified should be enabled.


Sample Value: Orion%20Health%E2%84%A2%20R4%20HL7V2%20Appointments



Name:

_format

optional

Type:

query

Data Type:

string

Description:

Media type of the response. It takes precedence over the accept header. Possible values are json and xml.


Default Value: xml

Sample Value: json



Name:

Accept

optional

Type:

header

Data Type:

string

Description:

Media type of the response. Possible values are application/json and application/xml.


Default Value: application/xml

Sample Value: application/json


Responses


application/json+fhir

200

Returns a FHIR Bundle containing 0..* Appointment resources.


application/json+fhir

400

This response code is returned when the query is invalid e.g. an invalid parameter or a partial token in the search.

Sample Requests

Retrieve all Appointments matching specified search criteria for a patient identified by a patient identifier.
curl -X GET "https://developer-solution/fhir/4.0/Appointment/?patient.identifier=ORION%7CAAAA-0124-8&date=gt2013-01-01T01:00:00%2B13:00&appointment-type=ROUTINE&status=booked" \
-H 'Accept: application/json' \
-H 'Authorization: Basic bGV2ZWwxLnN5c19hOk9yaW9uc3k1IT8='

Retrieve Appointments for a Patient

POST /fhir/4.0/Appointment/_search

This method returns all appointments for the patient identified either by patient.identifier or by patient. Optionally filtering by the Appointment's date, type and status. This is a secure alternative to the GET method.


Parameters

Name

Type

Data Type

Description


Name:

Content-Type

required

Type:

header

Data Type:

string

Description:

Specifies how to encode the form data. The Content-Type value must be application/x-www-form-urlencoded


Sample Value: application/x-www-form-urlencoded



Name:

patient.identifier

required

Type:

formData

Data Type:

string

Description:

The patient identifier consists of patient identifier namespace, also known as the system, and identifier, separated using a URL encoded | character i.e. %7c.

Note: You must either define the patient.identifier or patient, not both.


Sample Value: SYS_A|75849-3478



Name:

patient

required

Type:

formData

Data Type:

string

Description:

The patient resource id.

Note: You must either define the patient.identifier or patient, not both.


Sample Value: G42TQNBZFUZTINZYIBJVSU27IE



Name:

date

optional

Type:

formData

Data Type:

array

Description:

Filters the appointments with a start date on, before, or after a specific date, date-time, or date range. The supported prefixes are gt, ge, lt, le and eq. If no prefix is used, exact date or date-time matching is implied. Dates must be formatted according to ISO 8601 either as a date only (e.g. 1997-07-16) or as a date-time including the timezone (e.g. 1997-07-16T19:20:30+13:00). Ensure that special characters such as + are URL encoded i.e. %2B.


Sample Value: gt2012-01-01



Name:

appointment-type

optional

Type:

formData

Data Type:

array

Description:

Filters the appointments that match the specified type of appointment or patient.

The appointment-type consists of comma separated list of appointment-type codingSystem and type-code, separated using a URL encoded | character i.e. %7c.


Sample Value: ROUTINE



Name:

status

optional

Type:

formData

Data Type:

array

Description:

Filters the appointments that match the specified status.

The supported values are:

  • proposed
  • pending
  • booked
  • arrived
  • fulfilled
  • cancelled
  • noshow
  • entered-in-error
  • checked-in
  • waitlist

The supported appointment status formats can either be a comma separated list of {codingSystem}|{status} or a list of {status}.


Sample Value: booked



Name:

-include-sources

optional

Type:

formData

Data Type:

array

Description:

The -include-sources parameter defines which sources should be queried for the results.

Note: Either -include-sources or -exclude-sources parameters can be specified, not both. If -include-sources is specified, ONLY the specified sources will be searched. Note that the sources specified should be enabled.




Name:

-exclude-sources

optional

Type:

formData

Data Type:

array

Description:

The -exclude-sources parameter defines which sources should NOT be queried for the results.

Note: Either -include-sources or -exclude-sources parameter can be specified, not both. If -exclude-sources is specified, the specified sources will NOT be searched. Note that the sources specified should be enabled.




Name:

_format

optional

Type:

query

Data Type:

string

Description:

Media type of the response. It takes precedence over the accept header. Possible values are json and xml.


Default Value: xml

Sample Value: json



Name:

Accept

optional

Type:

header

Data Type:

string

Description:

Media type of the response. Possible values are application/json and application/xml.


Default Value: application/xml

Sample Value: application/json


Responses


application/json+fhir

200

Returns a FHIR Bundle containing 0..* Appointment resources.


application/json+fhir

400

This response code is returned when the query is invalid e.g. an invalid parameter or a partial token in the search.

Sample Requests

Retrieve all Appointments that match specified search criteria for a patient identified by a patient resource id.
curl -X POST "https://developer-solution/fhir/4.0/Appointment/_search" \
-H 'Accept: application/json' \
-H 'Authorization: Basic bGV2ZWwxLnN5c19hOk9yaW9uc3k1IT8=' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'patient.identifier=SYS_A%7C75849-3478' \
-d 'status=booked'

Retrieve a single Appointment

GET /fhir/4.0/Appointment/{id}

This method returns the Appointment resource matching the requested resource ID.


Parameters

Name

Type

Data Type

Description


Name:

fhirid

required

Type:

path

Data Type:

string

Description:

The ID of the Appointment resource.


Sample Value: shaHMEZO7XB3F6CZB6Z6TX2TJXB5JPO3X6IKLZO2LTFOSR3Z6FZK45A



Name:

_format

optional

Type:

query

Data Type:

string

Description:

Media type of the response. It takes precedence over the accept header. Possible values are json and xml.


Default Value: xml

Sample Value: json



Name:

Accept

optional

Type:

header

Data Type:

string

Description:

Media type of the response. Possible values are application/json and application/xml.


Default Value: application/xml

Sample Value: application/json


Responses


application/json+fhir

200

Returns an Appointment resource matching the requested resource ID.


application/json+fhir

404

No Appointment resource found with the requested resource ID or protected by privacy restrictions.

Sample Requests

Retrieve appointments identified by a specific id.
curl -X GET "https://developer-solution/fhir/4.0/Appointment/{id}" \
-H 'Accept: application/json' \
-H 'Authorization: Basic bGV2ZWwxLnN5c19hOk9yaW9uc3k1IT8='