Skip to main content

Search Relay Operation

Experimental

This is an early access feature and is subject to change.

OPERATION: POST [base]/[Resource]/$search-relay

The Search Relay operation is used to relay requests to another FHIR server.

Supported Resources

This operation has been implemented for the following resources:

Workflow

Authorization

This operation will require the application obtain authorization to read the resource to relay using one of the following SMART clinical scopes.

  • v1: [patient|user|system]/[Location|Organization].[read|*]
  • v2: [patient|user|system]/[Location|Organization].[s] (future)

Parameters

Supported search parameters may vary by resource:

Location

UseNameCardinalityTypeDocumentation
INaddress0..1stringA (part of the) address of the location
INaddress-city0..1stringA city specified in an address
INaddress-postalcode0..1stringA postal code specified in an address
INaddress-state0..1stringA state specified in an address
INidentifier0..1identifierAny identifier for the organization (not the accreditation issuer's identifier)
INname0..1stringA portion of the organization's name or alias
INorganization0..1referenceSearches for locations that are managed by the provided organization
INtarget-system1..1stringThe unique ID assigned to the external FHIR server.

Organization

UseNameCardinalityTypeDocumentation
INaddress0..1stringA server defined search that may match any of the string fields in the Address, including line, city, district, state, country, postalCode, and/or text.
INaddress-city0..1stringA city specified in an address
INaddress-postalcode0..1stringA postal code specified in an address
INaddress-state0..1stringA state specified in an address
INidentifier0..1identifierAny identifier for the organization (not the accreditation issuer's identifier)
INname0..1stringA portion of the organization's name or alias
INtarget-system1..1stringThe unique ID assigned to the external FHIR server.

Examples

curl -X POST 'https://fhir.netsmartcloud.com/v4/Organization/$search-relay' \
-H "Authorization: {Bearer Token}" \
-H "Accept: application/fhir+json" \
-H "Content-Type: application/x-form-urlencoded" \
-d @payload.json

Payloads

Sample Search Relay Payload

{
"resourceType": "Parameters",
"parameter": [
{
"name": "name",
"valueString": "Acme"
},
// Addition search parameters
{
"name": "target-system",
"valueString": "ac97a53f-54cc-4d73-8f9a-ffae5f503d78"
}
]
}

Sample Search Relay Response Payloads

Search Relay Success
{
"resourceType": "Bundle",
"id": "bfef1cc5-9204-465b-b910-a3d59430b97f",
"type": "searchset",
"total": 8,
"entry": [
{
"fullUrl": "https://.../Organization/1",
"resource": {
// A matching Organization resource
}
},
// Additional matches excluded for brevity
]
}
Invalid Search Relay Payload or Other Unprocessable Request
{
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "error",
"code": "processing",
"details": {
"text": "Exception message"
}
}
]
}
Rejections or Other Search Relay Processing Errors
{
"resourceType": "Parameters",
"parameter": [
// Search parameters
{
"name": "target-system",
"valueString": "ac97a53f-54cc-4d73-8f9a-ffae5f503d78"
},
{
"name": "outcome",
"resource": {
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "error",
"code": "processing",
"details": {
"text": "status note"
}
}
]
}
}
]
}

Errors

Errors will be reported within an OperationOutcome and could include:

IssueDescriptionHTTP Status
T.B.D.T.B.D.400 Bad Request
T.B.D.T.B.D.500 Internal Server Error
T.B.D.T.B.D.501 Not Implemented