The Opala Solution
The Opala Patient Access API Opala FHIR Documentation Resources and Interactions API Searches

SMART App Launch Framework SMART on FHIR: Authorization Flows SMART on FHIR: Access Tokens SMART on FHIR: Scopes SMART on FHIR: Endpoints
Working with the FHIR Server: Reading Data

CARIN for Blue Button® Da Vinci Payer Data Exchange (PDex) Mapping Adjudicated Claims and Encounter Information

The Patient Access API

© 2021-2023 Opala. All Rights Reserved.

Version 1.0.1.0


Contact Opala's
Documentation Team

Reading Data

Diff Operation

The $diff operation can be used to generate a differential between two versions of a resource, or even two different resources of the same type.

Differentials generated by this operation are in FHIR Patch format.

In generated differentials where a value has changed (i.e., a replace operation), an additional part value will be present on the given operation called previousValue. This part shows the value as it was in the from version of the resource.

Diff Instance

When the $diff operation is invoked at the instance level (i.e., it is invoked on a specific resource ID), the operation will compare two versions of the given resource.

Parameters

To invoke the $diff operation:

GET http://fhir.example.com/baseR4/Patient/123/$diff

The server will produce a response similar to the following:

{
    "resourceType": "Parameters",
    "parameter": [ {
      "name": "operation",
      "part": [ {
        "name": "type",
        "valueCode": "replace"
      }, {
        "name": "path",
        "valueString": "Patient.name.family"
      }, {
        "name": "previousValue",
        "valueId": "Smyth"
      }, {
        "name": "value",
        "valueId": "SmithB"
      } ]
    } ]
}

Diff Type

When the $diff operation is invoked at the type level (meaning it is invoked on a resource type but not on an individual instance), it will compare two different resources of the same type.

Parameters

To invoke the $diff operation at the type level:

GET http://fhir.example.com/baseR4/$diff?from=Patient/1&to=Patient/2

The server will produce a response similar to the following:

{
    "resourceType": "Parameters",
    "parameter": [ {
      "name": "operation",
      "part": [ {
        "name": "type",
        "valueCode": "replace"
      }, {
        "name": "path",
        "valueString": "Patient.id"
      }, {
        "name": "previousValue",
        "valueId": "1"
      }, {
        "name": "value",
        "valueId": "2"
      } ]
    } ]
  }

$everything operation

The HAPI-FHIR jpa server supports the Patient/$everything operation and accepts all the IN parameters defined in the documentation. Additionally, Opala enables you to provide an _id parameter, in order to filter the set of patients you wish to get everything for. The following requests are all equivalent, and these example queries fetch everything for Patient/1, Patient/2 and Patient/3:

  1. Using a GET.
    GET [base]/Patient/$everything?_id=1,2,3
  2. Using a GET with alternate _id parameter style.
    GET [base]/Patient/$everything?_id=1&_id=2&_id=3
  3. Using a POST.
    POST [base]/Patient/$everything
    {
        "resourceType": "Parameters",
        "parameter": [ {
           "name": "_id",
           "valueString": "1"
        }, {
           "name": "_id",
        },{
           "name": "_id",
           "valueString": "3"
        }
        ]
     }
  4. Making 3 individual instance-level $everything operation calls.
    GET [base]/Patient/1/$everything
    GET [base]/Patient/2/$everything
    GET [base]/Patient/3/$everything
Top