Medplum · Arazzo Workflow

Medplum Amend Resource With History

Version 1.0.0

Read a resource, update it, then inspect its version history and prior version.

1 workflow 1 source API 1 provider
View Spec View on GitHub HealthcareFHIROpen-SourceDeveloper PlatformHIPAASMART on FHIRClinicalInteroperabilityArazzoWorkflows

Provider

medplum

Workflows

amend-resource-with-history
Update a resource and walk its version history.
Reads a resource, updates it with a supplied body, reads the history Bundle, and then reads a specific prior version by versionId.
4 steps inputs: resourceBody, resourceId, resourceType outputs: newVersionId, priorVersionId
1
readCurrent
Read the current version of the target resource to confirm it exists before amending it.
2
applyUpdate
Perform a full FHIR update on the resource with the supplied body. This creates a new version in the resource history.
3
readHistory
Read the resource history Bundle to capture the full version timeline after the amendment.
4
readPriorVersion
Read the immediately prior version of the resource by versionId to confirm the pre-amendment state is still retrievable.

Source API Descriptions

Arazzo Workflow Specification

Raw ↑
arazzo: 1.0.1
info:
  title: Medplum Amend Resource With History
  summary: Read a resource, update it, then inspect its version history and prior version.
  description: >-
    Demonstrates FHIR resource versioning. The workflow reads any existing
    resource by type and id, performs a full update on it, then reads the
    resource history Bundle to capture the version timeline, and finally reads
    the immediately prior version by its versionId. This is the canonical
    pattern for amending a clinical record while preserving an auditable history.
    Every step spells out its FHIR request inline.
  version: 1.0.0
  x-realizes-capability-ids:
  - BC-2900.60
  x-capability-derivation:
    method: 'deterministic join: sourceDescriptions -> per-tag OpenAPI -> tag/capability edge. No classification at this step.'
    min_confidence: 0.7
    sources:
    - capability_id: BC-2900.60
      capability_name: Healthcare Interoperability Operations
      spec: medplum-fhir-api-openapi.yml
      confidence: 0.7
    model: Turbo EA Capabilities by Vincent Verdet — Turbo EA, https://github.com/vincentmakes/turbo-ea-capabilities, CC BY 4.0
sourceDescriptions:
- name: fhirApi
  url: ../openapi/medplum-fhir-api-openapi.yml
  type: openapi
workflows:
- workflowId: amend-resource-with-history
  summary: Update a resource and walk its version history.
  description: >-
    Reads a resource, updates it with a supplied body, reads the history Bundle,
    and then reads a specific prior version by versionId.
  inputs:
    type: object
    required:
    - resourceType
    - resourceId
    - resourceBody
    properties:
      resourceType:
        type: string
        description: The FHIR resource type (e.g. Patient, Observation, Encounter).
      resourceId:
        type: string
        description: The id of the existing resource to amend.
      resourceBody:
        type: object
        description: >-
          The full FHIR resource payload to write on update. Must include
          resourceType and id matching the target resource.
  steps:
  - stepId: readCurrent
    description: >-
      Read the current version of the target resource to confirm it exists before
      amending it.
    operationId: readResource
    parameters:
    - name: resourceType
      in: path
      value: $inputs.resourceType
    - name: id
      in: path
      value: $inputs.resourceId
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      currentVersionId: $response.body#/meta/versionId
  - stepId: applyUpdate
    description: >-
      Perform a full FHIR update on the resource with the supplied body. This
      creates a new version in the resource history.
    operationId: updateResource
    parameters:
    - name: resourceType
      in: path
      value: $inputs.resourceType
    - name: id
      in: path
      value: $inputs.resourceId
    requestBody:
      contentType: application/fhir+json
      payload: $inputs.resourceBody
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      newVersionId: $response.body#/meta/versionId
  - stepId: readHistory
    description: >-
      Read the resource history Bundle to capture the full version timeline after
      the amendment.
    operationId: readResourceHistory
    parameters:
    - name: resourceType
      in: path
      value: $inputs.resourceType
    - name: id
      in: path
      value: $inputs.resourceId
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      priorVersionId: $response.body#/entry/1/resource/meta/versionId
  - stepId: readPriorVersion
    description: >-
      Read the immediately prior version of the resource by versionId to confirm
      the pre-amendment state is still retrievable.
    operationId: readVersion
    parameters:
    - name: resourceType
      in: path
      value: $inputs.resourceType
    - name: id
      in: path
      value: $inputs.resourceId
    - name: versionId
      in: path
      value: $steps.readHistory.outputs.priorVersionId
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      priorResourceType: $response.body#/resourceType
  outputs:
    newVersionId: $steps.applyUpdate.outputs.newVersionId
    priorVersionId: $steps.readHistory.outputs.priorVersionId

Work with this as data

Every workflow here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for arazzo workflows

4 MCP tools reach this
  • find_arazzoBrowse and filter every workflow in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This workflow
curl "https://apis.io/api/v1/arazzo/medplum-amend-resource-with-history-workflow"
All arazzo workflows
curl "https://apis.io/api/v1/arazzo?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.