Execute FHIR bundle operation

POST/fhir-provider/{fhir_provider_id}/fhir

Executes a FHIR Bundle transaction or batch operation on the specified provider. This allows multiple FHIR resources to be processed in a single request.

The request body should contain a valid FHIR Bundle resource with transaction or batch type.

The request is proxied to the configured FHIR server with appropriate authentication headers.

RequiresBearerauthentication

Header parameters

X-Phenoml-On-Behalf-Ofstringoptional

Optional header for on-behalf-of authentication. Used when making requests on behalf of another user or entity. Must be in the format: Patient/{uuid} or Practitioner/{uuid}

X-Phenoml-Fhir-Providerstringoptional

Optional header for FHIR provider authentication. Contains credentials in the format {fhir_provider_id}:{oauth2_token}. Multiple FHIR provider integrations can be provided as comma-separated values.

Path parameters

fhir_provider_idstringrequired

The ID of the FHIR provider to use. Can be either:

  • A UUID representing the provider ID
  • A provider name (legacy support - will just use the most recently updated provider with this name)
Returns  

Bundle executed successfully

POSTRequest
curl -X POST 'https://experiment.app.pheno.ml/fhir-provider/%7Bfhir_provider_id%7D/fhir' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "resourceType": "Bundle",
  "type": "transaction",
  "entry": [
    {
      "request": {
        "method": "POST",
        "url": "Patient"
      },
      "resource": {
        "resourceType": "Patient",
        "name": [
          {
            "family": "Doe",
            "given": [
              "John"
            ]
          }
        ]
      }
    },
    {
      "request": {
        "method": "POST",
        "url": "Observation"
      },
      "resource": {
        "resourceType": "Observation",
        "status": "final",
        "subject": {
          "reference": "Patient/123"
        }
      }
    }
  ]
}'
200 OKResponse
{}