Skip to main content

Invoke Instance Operation

The FHIR instance-level operation invocation allows you to invoke a custom or standard operation on a specific resource instance. This is done using an HTTP POST or GET request to the operation endpoint for the resource instance.

Invoke the $everything operation on a Patient resource using the Haste Health CLI:

haste-health api invoke-instance Patient 12345 everything --file params.json

Where params.json contains:

{
"resourceType": "Parameters",
"parameter": [
{
"name": "start",
"valueDate": "2025-01-01"
}
]
}

Replace [tenant] with your tenant name and [project] with your project ID.

Error Handling

If there are any issues with the request (e.g., invalid parameters, operation not supported), the server will respond with an appropriate error status code and include an OperationOutcome resource in the response body.

HTTP/1.1 400 Bad Request
Content-Type: application/fhir+json
{
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "error",
"code": "invalid",
"diagnostics": "Missing required parameter: start"
}
]
}