Create Relay Operation
Experimental
This is an early access feature and is subject to change.
OPERATION: POST [base]/[Resource]/$create-relay
The Create 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].[write|*] - v2:
[patient|user|system]/[Location|Organization].[c](future)
Parameters
| Use | Name | Cardinality | Type | Documentation |
|---|---|---|---|---|
| IN | resource | 1..1 | Resource | The resource to create. |
| IN | target-system | 1..1 | string | The unique ID assigned to the external FHIR server. |
| OUT | id | 0..1 | string | The ID assigned to the created resource. |
| OUT | outcome | 1..1 | OperationOutcome | The outcome of the operation. On success this will provide a success statement or warnings related to the change. If the operation was unsuccessful, the OperationOutcome will include the reason for the failure. |
Examples
- Production
- Preview
curl -X POST 'https://fhir.netsmartcloud.com/v4/Organization/$create-relay' \
-H "Authorization: {Bearer Token}" \
-H "Accept: application/fhir+json" \
-H "Content-Type: application/x-form-urlencoded" \
-d @payload.json
curl -X POST 'https://fhirtest.netsmartcloud.com/v4/Organization/$create-relay' \
-H "Authorization: {Bearer Token}" \
-H "Accept: application/fhir+json" \
-H "Content-Type: application/x-form-urlencoded" \
-d @payload.json
Payloads
Sample Create Relay Payload
{
"resourceType": "Parameters",
"parameter": [
{
"name": "resource",
"resource": {
// resource to create
}
},
{
"name": "target-system",
"valueString": "ac97a53f-54cc-4d73-8f9a-ffae5f503d78"
}
]
}
Sample Create Relay Response Payloads
Create Relay Success
{
"resourceType": "Parameters",
"parameter": [
{
"name": "resource",
"resource": {
// resource to create
}
},
{
"name": "target-system",
"valueString": "ac97a53f-54cc-4d73-8f9a-ffae5f503d78"
},
// outcome of request
{
"name": "id",
"valueReference": {
"reference": "Organization/123",
"type": "Organization"
}
},
{
"name": "outcome",
"resource": {
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "information",
"code": "informational",
"details": {
"text": "Success message"
}
}
]
}
}
]
}
Invalid Create Relay Payload or Other Unprocessable Request
{
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "error",
"code": "processing",
"details": {
"text": "Exception message"
}
}
]
}
Rejections or Other Create Relay Processing Errors
{
"resourceType": "Parameters",
"parameter": [
{
"name": "resource",
"resource": {
// resource to create
}
},
{
"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:
| Issue | Description | HTTP 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 |