Skip to main content

System-Level Operations

Execute FHIR operations at the system level. These operations affect the entire server, not specific resources.
operation
string
required
The operation name (e.g., $validate, $everything, $export)

Endpoint

GET /fhir/$:operation
POST /fhir/$:operation
Use GET for operations that only read data, or POST for operations that require input parameters.

Example Request

curl -X POST \
     -H "Content-Type: application/fhir+json" \
     -d '{"resourceType":"Parameters"}' \
     https://your-server.com/fhir/$validate

Common System Operations

$validate

Validate a resource against profiles and constraints:
POST /fhir/$validate
Content-Type: application/fhir+json

{
  "resourceType": "Parameters",
  "parameter": [
    {
      "name": "resource",
      "resource": {
        "resourceType": "Patient",
        "name": [{"family": "Doe"}]
      }
    },
    {
      "name": "profile",
      "valueUri": "http://hl7.org/fhir/StructureDefinition/Patient"
    }
  ]
}

$export

Export all resources (if supported):
POST /fhir/$export
Content-Type: application/fhir+json

{
  "resourceType": "Parameters",
  "parameter": [
    {
      "name": "_outputFormat",
      "valueString": "application/fhir+ndjson"
    },
    {
      "name": "_type",
      "valueString": "Patient,Observation"
    }
  ]
}

$everything

Get all resources (if supported):
GET /fhir/$everything

Request Format

Operations use a Parameters resource for input:
{
  "resourceType": "Parameters",
  "parameter": [
    {
      "name": "parameter-name",
      "valueString": "parameter-value"
    },
    {
      "name": "resource",
      "resource": {
        "resourceType": "Patient",
        ...
      }
    }
  ]
}

Response

Success (200 OK)

Returns operation results, typically as a Parameters resource or a Bundle:
{
  "resourceType": "Parameters",
  "parameter": [
    {
      "name": "result",
      "valueBoolean": true
    },
    {
      "name": "message",
      "valueString": "Validation passed"
    }
  ]
}

Error (400 Bad Request)

Returns an OperationOutcome if the operation fails:
{
  "resourceType": "OperationOutcome",
  "issue": [
    {
      "severity": "error",
      "code": "invalid",
      "details": {
        "text": "Operation $unknown not supported"
      }
    }
  ]
}

Available Operations

The available system-level operations depend on server configuration. Check the capability statement (/fhir/metadata) to see which operations are supported:
{
  "rest": [
    {
      "operation": [
        {
          "name": "$validate",
          "definition": "http://hl7.org/fhir/OperationDefinition/Resource-validate"
        },
        {
          "name": "$export",
          "definition": "http://hl7.org/fhir/OperationDefinition/System-export"
        }
      ]
    }
  ]
}

Notes

  • System operations affect the entire server
  • Available operations are listed in the capability statement
  • Operations may require specific permissions
  • Use POST when operations require input parameters
  • Operation names are case-sensitive and start with $