arazzo: 1.0.1
info:
title: Medplum FHIR Resource Versioning
summary: Create a FHIR resource, update it to mint a new version, read its history, then read a specific version.
description: >-
A FHIR R4 resource history and versioning flow against the Medplum FHIR R4
backend. A resource is created and then updated to produce a new versionId,
the versioned resource history is read, and a specific historical version is
read back by versionId. This exercises the FHIR RESTful API vread and history
interactions and the resource meta.versionId that drives optimistic
concurrency. Every step inlines its request so the flow is self-contained.
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: resource-versioning
summary: Create and update a FHIR resource, then read its history and a specific version.
description: >-
Creates a FHIR R4 resource, updates it to mint a new versionId, reads the
resource history, and reads the specific version by versionId.
inputs:
type: object
required:
- resourceType
- resource
- updatedResource
properties:
resourceType:
type: string
description: The FHIR resource type to operate on (e.g. Patient, Observation).
resource:
type: object
description: The FHIR R4 resource body to create.
updatedResource:
type: object
description: The FHIR R4 resource body to write on update.
steps:
- stepId: createResource
description: Create the FHIR resource of the requested type.
operationId: createResource
parameters:
- name: resourceType
in: path
value: $inputs.resourceType
requestBody:
contentType: application/fhir+json
payload: $inputs.resource
successCriteria:
- condition: $statusCode == 201
outputs:
resourceId: $response.body#/id
- stepId: updateResource
description: Update the resource by id to mint a new version.
operationId: updateResource
parameters:
- name: resourceType
in: path
value: $inputs.resourceType
- name: id
in: path
value: $steps.createResource.outputs.resourceId
requestBody:
contentType: application/fhir+json
payload: $inputs.updatedResource
successCriteria:
- condition: $statusCode == 200
outputs:
versionId: $response.body#/meta/versionId
- stepId: readHistory
description: Read the versioned history for the resource.
operationId: readResourceHistory
parameters:
- name: resourceType
in: path
value: $inputs.resourceType
- name: id
in: path
value: $steps.createResource.outputs.resourceId
successCriteria:
- condition: $statusCode == 200
outputs:
history: $response.body
- stepId: readVersion
description: Read the specific historical version by versionId.
operationId: readVersion
parameters:
- name: resourceType
in: path
value: $inputs.resourceType
- name: id
in: path
value: $steps.createResource.outputs.resourceId
- name: versionId
in: path
value: $steps.updateResource.outputs.versionId
successCriteria:
- condition: $statusCode == 200
outputs:
version: $response.body
outputs:
resourceId: $steps.createResource.outputs.resourceId
versionId: $steps.updateResource.outputs.versionId
history: $steps.readHistory.outputs.history
version: $steps.readVersion.outputs.version
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.