visit the hl7 website
Ontario Subscription HL7® FHIR® Implementation Guide -v1.0.0-ballot1
fhir-logo
  • Index
  • Home
    • Home
    • Introduction
    • Relationship to Other Specifications
    • Scope
    • Glossary
  • Business Context
    • Business Context
    • Business Model
    • Business Data
    • Use Cases
    • Business Rules
  • Technical Context
    • Technical Context
    • Implementer Responsibility
    • Conformance Rules
    • Connectivity Summary
  • FHIR Artifacts
    • FHIR Artifacts
    • Interactions
    • Operations
    • Profiles
    • Terminology
    • System URIs
    • Capability Statement
    • Custom Search Parameters
    • Response Handling
    • Downloads
  • Change Log
    • Change Log
    • Known Issues & Future Developments
    • Revision History
    1. Index
    2. FHIR Artifacts
    3. Interactions
    4. Update Subscription

For a full list of available versions, see the Directory of published versions

4.1.6. Update Subscription

The Update Subscription operation is used to update an existing subscription on the Ontario Health Subscription service.

4.1.6.1. Interaction Sequence Diagram

4.1.6.2.

4.1.6.3. Specification

Modify Subscription Request

PUT [base]/Subscription/{subscription-id}

Content-Type: application/fhir+json

where [subscription-id] is the logical id of the existing Subscription resource, and the request payload body contains a FHIR R4B Subscription resource, conformant to Subscription

Update Subscription Response

The server returns a 200 OK HTTP status code, and also returns a Location header which contains the Logical Id and new Version Id of the updated resource version

4.1.6.4. Example of Update Subscription Interaction

4.1.6.5.

This example provides an update of the existing Subscription resource to modify its criteria and endpoint.

Request Message:

PUT [base]/Subscription/f63b8b72-23b4-4c3f-8a07-8fbe93d46f9d HTTP/1.1

Host: fhir-server.example.com

Content-Type: application/fhir+json

{
  "resourceType": "Subscription",
  "id": "f63b8b72-23b4-4c3f-8a07-8fbe93d46f9d",
  "status": "active",
  "reason": "Monitor new Patient resources",
  "criteria": "Patient?active=true",
  "channel": {
    "type": "rest-hook",
    "endpoint": "https://client.example.com/notifications",
    "header": [
      "Authorization: Bearer some-jwt-token"
    ],
    "payload": "application/fhir+json"
  },
  "extension": [
    {
      "url": "http://hl7.org/fhir/uv/subscriptions-backport/StructureDefinition/backport-channel-type",
      "valueCode": "rest-hook"
    },
    {
      "url": "http://hl7.org/fhir/uv/subscriptions-backport/StructureDefinition/backport-topic",
      "valueCanonical": "http://example.com/fhir/SubscriptionTopic/PatientUpdates"
    }
  ]
}

Response Message:

HTTP 200 OK

Content-Type: application/fhir+json

{
  "resourceType": "Subscription",
  "id": "123456",
  "meta": {
    "versionId": "2",
    "lastUpdated": "2025-02-07T12:00:00Z"
  },
  "status": "active",
  "reason": "Monitor new Patient resources",
  "criteria": "Patient?active=true",
  "channel": {
    "type": "rest-hook",
    "endpoint": "https://client.example.com/notifications",
    "header": [
      "Authorization: Bearer some-jwt-token"
    ],
    "payload": "application/fhir+json"
  },
  "extension": [
    {
      "url": "http://hl7.org/fhir/uv/subscriptions-backport/StructureDefinition/backport-channel-type",
      "valueCode": "rest-hook"
    },
    {
      "url": "http://hl7.org/fhir/uv/subscriptions-backport/StructureDefinition/backport-topic",
      "valueCanonical": "http://example.com/fhir/SubscriptionTopic/PatientUpdates"
    }
  ]
}


4.1.6.6. Expected Bahaviour

4.1.6.7.

Case Scenario Description HTTP Status Code Response Payload
1 A valid Subscription is submitted, accepted, and updated in the repository HTTP 200 OK Returns the updated resource.
2 The submitted Subscription does not exist in the repository HTTP 404 Resource not found.
3 The submitted Subscription cannot be validated as it does not conform to the specification HTTP 400 Bad Request. Returns an OperationOutcome resource indicating an issue. The client must fix the request and try again.
4 Subsciprtion API validates the request but cannot return a valid response due to internal issues. HTTP 500 Internal Server Error. Returns an OperationOutcome resource indicating an issue.
Version: 1.0.0 FHIR Version: R4.0.1

Powered by SIMPLIFIER.NET

HL7® and FHIR® are the registered trademarks of Health Level Seven International