Search loading...

API Hub

Explore and Make use of Nationally Defined Messaging APIs

 

Interaction | Use Case Examples Remix

Updated Use Cases and examples illustrating requirements for operation of the FHIR® Reasonable Adjustments API

Use Case Remix

1 Initial Read Failure - No RA Record

Pre

  • None

Main

  • Practitioner searches for Patient’s RARecord
    • ClientSystem searched and failed to find existing RARecord
      • ClientSystem submits Read Consent request (for Patient, Active, etc.) (xml) (json)
      • ServerSystem submits Read Consent response (xml) (json)

http request & headers

GET https://clinicals.spineservices.nhs.uk/STU3/Consent?
 patient=999999998&
 status=active&
 category=https://fhir.nhs.uk/STU3/CodeSystem/CodeSystem-RARecord-FlagCategory-1|reasonable%20adjustments%20flag&
 _format=xml HTTP/1.1
Authorization:Bearer [jwt_token_string]
InteractionID:urn:nhs:names:services:flagserver:consent:read

http body

None

http request & headers

GET https://clinicals.spineservices.nhs.uk/STU3/Consent?
 patient=999999998&
 status=active&
 category=https://fhir.nhs.uk/STU3/CodeSystem/CodeSystem-RARecord-FlagCategory-1|reasonable%20adjustments%20flag&
 _format=json HTTP/1.1
Authorization:Bearer [jwt_token_string]
InteractionID:urn:nhs:names:services:flagserver:consent:read

http body

None

http response & headers

HTTP/1.1 404 NOT FOUND
Date:Tue, 24 Jul 2018 10:00:00 GMT
Content-Type:application/xml+fhir

DQ: Would you use full header & metadata in a failure OperationOutcome response?
DN: Can’t see why you would.
From FHIR spec, ‘The resource is not designed to be persisted or referenced from other parts of the workflow.’
Therefore it won’t have a versionId/ETag, lastModified would only ever be the same as Date, no Location as not persisted. Failure response therefore drops to minimal Date, Content-Type headers.

http body

Read Fail Operation Outcome XML Example

<OperationOutcome xmlns="http://hl7.org/fhir">
    <id value="44d3b0d1-013e-43bd-ad99-994e8cbae769"/>
    <meta>
        <profile value="https://fhir.nhs.uk/STU3/StructureDefinition/Spine-OperationOutcome-1"/>
    </meta>
    <issue>
        <severity value="error"/>
        <code value="not-found"/>
        <details>
            <coding>
                <system value="https://fhir.nhs.uk/STU3/ValueSet/Spine-ErrorOrWarningCode-1"/>
                <code value="NO_RECORD_FOUND"/>
                <display value="No record found"/>
            </coding>
        </details>
    </issue>
</OperationOutcome>

http response & headers

HTTP/1.1 404 PATIENT NOT FOUND
Date:Tue, 24 Jul 2018 10:00:00 GMT
Content-Type:application/json+fhir

http body

Read Fail Operation Outcome JSON Example

{
  "resourceType": "OperationOutcome",
  "id": "44d3b0d1-013e-43bd-ad99-994e8cbae769",
  "meta": {
    "profile": [
      "https://fhir.nhs.uk/STU3/StructureDefinition/Spine-OperationOutcome-1"
    ]
  },
  "issue": [
    {
      "severity": "error",
      "code": "not-found",
      "details": {
        "coding": [
          {
            "system": "https://fhir.nhs.uk/STU3/ValueSet/Spine-ErrorOrWarningCode-1",
            "code": "NO_RECORD_FOUND",
            "display": "No record found"
          }
        ]
      }
    }
  ]
}

2 Multiple Conditions Read (one with freetext)

Pre

  • Practitioner creates RARecord, recording Consent from Patient and that Impairment is ‘Learning Disability’.
  • Patient declines to record a specific Adjustment at this time. see Create RARecord Use Case
  • Practitioner adds Impairment ‘Mental Health Condition’, supporting Information ‘Patient diagnosed with Stranger anxiety (disorder). Consider home-visit.’

Main

  • Patient arrives for appointment; Practitioner retrieves Patient’s RARecord.
    • ClientSystem queries ServerSystem to retrieve RARecord
      • ClientSystem submits Read Consent request (for Patient, Active, etc.)
        • ServerSystem submits Read Consent response
      • ClientSystem submits Read Flag request (for Patient, Active, etc.)
        • ServerSystem submits Read Flag response

          [Read Consent and Read Flag not illustrated - these are identical to existing Read RA Record Use Case]

      • ClientSystem submits Read List request (for Patient, Active, etc.) (xml) (json)
      • ClientSystem submits Read Conditions request (xml) (json)
        • ServerSystem submits Read Conditions response (xml) (json)

2.1 Read List request - xml example

http request & headers

GET https://clinicals.spineservices.nhs.uk/STU3/List?
 patient=999999998&
 status=current&
 code=http://snomed.info/sct|1094391000000102&
 _format=xml HTTP/1.1
Authorization:Bearer [jwt_token_string]
InteractionID:urn:nhs:names:services:flagserver:list:read

http body

None

2.2 Read List request - json example

http request & headers

GET https://clinicals.spineservices.nhs.uk/STU3/List?
 patient=999999998&
 status=current&
 code=http://snomed.info/sct|1094391000000102&
 _format=json HTTP/1.1
Authorization:Bearer [jwt_token_string]
InteractionID:urn:nhs:names:services:flagserver:list:read

http body

None

2.3 Read List response - xml example

http response & headers

HTTP/1.1 200 OK
Date:Tue, 24 Jul 2018 10:00:00 GMT
Last-Modified:2018-07-24T10:00:00+00:00
ETag: W/"9b8509a6-2330-448c-aefc-1d6f723f3e5e”
Content-Type:application/xml+fhir

http body

Read List response bundle XML Example

<Bundle xmlns="http://hl7.org/fhir">
  <id value="2dce9ecf-75c6-4ad5-a770-4f035419c229"/>
  <meta>
    <versionId value="9b8509a6-2330-448c-aefc-1d6f723f3e5e"/>
    <lastUpdated value="2018-07-24T10:00:00+00:00"/>
    <profile value="http://hl7.org/fhir/bundle"/>
  </meta>
  <type value="searchset"/>
  <total value="1"/>
  <link>
    <relation value="self"/>
    <url value="https://clinicals.spineservices.nhs.uk/STU3/List?patient=999999998&amp;status=active&amp;code=http://snomed.info/sct|1094391000000102&amp;_format=xml"/>
  </link>
  <entry>
    <fullUrl value="https://clinicals.spineservices.nhs.uk/STU3/List/4c8d19af-7755-4954-93df-93c964ddf349"/>
    <resource>
        <List>
            <id value="4c8d19af-7755-4954-93df-93c964ddf349"/>
            <meta>
                <versionId value="bb325b55-e8a0-41df-84bd-3ac2b026ab5b"/>
                <lastUpdated value="2016-03-01T10:04:33+00:00"/>
                <profile value="https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-RARecord-List-1"/>
            </meta>
            <status value="current"/>
            <mode value="changes"/>
            <title value="Reasonable Adjustment List"/>
            <code>
                <coding>
                    <system value="http://snomed.info/sct"/>
                    <code value="1094391000000102"/>
                    <display value="Reasonable adjustments for health and care access"/>
                </coding>
            </code>
            <subject>
                    <reference value="demographics.spineservices.nhs.uk/STU3/Patient/999999998"/>
            </subject>
            <date value="2018-05-25T00:00:00Z"/>
            <entry>
                <deleted value="false"/>
                <date value="2018-05-25T00:00:00Z"/>
                <item>
                    <reference value="https://clinicals.spineservices.nhs.uk/STU3/Condition/6c1ccd3f-765e-41d8-b5c0-2a0317908502"/>
                </item>
            </entry>
            <entry>
                <deleted value="false"/>
                <date value="2018-06-02T00:00:00Z"/>
                <item>
                    <reference value="https://clinicals.spineservices.nhs.uk/STU3/Condition/13aec731-02c5-42a2-b863-de889479e777"/>
                </item>
            </entry>
        </List>
    </resource>
    <search>
      <mode value="match"/>
    </search>
  </entry>
</Bundle>

2.4 Read List response - json example

http response & headers

HTTP/1.1 200 OK
Date:Tue, 24 Jul 2018 10:00:00 GMT
Last-Modified:2018-07-24T10:00:00+00:00
ETag: W/"9b8509a6-2330-448c-aefc-1d6f723f3e5e”
Content-Type:application/json+fhir

http body

Read List response bundle JSON Example

{
  "resourceType": "Bundle",
  "id": "2dce9ecf-75c6-4ad5-a770-4f035419c229",
  "meta": {
    "versionId": "9b8509a6-2330-448c-aefc-1d6f723f3e5e",
    "lastUpdated": "2018-07-24T10:00:00+00:00",
    "profile": [
      "http://hl7.org/fhir/bundle"
    ]
  },
  "type": "searchset",
  "total": 1,
  "link": [
    {
      "relation": "self",
      "url": "https://clinicals.spineservices.nhs.uk/STU3/List?patient=999999998&status=active&code=http://snomed.info/sct|1094391000000102&_format=xml"
    }
  ],
  "entry": [
    {
      "fullUrl": "https://clinicals.spineservices.nhs.uk/STU3/List/4c8d19af-7755-4954-93df-93c964ddf349",
      "resource": {
        "resourceType": "List",
        "id": "4c8d19af-7755-4954-93df-93c964ddf349",
        "meta": {
          "versionId": "bb325b55-e8a0-41df-84bd-3ac2b026ab5b",
          "lastUpdated": "2016-03-01T10:04:33+00:00",
          "profile": [
            "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-RARecord-List-1"
          ]
        },
        "status": "current",
        "mode": "changes",
        "title": "Reasonable Adjustment List",
        "code": {
          "coding": [
            {
              "system": "http://snomed.info/sct",
              "code": "1094391000000102",
              "display": "Reasonable adjustments for health and care access"
            }
          ]
        },
        "subject": {
          "reference": "demographics.spineservices.nhs.uk/STU3/Patient/999999998"
        },
        "date": "2018-05-25T00:00:00Z",
        "entry": [
          {
            "deleted": false,
            "date": "2018-05-25T00:00:00Z",
            "item": {
              "reference": "https://clinicals.spineservices.nhs.uk/STU3/Condition/6c1ccd3f-765e-41d8-b5c0-2a0317908502"
            }
          },
          {
            "deleted": false,
            "date": "2018-06-02T00:00:00Z",
            "item": {
              "reference": "https://clinicals.spineservices.nhs.uk/STU3/Condition/13aec731-02c5-42a2-b863-de889479e777"
            }
          }
        ]
      },
      "search": {
        "mode": "match"
      }
    }
  ]
}

2.5 Read Conditions request - xml example

http request & headers

GET https://clinicals.spineservices.nhs.uk/STU3/Condition?
 _list=4c8d19af-7755-4954-93df-93c964ddf349&
 clinical-status=active&
 _format=xml HTTP/1.1
Authorization:Bearer [jwt_token_string]
InteractionID:urn:nhs:names:services:flagserver:condition:read

Idiomatically this is ‘Get all Conditions on List 4c8d19af-7755-4954-93df-93c964ddf349, whose clinicalStatus is active’.
NB.Spelling of search parameter ‘clinical-status’ versus element Condition.clinicalStatus

http body

None

2.6 Read Conditions request - json example

http request & headers

GET https://clinicals.spineservices.nhs.uk/STU3/Condition?
 _list=4c8d19af-7755-4954-93df-93c964ddf349&
 clinical-status=active&
 _format=json HTTP/1.1
Authorization:Bearer [jwt_token_string]
InteractionID:urn:nhs:names:services:flagserver:condition:read

Idiomatically this is ‘Get all Conditions on List 4c8d19af-7755-4954-93df-93c964ddf349, whose clinicalStatus is active’.
NB.Spelling of search parameter ‘clinical-status’ versus element Condition.clinicalStatus

http body

None

2.7 Read Conditions response - xml example

http response & headers

HTTP/1.1 200 OK
Date:Tue, 24 Jul 2018 10:00:01 GMT
Last-Modified:2018-07-24T10:00:01+00:00
ETag: W/"ded2da33-64c9-4c8d-8e3a-6a037823d0c6”
Content-Type:application/xml+fhir

http body

Read Conditions response bundle XML Example

<Bundle xmlns="http://hl7.org/fhir">
  <id value="7d58f378-282e-48f0-b6b3-3f78d5870502"/>
  <meta>
    <versionId value="ded2da33-64c9-4c8d-8e3a-6a037823d0c6"/>
    <lastUpdated value="2018-07-24T10:00:01+00:00"/>
    <profile value="http://hl7.org/fhir/bundle"/>
  </meta>
  <type value="searchset"/>
  <total value="2"/>
  <link>
    <relation value="self"/>
    <url value="https://clinicals.spineservices.nhs.uk/STU3/Condition?_list=4c8d19af-7755-4954-93df-93c964ddf349&amp;clinical-status=active&amp;_format=xml"/>
  </link>
  <entry>
    <fullUrl value="https://clinicals.spineservices.nhs.uk/STU3/Condition/6c1ccd3f-765e-41d8-b5c0-2a0317908502"/>
    <resource>
        <Condition>
            <id value="6c1ccd3f-765e-41d8-b5c0-2a0317908502"/>
            <meta>
                <versionId value="e36bfb0d-1cb9-47d0-bd44-15c56b0c11b4"/>
                <lastUpdated value="2018-03-01T10:00:00+00:00"/>
                <profile value="https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-RARecord-Condition-1" />
            </meta>
            <contained>
                <Provenance>
                    <id value="8ce7de6b-1307-432d-8e96-ae6a613ca3e4"/>
                    <meta>
                        <profile value="https://fhir.nhs.uk/STU3/StructureDefinition/RARecord-Provenance-1"/>
                    </meta>
                    <target>
                        <reference value="Condition/6c1ccd3f-765e-41d8-b5c0-2a0317908502"/>
                    </target>
                    <recorded value="2016-03-01T10:05:33+00:00"/>
                    <agent>
                        <role>
                            <coding>
                                <system value="https://fhir.nhs.uk/STU3/CodeSystem/CareConnect-SDSJobRoleName-1"/>
                                <code value="R0260"/>
                                <display value="General Medical Practitioner"/>
                            </coding>
                        </role>
                        <whoReference>
                            <reference value="https://sds.spineservices.nhs.uk/STU3/Practitioner/2ee4tr6a9"/>
                            <display value="Dr.D"/>
                        </whoReference>
                        <onBehalfOfReference>
                            <reference value="https://directory.spineservices.nhs.uk/STU3/Organization/a3e5i7"/>
                            <display value="Some GP Clinic"/>
                        </onBehalfOfReference>
                    </agent>
                </Provenance>
            </contained>
            <extension url="https://fhir.nhs.uk/STU3/StructureDefinition/Extension-RARecord-Provenance-1">
                <extension url="created">
                    <valueReference>
                        <reference value="#8ce7de6b-1307-432d-8e96-ae6a613ca3e4"/>
                    </valueReference>
                </extension>
            </extension>
            <clinicalStatus value="active"/>
            <category>
                <coding>
                    <system value="https://fhir.hl7.org.uk/STU3/CodeSystem/CareConnect-ConditionCategory-1"/>
                    <code value="issue"/>
                    <display value="Issue"/>
                </coding>
            </category>
            <code>
                <coding>
                    <system value="https://fhir.nhs.uk/STU3/CodeSystem/CodeSystem-RARecord-ConditionCode-1"/>
                    <code value="1855002"/>
                    <display value="Learning Disability(s)"/>
                </coding>
            </code>
            <subject>
                <identifier>
                    <reference value="demographics.spineservices.nhs.uk/STU3/Patient/999999998"/>
                </identifier>
            </subject>
        </Condition>
    </resource>
    <search>
      <mode value="match"/>
    </search>
  </entry>
  <entry>
    <fullUrl value="https://clinicals.spineservices.nhs.uk/STU3/Condition/13aec731-02c5-42a2-b863-de889479e777"/>
    <resource>
        <Condition>
            <id value="13aec731-02c5-42a2-b863-de889479e777"/>
            <meta>
                <versionId value="cf8e1249-dfa6-4003-9745-d1b213008c95"/>
                <lastUpdated value="2018-03-01T10:01:00+00:00"/>
                <profile value="https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-RARecord-Condition-1" />
            </meta>
            <contained>
                <Provenance>
                    <id value="8ce7de6b-1307-432d-8e96-ae6a613ca3e4"/>
                    <meta>
                        <profile value="https://fhir.nhs.uk/STU3/StructureDefinition/RARecord-Provenance-1"/>
                    </meta>
                    <target>
                        <reference value="Condition/13aec731-02c5-42a2-b863-de889479e777"/>
                    </target>
                    <recorded value="2016-03-01T10:05:33+00:00"/>
                    <agent>
                        <role>
                            <coding>
                                <system value="https://fhir.nhs.uk/STU3/CodeSystem/CareConnect-SDSJobRoleName-1"/>
                                <code value="R0260"/>
                                <display value="General Medical Practitioner"/>
                            </coding>
                        </role>
                        <whoReference>
                            <reference value="https://sds.spineservices.nhs.uk/STU3/Practitioner/2ee4tr6a9"/>
                            <display value="Dr.D"/>
                        </whoReference>
                        <onBehalfOfReference>
                            <reference value="https://directory.spineservices.nhs.uk/STU3/Organization/a3e5i7"/>
                            <display value="Some GP Clinic"/>
                        </onBehalfOfReference>
                    </agent>
                </Provenance>
            </contained>
            <extension url="https://fhir.nhs.uk/STU3/StructureDefinition/Extension-RARecord-Provenance-1">
                <extension url="created">
                    <valueReference>
                        <reference value="#8ce7de6b-1307-432d-8e96-ae6a613ca3e4"/>
                    </valueReference>
                </extension>
            </extension>
            <clinicalStatus value="active"/>
            <category>
                <coding>
                    <system value="https://fhir.hl7.org.uk/STU3/CodeSystem/CareConnect-ConditionCategory-1"/>
                    <code value="issue"/>
                    <display value="Issue"/>
                </coding>
            </category>
            <code>
                <coding>
                    <system value="https://fhir.nhs.uk/STU3/CodeSystem/CodeSystem-RARecord-ConditionCode-1"/>
                    <code value="720821000000105"/>
                    <display value="Mental health condition(s)"/>
                </coding>
                <text value="Patient diagnosed with Stranger anxiety (disorder). Consider home-visit"/>
            </code>
            <subject>
                <identifier>
                    <reference value="demographics.spineservices.nhs.uk/STU3/Patient/999999998"/>
                </identifier>
            </subject>
        </Condition>
    </resource>
    <search>
      <mode value="match"/>
    </search>
  </entry>
</Bundle>

2.8 Read Conditions response - json example

http response & headers

HTTP/1.1 200 OK
Date:Tue, 24 Jul 2018 10:00:01 GMT
Last-Modified:2018-07-24T10:00:01+00:00
ETag: W/"ded2da33-64c9-4c8d-8e3a-6a037823d0c6”
Content-Type:application/json+fhir

http body

Read Conditions response bundle JSON Example

{
  "resourceType": "Bundle",
  "id": "7d58f378-282e-48f0-b6b3-3f78d5870502",
  "meta": {
    "versionId": "ded2da33-64c9-4c8d-8e3a-6a037823d0c6",
    "lastUpdated": "2018-07-24T10:00:01+00:00",
    "profile": [
      "http://hl7.org/fhir/bundle"
    ]
  },
  "type": "searchset",
  "total": 2,
  "link": [
    {
      "relation": "self",
      "url": "https://clinicals.spineservices.nhs.uk/STU3/Condition?_list=4c8d19af-7755-4954-93df-93c964ddf349&clinical-status=active&_format=xml"
    }
  ],
  "entry": [
    {
      "fullUrl": "https://clinicals.spineservices.nhs.uk/STU3/Condition/6c1ccd3f-765e-41d8-b5c0-2a0317908502",
      "resource": {
        "resourceType": "Condition",
        "id": "6c1ccd3f-765e-41d8-b5c0-2a0317908502",
        "meta": {
          "versionId": "e36bfb0d-1cb9-47d0-bd44-15c56b0c11b4",
          "lastUpdated": "2018-03-01T10:00:00+00:00",
          "profile": [
            "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-RARecord-Condition-1"
          ]
        },
        "contained": [
          {
            "resourceType": "Provenance",
            "id": "8ce7de6b-1307-432d-8e96-ae6a613ca3e4",
            "meta": {
              "profile": [
                "https://fhir.nhs.uk/STU3/StructureDefinition/RARecord-Provenance-1"
              ]
            },
            "target": [
              {
                "reference": "Condition/6c1ccd3f-765e-41d8-b5c0-2a0317908502"
              }
            ],
            "recorded": "2016-03-01T10:05:33+00:00",
            "agent": [
              {
                "role": [
                  {
                    "coding": [
                      {
                        "system": "https://fhir.nhs.uk/STU3/CodeSystem/CareConnect-SDSJobRoleName-1",
                        "code": "R0260",
                        "display": "General Medical Practitioner"
                      }
                    ]
                  }
                ],
                "whoReference": {
                  "reference": "https://sds.spineservices.nhs.uk/STU3/Practitioner/2ee4tr6a9",
                  "display": "Dr.D"
                },
                "onBehalfOfReference": {
                  "reference": "https://directory.spineservices.nhs.uk/STU3/Organization/a3e5i7",
                  "display": "Some GP Clinic"
                }
              }
            ]
          }
        ],
        "extension": [
          {
            "url": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-RARecord-Provenance-1",
            "extension": [
              {
                "url": "created",
                "valueReference": {
                  "reference": "#8ce7de6b-1307-432d-8e96-ae6a613ca3e4"
                }
              }
            ]
          }
        ],
        "clinicalStatus": "active",
        "category": [
          {
            "coding": [
              {
                "system": "https://fhir.hl7.org.uk/STU3/CodeSystem/CareConnect-ConditionCategory-1",
                "code": "issue",
                "display": "Issue"
              }
            ]
          }
        ],
        "code": {
          "coding": [
            {
              "system": "https://fhir.nhs.uk/STU3/CodeSystem/CodeSystem-RARecord-ConditionCode-1",
              "code": "1855002",
              "display": "Learning Disability(s)"
            }
          ]
        }
      },
      "search": {
        "mode": "match"
      }
    },
    {
      "fullUrl": "https://clinicals.spineservices.nhs.uk/STU3/Condition/13aec731-02c5-42a2-b863-de889479e777",
      "resource": {
        "resourceType": "Condition",
        "id": "13aec731-02c5-42a2-b863-de889479e777",
        "meta": {
          "versionId": "cf8e1249-dfa6-4003-9745-d1b213008c95",
          "lastUpdated": "2018-03-01T10:01:00+00:00",
          "profile": [
            "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-RARecord-Condition-1"
          ]
        },
        "contained": [
          {
            "resourceType": "Provenance",
            "id": "8ce7de6b-1307-432d-8e96-ae6a613ca3e4",
            "meta": {
              "profile": [
                "https://fhir.nhs.uk/STU3/StructureDefinition/RARecord-Provenance-1"
              ]
            },
            "target": [
              {
                "reference": "Condition/13aec731-02c5-42a2-b863-de889479e777"
              }
            ],
            "recorded": "2016-03-01T10:05:33+00:00",
            "agent": [
              {
                "role": [
                  {
                    "coding": [
                      {
                        "system": "https://fhir.nhs.uk/STU3/CodeSystem/CareConnect-SDSJobRoleName-1",
                        "code": "R0260",
                        "display": "General Medical Practitioner"
                      }
                    ]
                  }
                ],
                "whoReference": {
                  "reference": "https://sds.spineservices.nhs.uk/STU3/Practitioner/2ee4tr6a9",
                  "display": "Dr.D"
                },
                "onBehalfOfReference": {
                  "reference": "https://directory.spineservices.nhs.uk/STU3/Organization/a3e5i7",
                  "display": "Some GP Clinic"
                }
              }
            ]
          }
        ],
        "extension": [
          {
            "url": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-RARecord-Provenance-1",
            "extension": [
              {
                "url": "created",
                "valueReference": {
                  "reference": "#8ce7de6b-1307-432d-8e96-ae6a613ca3e4"
                }
              }
            ]
          }
        ],
        "clinicalStatus": "active",
        "category": [
          {
            "coding": [
              {
                "system": "https://fhir.hl7.org.uk/STU3/CodeSystem/CareConnect-ConditionCategory-1",
                "code": "issue",
                "display": "Issue"
              }
            ]
          }
        ],
        "code": {
          "coding": [
            {
              "system": "https://fhir.nhs.uk/STU3/CodeSystem/CodeSystem-RARecord-ConditionCode-1",
              "code": "720821000000105",
              "display": "Mental health condition(s)"
            }
          ],
          "text": "Patient diagnosed with Stranger anxiety (disorder). Consider home-visit"
        }
      },
      "search": {
        "mode": "match"
      }
    }
  ]
}

3 Update Contention Failure

Although unlikely, Update Contention is possible. This scenario illustrates the case where Practitioners A and B try to update a resource ‘at the same time’. ‘Optimistic locking’ is used, so A, who writes first ‘wins’.

Pre

  • Practitioner A reads Patient’s RARecord
  • Practitioner B reads Patient’s RARecord

Main

  • Practitioner A updates Patient’s RARecord, Remove an Impairment ‘Mental Health Condition’ operation
    • Practitioner A commits update
      • ClientSystem submits Delete Condition (A) request (xml) (json)
        • ServerSystem submits Delete Condition (A) response (xml) (json)
      • ClientSystem submits Update List request (xml) (json)
        • ServerSystem submits Update List response (xml) (json)
  • Practitioner B updates Patient’s RARecord, Remove an Impairment ‘Mental Health Condition’ operation
    • Practitioner B commits update
      • ClientSystem submits Delete Condition (B) request (xml) (json)
        • ServerSystem submits Delete Condition (B) response (failure) (xml) (json)
      • ClientSystem reports failure, aborts.

3.1 Delete Condition (A) request - xml example

http request & headers

PUT https://clinicals.spineservices.nhs.uk/STU3/Condition/13aec731-02c5-42a2-b863-de889479e777
 Authorization:Bearer [jwt_token_string]
 InteractionID:urn:nhs:names:services:flagserver:condition:update
 If-Match:W/"cf8e1249-dfa6-4003-9745-d1b213008c95"

http body

Delete Condition request example XML Example

        <Condition>
            <id value="13aec731-02c5-42a2-b863-de889479e777"/>
            <meta>
                <versionId value="cf8e1249-dfa6-4003-9745-d1b213008c95"/>
                <lastUpdated value="2018-03-01T10:01:00+00:00"/>
                <profile value="https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-RARecord-Condition-1" />
            </meta>
            <contained>
                <Provenance>
                    <id value="8ce7de6b-1307-432d-8e96-ae6a613ca3e4"/>
                    <meta>
                        <profile value="https://fhir.nhs.uk/STU3/StructureDefinition/RARecord-Provenance-1"/>
                    </meta>
                    <target>
                        <reference value="Condition/13aec731-02c5-42a2-b863-de889479e777"/>
                    </target>
                    <recorded value="2016-03-01T10:05:33+00:00"/>
                    <agent>
                        <role>
                            <coding>
                                <system value="https://fhir.nhs.uk/STU3/CodeSystem/CareConnect-SDSJobRoleName-1"/>
                                <code value="R0260"/>
                                <display value="General Medical Practitioner"/>
                            </coding>
                        </role>
                        <whoReference>
                            <reference value="https://sds.spineservices.nhs.uk/STU3/Practitioner/2ee4tr6a9"/>
                            <display value="Dr.D"/>
                        </whoReference>
                        <onBehalfOfReference>
                            <reference value="https://directory.spineservices.nhs.uk/STU3/Organization/a3e5i7"/>
                            <display value="Some GP Clinic"/>
                        </onBehalfOfReference>
                    </agent>
                </Provenance>
            </contained>
            <extension url="https://fhir.nhs.uk/STU3/StructureDefinition/Extension-RARecord-Provenance-1">
                <extension url="created">
                    <valueReference>
                        <reference value="#8ce7de6b-1307-432d-8e96-ae6a613ca3e4"/>
                    </valueReference>
                </extension>
            </extension>
            <clinicalStatus value="inactive"/>
            <category>
                <coding>
                    <system value="https://fhir.hl7.org.uk/STU3/CodeSystem/CareConnect-ConditionCategory-1"/>
                    <code value="issue"/>
                    <display value="Issue"/>
                </coding>
            </category>
            <code>
                <coding>
                    <system value="https://fhir.nhs.uk/STU3/CodeSystem/CodeSystem-RARecord-ConditionCode-1"/>
                    <code value="720821000000105"/>
                    <display value="Mental health condition(s)"/>
                </coding>
                <text value="Patient diagnosed with Stranger anxiety (disorder). Consider home-visit"/>
            </code>
            <subject>
                <identifier>
                    <reference value="demographics.spineservices.nhs.uk/STU3/Patient/999999998"/>
                </identifier>
            </subject>
        </Condition>

3.2 Delete Condition (A) request - json example

http request & headers

PUT https://clinicals.spineservices.nhs.uk/STU3/Condition/13aec731-02c5-42a2-b863-de889479e777
 Authorization:Bearer [jwt_token_string]
 InteractionID:urn:nhs:names:services:flagserver:condition:update
 If-Match:W/"cf8e1249-dfa6-4003-9745-d1b213008c95"

http body

Delete Condition request example JSON Example

{
  "resourceType": "Condition",
  "id": "13aec731-02c5-42a2-b863-de889479e777",
  "meta": {
    "versionId": "cf8e1249-dfa6-4003-9745-d1b213008c95",
    "lastUpdated": "2018-03-01T10:01:00+00:00",
    "profile": [
      "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-RARecord-Condition-1"
    ]
  },
  "contained": [
    {
      "resourceType": "Provenance",
      "id": "8ce7de6b-1307-432d-8e96-ae6a613ca3e4",
      "meta": {
        "profile": [
          "https://fhir.nhs.uk/STU3/StructureDefinition/RARecord-Provenance-1"
        ]
      },
      "target": [
        {
          "reference": "Condition/13aec731-02c5-42a2-b863-de889479e777"
        }
      ],
      "recorded": "2016-03-01T10:05:33+00:00",
      "agent": [
        {
          "role": [
            {
              "coding": [
                {
                  "system": "https://fhir.nhs.uk/STU3/CodeSystem/CareConnect-SDSJobRoleName-1",
                  "code": "R0260",
                  "display": "General Medical Practitioner"
                }
              ]
            }
          ],
          "whoReference": {
            "reference": "https://sds.spineservices.nhs.uk/STU3/Practitioner/2ee4tr6a9",
            "display": "Dr.D"
          },
          "onBehalfOfReference": {
            "reference": "https://directory.spineservices.nhs.uk/STU3/Organization/a3e5i7",
            "display": "Some GP Clinic"
          }
        }
      ]
    }
  ],
  "extension": [
    {
      "url": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-RARecord-Provenance-1",
      "extension": [
        {
          "url": "created",
          "valueReference": {
            "reference": "#8ce7de6b-1307-432d-8e96-ae6a613ca3e4"
          }
        }
      ]
    }
  ],
  "clinicalStatus": "inactive",
  "category": [
    {
      "coding": [
        {
          "system": "https://fhir.hl7.org.uk/STU3/CodeSystem/CareConnect-ConditionCategory-1",
          "code": "issue",
          "display": "Issue"
        }
      ]
    }
  ],
  "code": {
    "coding": [
      {
        "system": "https://fhir.nhs.uk/STU3/CodeSystem/CodeSystem-RARecord-ConditionCode-1",
        "code": "720821000000105",
        "display": "Mental health condition(s)"
      }
    ],
    "text": "Patient diagnosed with Stranger anxiety (disorder). Consider home-visit"
  }
}

3.3 Delete Condition (A) response - xml example

http response & headers

HTTP/1.1 200 OK
Date:Tue, 24 Jul 2018 10:00:01 GMT
Last-Modified:2018-07-24T10:00:01+00:00
ETag: W/"0bf0b49c-9dfb-4587-9931-0b4a00819229”
Content-Type:application/xml+fhir

http body

Delete Condition request example XML Example

        <Condition>
            <id value="13aec731-02c5-42a2-b863-de889479e777"/>
            <meta>
                <versionId value="0bf0b49c-9dfb-4587-9931-0b4a00819229"/>
                <lastUpdated value="2018-07-24T10:00:01+00:00"/>
                <profile value="https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-RARecord-Condition-1" />
            </meta>
            <contained>
                <Provenance>
                    <id value="8ce7de6b-1307-432d-8e96-ae6a613ca3e4"/>
                    <meta>
                        <profile value="https://fhir.nhs.uk/STU3/StructureDefinition/RARecord-Provenance-1"/>
                    </meta>
                    <target>
                        <reference value="Condition/13aec731-02c5-42a2-b863-de889479e777"/>
                    </target>
                    <recorded value="2016-03-01T10:05:33+00:00"/>
                    <agent>
                        <role>
                            <coding>
                                <system value="https://fhir.nhs.uk/STU3/CodeSystem/CareConnect-SDSJobRoleName-1"/>
                                <code value="R0260"/>
                                <display value="General Medical Practitioner"/>
                            </coding>
                        </role>
                        <whoReference>
                            <reference value="https://sds.spineservices.nhs.uk/STU3/Practitioner/2ee4tr6a9"/>
                            <display value="Dr.D"/>
                        </whoReference>
                        <onBehalfOfReference>
                            <reference value="https://directory.spineservices.nhs.uk/STU3/Organization/a3e5i7"/>
                            <display value="Some GP Clinic"/>
                        </onBehalfOfReference>
                    </agent>
                </Provenance>
            </contained>
            <extension url="https://fhir.nhs.uk/STU3/StructureDefinition/Extension-RARecord-Provenance-1">
                <extension url="created">
                    <valueReference>
                        <reference value="#8ce7de6b-1307-432d-8e96-ae6a613ca3e4"/>
                    </valueReference>
                </extension>
            </extension>
            <clinicalStatus value="inactive"/>
            <category>
                <coding>
                    <system value="https://fhir.hl7.org.uk/STU3/CodeSystem/CareConnect-ConditionCategory-1"/>
                    <code value="issue"/>
                    <display value="Issue"/>
                </coding>
            </category>
            <code>
                <coding>
                    <system value="https://fhir.nhs.uk/STU3/CodeSystem/CodeSystem-RARecord-ConditionCode-1"/>
                    <code value="720821000000105"/>
                    <display value="Mental health condition(s)"/>
                </coding>
                <text value="Patient diagnosed with Stranger anxiety (disorder). Consider home-visit"/>
            </code>
            <subject>
                <identifier>
                    <reference value="demographics.spineservices.nhs.uk/STU3/Patient/999999998"/>
                </identifier>
            </subject>
        </Condition>

3.4 Delete Condition (A) response - json example

http response & headers

HTTP/1.1 200 OK
Date:Tue, 24 Jul 2018 10:00:01 GMT
Last-Modified:2018-07-24T10:00:01+00:00
ETag: W/"0bf0b49c-9dfb-4587-9931-0b4a00819229”
Content-Type:application/json+fhir

http body

Delete Condition request example JSON Example

{
  "resourceType": "Condition",
  "id": "13aec731-02c5-42a2-b863-de889479e777",
  "meta": {
    "versionId": "0bf0b49c-9dfb-4587-9931-0b4a00819229",
    "lastUpdated": "2018-07-24T10:00:01+00:00",
    "profile": [
      "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-RARecord-Condition-1"
    ]
  },
  "contained": [
    {
      "resourceType": "Provenance",
      "id": "8ce7de6b-1307-432d-8e96-ae6a613ca3e4",
      "meta": {
        "profile": [
          "https://fhir.nhs.uk/STU3/StructureDefinition/RARecord-Provenance-1"
        ]
      },
      "target": [
        {
          "reference": "Condition/13aec731-02c5-42a2-b863-de889479e777"
        }
      ],
      "recorded": "2016-03-01T10:05:33+00:00",
      "agent": [
        {
          "role": [
            {
              "coding": [
                {
                  "system": "https://fhir.nhs.uk/STU3/CodeSystem/CareConnect-SDSJobRoleName-1",
                  "code": "R0260",
                  "display": "General Medical Practitioner"
                }
              ]
            }
          ],
          "whoReference": {
            "reference": "https://sds.spineservices.nhs.uk/STU3/Practitioner/2ee4tr6a9",
            "display": "Dr.D"
          },
          "onBehalfOfReference": {
            "reference": "https://directory.spineservices.nhs.uk/STU3/Organization/a3e5i7",
            "display": "Some GP Clinic"
          }
        }
      ]
    }
  ],
  "extension": [
    {
      "url": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-RARecord-Provenance-1",
      "extension": [
        {
          "url": "created",
          "valueReference": {
            "reference": "#8ce7de6b-1307-432d-8e96-ae6a613ca3e4"
          }
        }
      ]
    }
  ],
  "clinicalStatus": "inactive",
  "category": [
    {
      "coding": [
        {
          "system": "https://fhir.hl7.org.uk/STU3/CodeSystem/CareConnect-ConditionCategory-1",
          "code": "issue",
          "display": "Issue"
        }
      ]
    }
  ],
  "code": {
    "coding": [
      {
        "system": "https://fhir.nhs.uk/STU3/CodeSystem/CodeSystem-RARecord-ConditionCode-1",
        "code": "720821000000105",
        "display": "Mental health condition(s)"
      }
    ],
    "text": "Patient diagnosed with Stranger anxiety (disorder). Consider home-visit"
  }
}

3.5 Update List request - xml example

http request & headers

PUT https://clinicals.spineservices.nhs.uk/STU3/List/4c8d19af-7755-4954-93df-93c964ddf349
 Authorization:Bearer [jwt_token_string]
 InteractionID:urn:nhs:names:services:flagserver:list:update
 If-Match:W/"bb325b55-e8a0-41df-84bd-3ac2b026ab5b"

http body

Update List request example XML Example

        <List>
            <id value="4c8d19af-7755-4954-93df-93c964ddf349"/>
            <meta>
                <versionId value="bb325b55-e8a0-41df-84bd-3ac2b026ab5b"/>
                <lastUpdated value="2016-03-01T10:04:33+00:00"/>
                <profile value="https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-RARecord-List-1"/>
            </meta>
            <status value="current"/>
            <mode value="changes"/>
            <title value="Reasonable Adjustment List"/>
            <code>
                <coding>
                    <system value="http://snomed.info/sct"/>
                    <code value="1094391000000102"/>
                    <display value="Reasonable adjustments for health and care access"/>
                </coding>
            </code>
            <subject>
                    <reference value="demographics.spineservices.nhs.uk/STU3/Patient/999999998"/>
            </subject>
            <date value="2018-05-25T00:00:00Z"/>
            <entry>
                <deleted value="false"/>
                <date value="2018-05-25T00:00:00Z"/>
                <item>
                    <reference value="https://clinicals.spineservices.nhs.uk/STU3/Condition/6c1ccd3f-765e-41d8-b5c0-2a0317908502"/>
                </item>
            </entry>
            <entry>
                <deleted value="true"/>
                <date value="2018-06-02T00:00:00Z"/>
                <item>
                    <reference value="https://clinicals.spineservices.nhs.uk/STU3/Condition/13aec731-02c5-42a2-b863-de889479e777"/>
                </item>
            </entry>
        </List>

3.6 Update List request - json example

http request & headers

PUT https://clinicals.spineservices.nhs.uk/STU3/List/4c8d19af-7755-4954-93df-93c964ddf349
 Authorization:Bearer [jwt_token_string]
 InteractionID:urn:nhs:names:services:flagserver:list:update
 If-Match:W/"bb325b55-e8a0-41df-84bd-3ac2b026ab5b"

http body

Update List request example JSON Example

{
  "resourceType": "List",
  "id": "4c8d19af-7755-4954-93df-93c964ddf349",
  "meta": {
    "versionId": "bb325b55-e8a0-41df-84bd-3ac2b026ab5b",
    "lastUpdated": "2016-03-01T10:04:33+00:00",
    "profile": [
      "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-RARecord-List-1"
    ]
  },
  "status": "current",
  "mode": "changes",
  "title": "Reasonable Adjustment List",
  "code": {
    "coding": [
      {
        "system": "http://snomed.info/sct",
        "code": "1094391000000102",
        "display": "Reasonable adjustments for health and care access"
      }
    ]
  },
  "subject": {
    "reference": "demographics.spineservices.nhs.uk/STU3/Patient/999999998"
  },
  "date": "2018-05-25T00:00:00Z",
  "entry": [
    {
      "deleted": false,
      "date": "2018-05-25T00:00:00Z",
      "item": {
        "reference": "https://clinicals.spineservices.nhs.uk/STU3/Condition/6c1ccd3f-765e-41d8-b5c0-2a0317908502"
      }
    },
    {
      "deleted": true,
      "date": "2018-06-02T00:00:00Z",
      "item": {
        "reference": "https://clinicals.spineservices.nhs.uk/STU3/Condition/13aec731-02c5-42a2-b863-de889479e777"
      }
    }
  ]
}

3.7 Update List response - xml example

http response & headers

HTTP/1.1 200 OK
Date:Tue, 24 Jul 2018 10:00:02 GMT
Last-Modified:2018-07-24T10:00:02+00:00
ETag: W/"3de1a085-95f3-43d2-be3c-aa60b6b3da85”
Content-Type:application/xml+fhir

http body

Update List response example XML Example

        <List>
            <id value="4c8d19af-7755-4954-93df-93c964ddf349"/>
            <meta>
                <versionId value="3de1a085-95f3-43d2-be3c-aa60b6b3da85"/>
                <lastUpdated value="2018-07-24T10:00:02+00:00"/>
                <profile value="https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-RARecord-List-1"/>
            </meta>
            <status value="current"/>
            <mode value="changes"/>
            <title value="Reasonable Adjustment List"/>
            <code>
                <coding>
                    <system value="http://snomed.info/sct"/>
                    <code value="1094391000000102"/>
                    <display value="Reasonable adjustments for health and care access"/>
                </coding>
            </code>
            <subject>
                    <reference value="demographics.spineservices.nhs.uk/STU3/Patient/999999998"/>
            </subject>
            <date value="2018-05-25T00:00:00Z"/>
            <entry>
                <deleted value="false"/>
                <date value="2018-05-25T00:00:00Z"/>
                <item>
                    <reference value="https://clinicals.spineservices.nhs.uk/STU3/Condition/6c1ccd3f-765e-41d8-b5c0-2a0317908502"/>
                </item>
            </entry>
            <entry>
                <deleted value="true"/>
                <date value="2018-06-02T00:00:00Z"/>
                <item>
                    <reference value="https://clinicals.spineservices.nhs.uk/STU3/Condition/13aec731-02c5-42a2-b863-de889479e777"/>
                </item>
            </entry>
        </List>

3.8 Update List response - json example

http response & headers

HTTP/1.1 200 OK
Date:Tue, 24 Jul 2018 10:00:02 GMT
Last-Modified:2018-07-24T10:00:02+00:00
ETag: W/"3de1a085-95f3-43d2-be3c-aa60b6b3da85”
Content-Type:application/json+fhir

http body

Update List response example JSON Example

{
  "resourceType": "List",
  "id": "4c8d19af-7755-4954-93df-93c964ddf349",
  "meta": {
    "versionId": "3de1a085-95f3-43d2-be3c-aa60b6b3da85",
    "lastUpdated": "2018-07-24T10:00:02+00:00",
    "profile": [
      "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-RARecord-List-1"
    ]
  },
  "status": "current",
  "mode": "changes",
  "title": "Reasonable Adjustment List",
  "code": {
    "coding": [
      {
        "system": "http://snomed.info/sct",
        "code": "1094391000000102",
        "display": "Reasonable adjustments for health and care access"
      }
    ]
  },
  "subject": {
    "reference": "demographics.spineservices.nhs.uk/STU3/Patient/999999998"
  },
  "date": "2018-05-25T00:00:00Z",
  "entry": [
    {
      "deleted": false,
      "date": "2018-05-25T00:00:00Z",
      "item": {
        "reference": "https://clinicals.spineservices.nhs.uk/STU3/Condition/6c1ccd3f-765e-41d8-b5c0-2a0317908502"
      }
    },
    {
      "deleted": true,
      "date": "2018-06-02T00:00:00Z",
      "item": {
        "reference": "https://clinicals.spineservices.nhs.uk/STU3/Condition/13aec731-02c5-42a2-b863-de889479e777"
      }
    }
  ]
}

3.9 Delete Condition (B) request - xml example

http request & headers

PUT https://clinicals.spineservices.nhs.uk/STU3/Condition/13aec731-02c5-42a2-b863-de889479e777
 Authorization:Bearer [jwt_token_string]
 InteractionID:urn:nhs:names:services:flagserver:condition:update
 If-Match:W/"cf8e1249-dfa6-4003-9745-d1b213008c95"

The only material difference between this request and Delete Condition (A) request will be time/order of receipt, and in the JWT payload.

http body

As example above

3.10 Delete Condition (B) request - json example

http request & headers

PUT https://clinicals.spineservices.nhs.uk/STU3/Condition/13aec731-02c5-42a2-b863-de889479e777
 Authorization:Bearer [jwt_token_string]
 InteractionID:urn:nhs:names:services:flagserver:condition:update
 If-Match:W/"cf8e1249-dfa6-4003-9745-d1b213008c95"

The only material difference between this request and Delete Condition (A) request will be time/order of receipt, and in the JWT payload.

http body

As example above

3.11 Delete Condition (B) response - xml example

http response & headers

HTTP/1.1 409 CONFLICT
Date:Tue, 24 Jul 2018 10:10:02 GMT
Content-Type:application/xml+fhir

http body

Read Fail Operation Outcome XML Example

<OperationOutcome xmlns="http://hl7.org/fhir">
    <id value="3ca2a2cb-b663-4ae9-b650-7cf4a23487ec"/>
    <meta>
        <profile value="https://fhir.nhs.uk/STU3/StructureDefinition/Spine-OperationOutcome-1"/>
    </meta>
    <issue>
        <severity value="error"/>
        <code value="forbidden"/>
        <details>
            <coding>
                <system value="https://fhir.nhs.uk/STU3/ValueSet/Spine-ErrorOrWarningCode-1"/>
                <code value="CONFLICT"/>
                <display value="Conflict"/>
            </coding>
        </details>
    </issue>
</OperationOutcome>

3.12 Delete Condition (B) response - json example

http response & headers

HTTP/1.1 409 CONFLICT
Date:Tue, 24 Jul 2018 10:10:02 GMT
Content-Type:application/json+fhir

http body

Read Fail Operation Outcome JSON Example

{
  "resourceType": "OperationOutcome",
  "id": "3ca2a2cb-b663-4ae9-b650-7cf4a23487ec",
  "meta": {
    "profile": [
      "https://fhir.nhs.uk/STU3/StructureDefinition/Spine-OperationOutcome-1"
    ]
  },
  "issue": [
    {
      "severity": "error",
      "code": "forbidden",
      "details": {
        "coding": [
          {
            "system": "https://fhir.nhs.uk/STU3/ValueSet/Spine-ErrorOrWarningCode-1",
            "code": "CONFLICT",
            "display": "Conflict"
          }
        ]
      }
    }
  ]
}

All content is available under the Open Government Licence v3.0, except where otherwise stated