FHIR ServiceRequest

Base Path: /fhir/4.0/ServiceRequest

Version: 2.0.0

The FHIR ServiceRequest API allows you to manage and track a patient's:

  • Diagnostic Tests/Studies (e.g., laboratory tests, imaging studies)
  • Procedures (e.g., endoscopic procedures, biopsies, surgeries)
  • Therapies and Treatments (e.g., physical therapy, psychological counseling)
  • Specialist Consultations (e.g., expert assessments, second opinions)
  • Community and Nursing Services (e.g., home care, community health services)
  • Medication Reviews (e.g., pharmacist evaluations)

The endpoint provides the ability to:

  • Retrieve all ServiceRequest resources that match a search criteria for a given patient.
  • Retrieve a specific ServiceRequest resource based on its resource ID.
  • Retrieve the history of a ServiceRequest resource based on its resource ID.
  • Retrieve a specific version of a ServiceRequest resource based on its FHIR ID and Version ID.
  • Retrieve summaries of all ServiceRequest resources that match a search criteria for a given patient
  • Retrieve ServiceRequest results from third-party sources.

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 ServiceRequest API aggregates data from multiple sources, to learn about working with aggregated APIs refer to the Working with Aggregation 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 ServiceRequests for a Patient

GET /fhir/4.0/ServiceRequest/

This method returns all ServiceRequests for the patient identified by patient.identifier or patient. Optionally filtering by using multiple search parameters.


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.
  • In addition to having the required patient.identifier or patient, you can defined chained patient elements to define filters on the reference, each of the chained parameters can specify multiple comma separated values.

Sample format of the query is

  • patient.identifier={namespace}|{identifier}
  • patient.identifier={namespace}|{identifier} & patient.gender=male & patient.birthdate=2002-05-01


Sample Value: OHCP%7Cc50bbc12



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.
  • In addition to having the required patient.identifier or patient, you can defined chained patient elements to define filters on the reference, each of the chained parameters can specify multiple comma separated values.

Sample format of the query is

  • patient={patient FHIRID}
  • patient={patient FHIRID} & patient.gender=male & patient.birthdate=2002-05-01


Sample Value: IFAUCQJNGAYTENBNHBAE6USJJ5HA



Name:

code

optional

Type:

query

Data Type:

array

Description:

Filters the ServiceRequests to ones with a request/order type that matches the specified code. The code value consists of a coding system and a code separated using a URL encoded | character i.e. %7c

Note: Supports passing in a comma-separated list of values.


Sample Value: http://www.ama-assn.org/go/cpt|85018



Name:

category

optional

Type:

query

Data Type:

array

Description:

Filters the ServiceRequests to ones with a service classification that matches the specified category. The category value consists of a coding system and a code separated using a URL encoded | character i.e. %7c.

Note: Supports passing in a comma-separated list of values.


Sample Value: urn:oid:2.16.840.1.113883.12.74|IMM



Name:

authored

optional

Type:

query

Data Type:

array

Description:

Filters the ServiceRequests to those with an authored date on, before, or after a specific date, date-time, or date range. 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

  • authored=gt{dateTimeValue}
  • authored=ge{dateTimeValue}&authored=le{dateTimeValue}


Sample Value: ge2012-01-01T01:00:00+13:00



Name:

based-on

optional

Type:

query

Data Type:

array

Description:

Filters ServiceRequests by the request it fulfills, identified by their ServiceRequest.basedOn reference.

Note: based-on can be chained to define filters on the reference, each of the chained parameters can specify multiple comma separated values.


Sample Value: ServiceRequest/shaO74NZR7CTOEKDLODIFSODJS4DLRWBEJ6XIO4PGOGJDCTSMCWVNSQ



Name:

body-site

optional

Type:

query

Data Type:

array

Description:

Filters the ServiceRequests to those with the specified anatomical location. The body-site value consists of a coding system and a code separated using a URL encoded | character i.e. %7c.

Note: Supports passing in a comma-separated list of values.


Sample Value: http://snomed.info/sct|38266002



Name:

encounter

optional

Type:

query

Data Type:

array

Description:

Filters ServiceRequests by the referenced encounter, identified by their ServiceRequest.encounter reference.

Note: encounter can be chained to define filters on the reference, each of the chained parameters can specify multiple comma separated values.


Sample Value: encounter.identifier=SYS_A|visti123



Name:

identifier

optional

Type:

query

Data Type:

array

Description:

Filters ServiceRequests by the identifier associated with this ServiceRequest.

Note: The identifier can be a single item or a comma separated list of identifiers. Each identifier is defined by system and value , separated using a URL encoded | character i.e. %7c.


Sample Value: urn:oid:1.3.4.5.6.7|2345234234234,urn:text:sysA|2345



Name:

instantiates-canonical

optional

Type:

query

Data Type:

array

Description:

Filters ServiceRequests by the referenced FHIR protocol or definition it instantiates, identified by their ServiceRequest.instantiatesCanonical reference.

Note: instantiates-canonical can be chained to define filters on the reference, each of the chained parameters can specify multiple comma separated values.


Sample Value: PlanDefinition/AT4DSTJRJNTYFQCPJ6QYP



Name:

instantiates-uri

optional

Type:

query

Data Type:

array

Description:

Filters ServiceRequests by the uri of the external protocol or definition it instantiates, identified by their ServiceRequest.instantiatesCanonical uri.

Note: Supports passing in a comma-separated list of values.


Sample Value: http://snomed.info/sct/293847



Name:

intent

optional

Type:

query

Data Type:

array

Description:

Filters the ServiceRequests by the request intent. The intent may consist of a coding system and a code separated using a URL encoded | character i.e. %7c

The supported values are:

  • proposal
  • plan
  • directive
  • order
  • original-order
  • reflex-order
  • filler-order
  • instance-order
  • option

Note:

  • If an intent system is specified only http://hl7.org/fhir/request-intent can be used.
  • Supports passing in a comma-separated list of values.


Sample Value: order



Name:

occurrence

optional

Type:

query

Data Type:

array

Description:

Filters the ServiceRequests to those with an occurrenceDateTime, occurrencePeriod, or occurrenceTiming 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

  • occurrence=gt{dateTimeValue}
  • occurrence=ge{dateTimeValue}&occurrence=le{dateTimeValue}


Sample Value: ge2020-01-01T01:00:00+13:00



Name:

performer

optional

Type:

query

Data Type:

array

Description:

Filters ServiceRequests by the requested performer, identified by their ServiceRequest.performer reference.

Note: performer can be chained to define filters on the reference, each of the chained parameters can specify multiple comma separated values.


Sample Value: Practitioner/RWBEJ6XIO4PGOGJDCTSMCWVNSQ



Name:

performer-type

optional

Type:

query

Data Type:

array

Description:

Filters the ServiceRequests to ones with a performer role that matches the specified performer-type. The performer-type value consists of a coding system and a code separated using a URL encoded | character i.e. %7c

Note: Supports passing in a comma-separated list of values.


Sample Value: http://snomed.info/sct|75271001



Name:

priority

optional

Type:

query

Data Type:

array

Description:

Filters the ServiceRequests by the request priority. The priority may consist of a coding system and a code separated using a URL encoded | character i.e. %7c

The supported values are:

  • routine
  • urgent
  • asap
  • stat

Note:

  • if a priority system is specified only http://hl7.org/fhir/request-priority can be used.
  • Supports passing in a comma-separated list of values.


Sample Value: routine



Name:

replaces

optional

Type:

query

Data Type:

array

Description:

Filters ServiceRequests by the request it replaces, identified by their ServiceRequest.replaces reference.

Note: replaces can be chained to define filters on the reference, each of the chained parameters can specify multiple comma separated values.


Sample Value: ServiceRequest/shaO74NZR7CTOEKDLODIFSODJS4DLRWBEJ6XIO4PGOGJDCTSMCWVNSQ



Name:

requester

optional

Type:

query

Data Type:

array

Description:

Filters ServiceRequests by the requester, identified by their ServiceRequest.requester reference.

Note: requester can be chained to define filters on the reference, each of the chained parameters can specify multiple comma separated values.


Sample Value: Provider/1A2B3C4D5E6F7G8H9I



Name:

requisition

optional

Type:

query

Data Type:

array

Description:

Filters ServiceRequests by the composite request ID (group identifier) associated with this ServiceRequest.

Note: The requisition can be a single item or a comma separated list of identifiers. Each identifier is defined by system and value , separated using a URL encoded | character i.e. %7c.


Sample Value: System%7C9d3930f4-7a8c-4104-ba1f-1ea28c5f3e96



Name:

specimen

optional

Type:

query

Data Type:

array

Description:

Filters ServiceRequests by the specimen, identified by their ServiceRequest.specimen reference.

Note: specimen can be chained to define filters on the reference, each of the chained parameters can specify multiple comma separated values.


Sample Value: Specimen/9d3930f4ea28c5f3e96



Name:

status

optional

Type:

query

Data Type:

array

Description:

Filters the ServiceRequests to those that match the specified status. The status may consists of a coding system and a code separated using a URL encoded | character i.e. %7c

The supported values are:

  • draft
  • active
  • on-hold
  • revoked
  • completed
  • entered-in-error
  • unknown

Note:

  • If a status system is specified only http://hl7.org/fhir/request-status can be used.
  • Supports passing in a comma-separated list of values.


Sample Value: active



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 parameter 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%20CDR%20ServiceRequests



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%20CDR%20ServiceRequests



Name:

_lastUpdated

optional

Type:

query

Data Type:

array

Description:

Filters based on when the resource version was last changed, 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

  • _lastUpdated=gt{dateTimeValue}
  • _lastUpdated=ge{dateTimeValue}&_lastUpdated=le{dateTimeValue}


Sample Value: ge2012-01-01T01:00:00+13:00



Name:

_summary

optional

Type:

query

Data Type:

string

Description:

Instructs the server to return a subset of the resource, reducing the size of the reponse payload. Possible values are

  • true: return summaries only
  • false: return full resources
  • count: return the count of search matches
  • text: return only the text, id, meta, and top-level mandatory elements
  • data: remove the text element


Sample Value: true



Name:

_elements

optional

Type:

query

Data Type:

array

Description:

Request a specific set of elements be returned, or excluded as part of a resource in the search results. Use _elements for the elements to include and _elements:exclude for the elements to exclude.


Sample Value: _elements=code,category,performer,_elements:exclude=*.extension,*.encounter



Name:

-cursor

optional

Type:

query

Data Type:

string

Description:

A server internal parameter to navigate different pages.

This parameter is returned by the server as part of the Bundle 'next' link of a paginated query. And is used to retrieve the next page




Name:

_count

optional

Type:

query

Data Type:

integer

Description:

Limit the number of match results to the specified _count. When _count is specified, the query will be paginated, and only _count or less results will be returned.

The returned bundle may contain a next link if more results could be available.


Sample Value: 30



Name:

_sort

optional

Type:

query

Data Type:

array

Description:

Request which order results should be returned in.

Supported _sort parameters are:

  • authored to sort by ServiceRequest.authored ascending
  • -authored to sort by ServiceRequest.authored descending
  • occurrence to sort by ServiceRequest.occurrence ascending
  • -occurrence to sort by ServiceRequest.occurrence descending
  • _lastUpdated to sort by ServiceRequest.Meta.lastUpdated ascending
  • -_lastUpdatedto sort by ServiceRequest.Meta.lastUpdated descending

You can use any combination of the parameters


Default Value: -authored

Sample Value: _sort=-authored,_sort=-authored, -_lastUpdated, -occurrence



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: json

Sample Value: json



Name:

_pretty

optional

Type:

query

Data Type:

string

Description:

Ask for a pretty printed response for human convenience.


Default Value: true

Sample Value: true



Name:

X-Request-Id

optional

Type:

header

Data Type:

string

Description:

Supply a request Id to track the request.


Sample Value: adUEctf6urd



Name:

Accept-Language

optional

Type:

header

Data Type:

string

Description:

Specifies the language that the results will be translated to. If not specified it will default to the server's locale. (e.g. fr-FR for french)


Sample Value: en-US



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/json



Name:

CSRF-Token

required

Type:

header

Data Type:

string

Description:

This header is required for CSRF protection. The csrfToken from the OHP session must be included in this header. System will validate the token and reject the request if the token is invalid or not present.




Name:

X-Send-Open-API

required

Type:

header

Data Type:

string

Description:

This header is required for CSRF protection. This header is required to distinguish the api requests from known senders. System will validate "X-Send-Open-API" request header is present or not. If it is not present, system will reject the request.



Responses


application/json+fhir

200

Returns a FHIR Bundle containing 0..* OperationOutcome resources and 0..* ServiceRequest 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 specific ServiceRequests for a Patient identified by a patient identifier
curl -X GET "https://developer-solution/fhir/4.0/ServiceRequest?patient.identifier=OHCP%7Cc50bbc12&status=active" \
-H 'Accept: application/json' \
-H 'Authorization: Basic bGV2ZWwxLnN5c19hOk9yaW9uc3k1IT8='

Retrieve ServiceRequests for a Patient

POST /fhir/4.0/ServiceRequest/_search

This method returns all ServiceRequests for the patient identified by patient.identifier or patient. Optionally filtering by using multiple search parameters. 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.

Note:

  • You must either define the patient.identifier or patient, not both.
  • In addition to having the required patient.identifier or patient, you can defined chained patient elements to define filters on the reference, each of the chained parameters can specify multiple comma separated values.

Sample format of the query is

  • patient.identifier={namespace}|{identifier}
  • patient.identifier={namespace}|{identifier} & patient.gender=male & patient.birthdate=2002-05-01


Sample Value: OHCP%7Cc50bbc12



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.
  • In addition to having the required patient.identifier or patient, you can defined chained patient elements to define filters on the reference, each of the chained parameters can specify multiple comma separated values.

Sample format of the query is

  • patient={patient FHIRID}
  • patient={patient FHIRID} & patient.gender=male & patient.birthdate=2002-05-01


Sample Value: IFAUCQJNGAYTENBNHBAE6USJJ5HA



Name:

code

optional

Type:

formData

Data Type:

array

Description:

Filters the ServiceRequests to ones with a request/order type that matches the specified code. The code value consists of a coding system and a code separated using a URL encoded | character i.e. %7c

Note: Supports passing in a comma-separated list of values.


Sample Value: http://www.ama-assn.org/go/cpt|85018



Name:

category

optional

Type:

formData

Data Type:

array

Description:

Filters the ServiceRequests to ones with a service classification that matches the specified category. The category value consists of a coding system and a code separated using a URL encoded | character i.e. %7c.

Note: Supports passing in a comma-separated list of values.


Sample Value: urn:oid:2.16.840.1.113883.12.74|IMM



Name:

authored

optional

Type:

formData

Data Type:

array

Description:

Filters the ServiceRequests to those with an authored date on, before, or after a specific date, date-time, or date range. 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

  • authored=gt{dateTimeValue}
  • authored=ge{dateTimeValue}&authored=le{dateTimeValue}


Sample Value: ge2012-01-01T01:00:00+13:00



Name:

based-on

optional

Type:

formData

Data Type:

array

Description:

Filters ServiceRequests by the request it fulfills, identified by their ServiceRequest.basedOn reference.

Note: based-on can be chained to define filters on the reference, each of the chained parameters can specify multiple comma separated values.


Sample Value: ServiceRequest/shaO74NZR7CTOEKDLODIFSODJS4DLRWBEJ6XIO4PGOGJDCTSMCWVNSQ



Name:

body-site

optional

Type:

formData

Data Type:

array

Description:

Filters the ServiceRequests to those with the specified anatomical location. The body-site value consists of a coding system and a code separated using a URL encoded | character i.e. %7c.

Note: Supports passing in a comma-separated list of values.


Sample Value: http://snomed.info/sct|38266002



Name:

encounter

optional

Type:

formData

Data Type:

array

Description:

Filters ServiceRequests by the referenced encounter, identified by their ServiceRequest.encounter reference.

Note: encounter can be chained to define filters on the reference, each of the chained parameters can specify multiple comma separated values.


Sample Value: encounter.identifier=SYS_A|visti123



Name:

identifier

optional

Type:

formData

Data Type:

array

Description:

Filters ServiceRequests by the identifier associated with this ServiceRequest.

Note: The identifier can be a single item or a comma separated list of identifiers. Each identifier is defined by system and value , separated using a URL encoded | character i.e. %7c.


Sample Value: urn:oid:1.3.4.5.6.7|2345234234234,urn:text:sysA|2345



Name:

instantiates-canonical

optional

Type:

formData

Data Type:

array

Description:

Filters ServiceRequests by the referenced FHIR protocol or definition it instantiates, identified by their ServiceRequest.instantiatesCanonical reference.

Note: instantiates-canonical can be chained to define filters on the reference, each of the chained parameters can specify multiple comma separated values.


Sample Value: PlanDefinition/AT4DSTJRJNTYFQCPJ6QYP



Name:

instantiates-uri

optional

Type:

formData

Data Type:

array

Description:

Filters ServiceRequests by the uri of the external protocol or definition it instantiates, identified by their ServiceRequest.instantiatesCanonical uri.

Note: Supports passing in a comma-separated list of values.


Sample Value: http://snomed.info/sct/293847



Name:

intent

optional

Type:

formData

Data Type:

array

Description:

Filters the ServiceRequests by the request intent. The intent may consist of a coding system and a code separated using a URL encoded | character i.e. %7c

The supported values are:

  • proposal
  • plan
  • directive
  • order
  • original-order
  • reflex-order
  • filler-order
  • instance-order
  • option

Note:

  • If an intent system is specified only http://hl7.org/fhir/request-intent can be used.
  • Supports passing in a comma-separated list of values.


Sample Value: order



Name:

occurrence

optional

Type:

formData

Data Type:

array

Description:

Filters the ServiceRequests to those with an occurrenceDateTime, occurrencePeriod, or occurrenceTiming 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

  • occurrence=gt{dateTimeValue}
  • occurrence=ge{dateTimeValue}&occurrence=le{dateTimeValue}


Sample Value: ge2020-01-01T01:00:00+13:00



Name:

performer

optional

Type:

formData

Data Type:

array

Description:

Filters ServiceRequests by the requested performer, identified by their ServiceRequest.performer reference.

Note: performer can be chained to define filters on the reference, each of the chained parameters can specify multiple comma separated values.


Sample Value: Practitioner/RWBEJ6XIO4PGOGJDCTSMCWVNSQ



Name:

performer-type

optional

Type:

formData

Data Type:

array

Description:

Filters the ServiceRequests to ones with a performer role that matches the specified performer-type. The performer-type value consists of a coding system and a code separated using a URL encoded | character i.e. %7c

Note: Supports passing in a comma-separated list of values.


Sample Value: http://snomed.info/sct|75271001



Name:

priority

optional

Type:

formData

Data Type:

array

Description:

Filters the ServiceRequests by the request priority. The priority may consist of a coding system and a code separated using a URL encoded | character i.e. %7c

The supported values are:

  • routine
  • urgent
  • asap
  • stat

Note:

  • if a priority system is specified only http://hl7.org/fhir/request-priority can be used.
  • Supports passing in a comma-separated list of values.


Sample Value: routine



Name:

replaces

optional

Type:

formData

Data Type:

array

Description:

Filters ServiceRequests by the request it replaces, identified by their ServiceRequest.replaces reference.

Note: replaces can be chained to define filters on the reference, each of the chained parameters can specify multiple comma separated values.


Sample Value: ServiceRequest/shaO74NZR7CTOEKDLODIFSODJS4DLRWBEJ6XIO4PGOGJDCTSMCWVNSQ



Name:

requester

optional

Type:

formData

Data Type:

array

Description:

Filters ServiceRequests by the requester, identified by their ServiceRequest.requester reference.

Note: requester can be chained to define filters on the reference, each of the chained parameters can specify multiple comma separated values.


Sample Value: Provider/1A2B3C4D5E6F7G8H9I



Name:

requisition

optional

Type:

formData

Data Type:

array

Description:

Filters ServiceRequests by the composite request ID (group identifier) associated with this ServiceRequest.

Note: The requisition can be a single item or a comma separated list of identifiers. Each identifier is defined by system and value , separated using a URL encoded | character i.e. %7c.


Sample Value: System%7C9d3930f4-7a8c-4104-ba1f-1ea28c5f3e96



Name:

specimen

optional

Type:

formData

Data Type:

array

Description:

Filters ServiceRequests by the specimen, identified by their ServiceRequest.specimen reference.

Note: specimen can be chained to define filters on the reference, each of the chained parameters can specify multiple comma separated values.


Sample Value: Specimen/9d3930f4ea28c5f3e96



Name:

status

optional

Type:

formData

Data Type:

array

Description:

Filters the ServiceRequests to those that match the specified status. The status may consists of a coding system and a code separated using a URL encoded | character i.e. %7c

The supported values are:

  • draft
  • active
  • on-hold
  • revoked
  • completed
  • entered-in-error
  • unknown

Note:

  • If a status system is specified only http://hl7.org/fhir/request-status can be used.
  • Supports passing in a comma-separated list of values.


Sample Value: active



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 parameter 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%20CDR%20ServiceRequests



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.


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



Name:

_lastUpdated

optional

Type:

formData

Data Type:

array

Description:

Filters based on when the resource version was last changed, 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

  • _lastUpdated=gt{dateTimeValue}
  • _lastUpdated=ge{dateTimeValue}&_lastUpdated=le{dateTimeValue}


Sample Value: ge2012-01-01T01:00:00+13:00



Name:

_summary

optional

Type:

formData

Data Type:

string

Description:

Instructs the server to return a subset of the resource, reducing the size of the reponse payload. Possible values are

  • true: return summaries only
  • false: return full resources
  • count: return the count of search matches
  • text: return only the text, id, meta, and top-level mandatory elements
  • data: remove the text element


Sample Value: true



Name:

_elements

optional

Type:

formData

Data Type:

array

Description:

Request a specific set of elements be returned, or excluded as part of a resource in the search results. Use _elements for the elements to include and _elements:exclude for the elements to exclude.


Sample Value: _elements=code,category,performer,_elements:exclude=*.extension,*.encounter



Name:

-cursor

optional

Type:

formData

Data Type:

string

Description:

A server internal parameter to navigate different pages.

This parameter is returned by the server as part of the Bundle 'next' link of a paginated query. And is used to retrieve the next page




Name:

_count

optional

Type:

formData

Data Type:

integer

Description:

Limit the number of match results to the specified _count. When _count is specified, the query will be paginated, and only _count or less results will be returned.

The returned bundle may contain a next link if more results could be available.


Sample Value: 30



Name:

_sort

optional

Type:

formData

Data Type:

array

Description:

Request which order results should be returned in.

Supported _sort parameters are:

  • authored to sort by ServiceRequest.authored ascending
  • -authored to sort by ServiceRequest.authored descending
  • occurrence to sort by ServiceRequest.occurrence ascending
  • -occurrence to sort by ServiceRequest.occurrence descending
  • _lastUpdated to sort by ServiceRequest.Meta.lastUpdated ascending
  • -_lastUpdatedto sort by ServiceRequest.Meta.lastUpdated descending

You can use any combination of the parameters


Default Value: -authored

Sample Value: _sort=-authored,_sort=-authored, -_lastUpdated, -occurrence



Name:

_format

optional

Type:

formData

Data Type:

string

Description:

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


Default Value: json

Sample Value: json



Name:

_pretty

optional

Type:

formData

Data Type:

string

Description:

Ask for a pretty printed response for human convenience.


Default Value: true

Sample Value: true



Name:

X-Request-Id

optional

Type:

header

Data Type:

string

Description:

Supply a request Id to track the request.


Sample Value: adUEctf6urd



Name:

Accept-Language

optional

Type:

header

Data Type:

string

Description:

Specifies the language that the results will be translated to. If not specified it will default to the server's locale. (e.g. fr-FR for french)


Sample Value: en-US



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/json



Name:

CSRF-Token

required

Type:

header

Data Type:

string

Description:

This header is required for CSRF protection. The csrfToken from the OHP session must be included in this header. System will validate the token and reject the request if the token is invalid or not present.




Name:

X-Send-Open-API

required

Type:

header

Data Type:

string

Description:

This header is required for CSRF protection. This header is required to distinguish the api requests from known senders. System will validate "X-Send-Open-API" request header is present or not. If it is not present, system will reject the request.



Responses


application/json+fhir

200

Returns a FHIR Bundle containing 0..* OperationOutcome resources and 0..* ServiceRequest 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 specific ServiceRequests for a Patient identified by a patient identifier
curl -X POST "https://developer-solution/fhir/4.0/ServiceRequest/_search" \
-H 'Accept: application/json' \
-H 'Authorization: Basic bGV2ZWwxLnN5c19hOk9yaW9uc3k1IT8=' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'patient.identifier=OHCP%7Cc50bbc12' \
-d 'status=active'

Retrieve a single ServiceRequest

GET /fhir/4.0/ServiceRequest/{id}

This method returns the ServiceRequest 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 ServiceRequest resource


Sample Value: GBSWMOJVGY2DGLJXHBRDMLJUGY2DKLJYMEZTGLJXG44TOZBRMZRTMZBWMNAFGMI



Name:

_elements

optional

Type:

query

Data Type:

array

Description:

Request a specific set of elements be returned, or excluded as part of a resource in the search results. Use _elements for the elements to include and _elements:exclude for the elements to exclude.


Sample Value: _elements=code,category,severity,_elements:exclude=*.extension,*.encounter



Name:

X-Request-Id

optional

Type:

header

Data Type:

string

Description:

Supply a request Id to track the request.


Sample Value: adUEctf6urd



Name:

Accept

optional

Type:

header

Data Type:

string

Description:

Media type of the response. Possible values are application/json and application/xml. If both _format and Accept are specified, _format takes precedence.


Default Value: application/json

Sample Value: application/json



Name:

Accept-Language

optional

Type:

header

Data Type:

string

Description:

The language that the results will be translated to. If not specified it will default to the server's locale. (e.g. fr-FR for french)


Sample Value: en-US



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: json

Sample Value: json



Name:

_pretty

optional

Type:

query

Data Type:

string

Description:

Ask for a pretty printed response for human convenience.


Default Value: true

Sample Value: true



Name:

CSRF-Token

required

Type:

header

Data Type:

string

Description:

This header is required for CSRF protection. The csrfToken from the OHP session must be included in this header. System will validate the token and reject the request if the token is invalid or not present.




Name:

X-Send-Open-API

required

Type:

header

Data Type:

string

Description:

This header is required for CSRF protection. This header is required to distinguish the api requests from known senders. System will validate "X-Send-Open-API" request header is present or not. If it is not present, system will reject the request.



Responses


application/json+fhir

200

Returns a ServiceRequest resource matching the the requested resource ID and version id.


application/json+fhir

400

This code is returned when the FHIR ID is empty or not valid.


application/json+fhir

404

No ServiceRequest resource found with the requested resource ID.

Sample Requests

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

Retrieve a ServiceRequest's history

GET /fhir/4.0/ServiceRequest/{id}/_history

This method returns the change history for a ServiceRequest resource matching the requested resource ID. ServiceRequest resources can be retrieved from multiple data sources, and not all sources are able to return history information. This operation will return an empty set of data if no versions of the specified ServiceRequest can be found, which includes cases where:

  • The specified ServiceRequest resource cannot be found.
  • The data source for the ServiceRequest is unable to return history information.


Parameters

Name

Type

Data Type

Description


Name:

id

required

Type:

path

Data Type:

string

Description:

The id of the ServiceRequest resource


Sample Value: shaP3NKFHAZBPVPYHFDLEB4SLWV3HBCI76LOTGYZDIWE5YIATDOLI3A



Name:

_elements

optional

Type:

query

Data Type:

array

Description:

Request a specific set of elements be returned, or excluded as part of a resource in the search results. Use _elements for the elements to include and _elements:exclude for the elements to exclude.


Sample Value: _elements=code,category,severity,_elements:exclude=*.extension,*.encounter



Name:

X-Request-Id

optional

Type:

header

Data Type:

string

Description:

Supply a request Id to track the request.


Sample Value: adUEctf6urd



Name:

Accept

optional

Type:

header

Data Type:

string

Description:

Media type of the response. Possible values are application/json and application/xml. If both _format and Accept are specified, _format takes precedence.


Default Value: application/json

Sample Value: application/json



Name:

Accept-Language

optional

Type:

header

Data Type:

string

Description:

Specifies the language that the results will be translated to. If not specified it will default to the server's locale. (e.g. fr-FR for french)


Sample Value: en-US



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: json

Sample Value: json



Name:

_pretty

optional

Type:

query

Data Type:

string

Description:

Ask for a pretty printed response for human convenience.


Default Value: true

Sample Value: true



Name:

CSRF-Token

required

Type:

header

Data Type:

string

Description:

This header is required for CSRF protection. The csrfToken from the OHP session must be included in this header. System will validate the token and reject the request if the token is invalid or not present.




Name:

X-Send-Open-API

required

Type:

header

Data Type:

string

Description:

This header is required for CSRF protection. This header is required to distinguish the api requests from known senders. System will validate "X-Send-Open-API" request header is present or not. If it is not present, system will reject the request.



Responses


application/json+fhir

200

A FHIR Bundle containing 1..* ServiceRequest resources matching the requested resource ID.


application/json+fhir

400

  • The source providing the ServiceRequest resource is not capable of returning history of ServiceRequest resources.


application/json+fhir

404

  • No ServiceRequest resource found with the requested resource ID.

Sample Requests

Retrieve the history of ServiceRequests identified by a resource id
curl -X GET "https://developer-solution/fhir/4.0/ServiceRequest/shaP3NKFHAZBPVPYHFDLEB4SLWV3HBCI76LOTGYZDIWE5YIATDOLI3A/_history" \
-H 'Accept: application/json' \
-H 'Authorization: Basic bGV2ZWwxLnN5c19hOk9yaW9uc3k1IT8='

Retrieve a specific version of a ServiceRequest

GET /fhir/4.0/ServiceRequest/{id}/_history/{versionid}

This method returns a specific version of the ServiceRequest resource matching the requested resource ID. ServiceRequest resources can be retrieved from multiple data sources. This operation will return an empty set of data if no versions of the specified ServiceRequest can be found, which includes cases where:

  • The specified ServiceRequest resource cannot be found.


Parameters

Name

Type

Data Type

Description


Name:

id

required

Type:

path

Data Type:

string

Description:

The id of the ServiceRequest resource


Sample Value: shaARUVB4AHWFL6NAURIVNQIU4Q3FJMCBL6AGHLR3RJUXTIU62QCI6A



Name:

versionid

required

Type:

path

Data Type:

string

Description:

The version of the ServiceRequest resource


Sample Value: 1



Name:

_elements

optional

Type:

query

Data Type:

array

Description:

Request a specific set of elements be returned, or excluded as part of a resource in the search results. Use _elements for the elements to include and _elements:exclude for the elements to exclude.


Sample Value: _elements=code,category,severity,_elements:exclude=*.extension,*.encounter



Name:

X-Request-Id

optional

Type:

header

Data Type:

string

Description:

Supply a request Id to track the request.


Sample Value: adUEctf6urd



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/json



Name:

Accept-Language

optional

Type:

header

Data Type:

string

Description:

Specifies the language that the results will be translated to. If not specified it will default to the server's locale. (e.g. fr-FR for french)


Sample Value: en-US



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 json.


Sample Value: json



Name:

_pretty

optional

Type:

query

Data Type:

string

Description:

Ask for a pretty printed response for human convenience.


Default Value: true

Sample Value: true



Name:

CSRF-Token

required

Type:

header

Data Type:

string

Description:

This header is required for CSRF protection. The csrfToken from the OHP session must be included in this header. System will validate the token and reject the request if the token is invalid or not present.




Name:

X-Send-Open-API

required

Type:

header

Data Type:

string

Description:

This header is required for CSRF protection. This header is required to distinguish the api requests from known senders. System will validate "X-Send-Open-API" request header is present or not. If it is not present, system will reject the request.



Responses


application/json+fhir

200

Returns a ServiceRequest resource matching the the requested resource ID and version id.


application/json+fhir

400

  • The source providing the ServiceRequest resource is not capable of returning history of ServiceRequest resources.


application/json+fhir

404

  • No ServiceRequest resource found with the requested resource ID.
  • The version id specified does not exist for the ServiceRequest resource with the requested resource ID.

Sample Requests

Retrieve the version of ServiceRequest identified by a resource id and a version id
curl -X GET "https://developer-solution/fhir/4.0/ServiceRequest/shaARUVB4AHWFL6NAURIVNQIU4Q3FJMCBL6AGHLR3RJUXTIU62QCI6A/_history/1" \
-H 'Accept: application/json' \
-H 'Authorization: Basic bGV2ZWwxLnN5c19hOk9yaW9uc3k1IT8='