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"
}
}
]
}
}
]
}
Integration Patterns
Relay Workflow
-
Configure Target System
- Obtain target system identifier
- Validate external FHIR server connectivity
- Ensure proper authentication
-
Prepare Resource
- Create resource with required fields
- Validate resource structure
- Include target-system parameter
-
Execute Relay
- Submit create relay operation
- Handle response and extract ID
- Process OperationOutcome
Best Practices
- Validate target system availability before relay
- Handle network timeouts appropriately
- Implement retry logic for transient failures
- Monitor relay operation success rates
Relationships to Other Resources
- Read Relay Operation - Read from external systems
- Update Relay Operation - Update external resources
- Search Relay Operation - Search external systems
- Location Resource - Supported resource type
- Organization Resource - Supported resource type
Error Handling
For comprehensive error handling information, see Common Errors.
Support
For technical support with Create Relay operations:
- Contact: Netsmart Technologies, Inc.
- Documentation: Extended Operations