Journl Streamed
Talk to an expertWebsite
  • Introduction
  • Getting Started
    • Sandbox Access
    • On-Premise
    • Cloud
  • Overview
    • Why Journl Streamed?
    • Licensing & Support
    • Features
    • Solution Architecture and Usage
  • API
    • FHIR API
      • Accessing FHIR Data
      • CRUD
        • Create
        • Read
        • Update
          • Versioned Update
        • Patch
        • Delete
          • Versioned Delete
    • Batch Upsert
  • Services
    • Security & Access Control
    • FHIR Modeling, Profiles, and Standards
    • Careplan Creation
    • Analysis on Demand
      • Standard Process
      • Types of Analysis
    • Custom Resources
    • Monitoring & Maintenance
  • Storage
    • Database
      • Database schema
    • Backup and Restore
    • Indexes
  • Integrations
    • Data Ingestion and Decoupling
    • Subscriptions and Event Notifications
    • BI & Analytical tools
      • Power BI
      • Tableau
      • Jupyter Notebook
Powered by GitBook
On this page
  1. API
  2. FHIR API
  3. CRUD
  4. Update

Versioned Update

Description of how to make versioned update using our FHIR API.

PreviousUpdateNextPatch

Last updated 11 months ago

PUT {base}/fhir/{type}

When performing updates, there is a risk of unintentionally overwriting recent changes made by another operation. To avoid this issue, you can use versioned updates. This involves sending an If-Match header with the versionId of the resource you intend to update.

  1. Include the If-Match Header: When you send an update request, include the If-Match header along with the versionId of the resource you are updating.

  2. Version Matching: The server will compare the provided versionId with the current version of the resource.

  3. Successful Update: If the versions match, the update will proceed successfully.

  4. Conflict Handling: If the versions do not match, the server will respond with an OperationOutcome containing a conflict code. This indicates that the resource has been modified since you last retrieved it, and your update has not been applied to prevent data loss.

Using versioned updates helps ensure data integrity and prevents the loss of recent changes made by other users or processes.

Below is an example of how to use a versioned PUT request to update a resource. A complete list of resources can be found by visiting the resource specifications .

Request PUT {base}/fhir/Patient/{id}

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <token>

If-Match

versionId

Body

{
  "name": [{"family": "Charlie"}]
}

Response

{
  "name": [
    {
      "family": "Charlie"
    }
  ],
  "id": "20304050",
  "resourceType": "Patient",
  "meta": {
    "lastUpdated": "2024-07-16T11:46:05.849929Z",
    "versionId": "540520",
    "extension": [
      {
        "url": "ex:createdAt",
        "valueInstant": "2024-07-16T10:08:33.753699Z"
      }
    ]
  }
}
{
  "success": "Created"
}
{
  "error": "Unauthorized"
}
{
  "error": "Unprocessable"
}
here