FHIR Flag

Base Path: /fhir/4.0/Flag

Version: 1.0.0

The FHIR Flag API allows you to look up a patient's flags and alerts. The endpoint provides the ability to:

  • Retrieve all Flag resources for a given patient, and optionaly a period that the flag was active
  • Retrieve a specific Flag resource based on its resource 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 Flag 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 Flags for a Patient

GET /fhir/4.0/Flag/

This method returns all flags for the patient identified by patient.identifier. Optionally filtering by the date of the Flag.period.


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 or subject.identifier or subject, not a combination of those parameters.


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 or subject.identifier or subject, not a combination of those parameters.


Sample Value: IFAUCLJQGAYTIMRNGFAE6USJJ5HA



Name:

date

optional

Type:

query

Data Type:

array

Description:

Filters the flags to those with a period 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.

The format of the query is

  • /Flag?patient.identifier={patientNamespace}|{patientIdentifier}&date=gt{dateTimeValue}
  • /Flag?patient.identifier={patientNamespace}|{patientIdentifier}&date=ge{dateTimeValue}&date=le{dateTimeValue}


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



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. The default value is 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. The default value is application/xml.


Sample Value: application/xml


Responses


application/json+fhir

200

Returns a FHIR Bundle containing 0..* OperationOutcome resources and 0..* Flag 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

Search for specific Patient Flags for a Patient identified by the patient identifier
curl -X GET "https://developer-solution/fhir/4.0/Flag/?patient.identifier=ORION%7CAAAA-0124-8&date=gt2020-01-01T01:00:00%2B13:00" \
-H 'Accept: application/json' \
-H 'Authorization: Basic bGV2ZWwxLnN5c19hOk9yaW9uc3k1IT8='

Retrieve Flags for a Patient

POST /fhir/4.0/Flag/_search

This method returns all flags for the patient identified by patient.identifier. Optionally filtering by the date of the Flag.period. This is the secure alternative to the GET search.


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.


Sample Value: ORION%7cAAAA-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 or subject.identifier or subject, not a combination of those parameters.


Sample Value: G42TQNBZFUZTINZYIBJVSU27IE



Name:

date

optional

Type:

formData

Data Type:

array

Description:

Filters the flags to those with an effectiveDateTime or effectivePeriod 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: ge2013-01-01T01:00:00%2B13:00



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. The default value is 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. The default value is application/xml.


Sample Value: application/xml


Responses


application/json+fhir

200

Returns a FHIR Bundle containing 0..* OperationOutcome resources and 0..* Flag 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

Get all Patient Flags for a patient identified by the patient resource id
curl -X POST "https://developer-solution/fhir/4.0/Flag/_search?patient=G42TQNBZFUZTINZYIBJVSU27IE" \
-H 'Accept: application/json' \
-H 'Authorization: Basic bGV2ZWwxLnN5c19hOk9yaW9uc3k1IT8='

Retrieve a single Flag

GET /fhir/4.0/Flag/{id}

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


Parameters

Name

Type

Data Type

Description


Name:

id

required

Type:

path

Data Type:

string

Description:

The id of the Flag resource


Sample Value: shaMEKPOADDLL4JISXQRSC3FLSYWS5OYC66TY4BVH4UBR2HKXHQ4PBA



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. The default value is 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. The default value is application/xml.


Sample Value: application/xml


Responses


application/json+fhir

200

Returns a Flag resource matching the requested resource ID.


application/json+fhir

404

No Flag resource found with the requested resource ID.

Sample Requests

Retrieve a Patient Flag identified by the resource id
curl -X GET "https://developer-solution/fhir/4.0/Flag/shaMEKPOADDLL4JISXQRSC3FLSYWS5OYC66TY4BVH4UBR2HKXHQ4PBA" \
-H 'Accept: application/json' \
-H 'Authorization: Basic bGV2ZWwxLnN5c19hOk9yaW9uc3k1IT8='