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. Create Subscription

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

4.1.2. Create Subscription

The Create Subscription interaction creates a subscription to a specified topic, enabling the subscriber to receive notifications when the event occurs.


4.1.2.1. Scope

This interaction involves a request by a Point of Service system to create Subscription on the Subscription server. The request is received by the Subscription service which stores the Subscription resource and returns an HTTP response code and an OperationOutcome resource if applicable.


4.1.2.2. Interaction Sequence Diagram


4.1.2.3. Specification

Subscription Create Request

Client creates and submits a request to the FHIR server to express interest to subscribe for notifications about changes to specific resources. Client use HTTP POST method to submit subscritpion request in the following manner

POST [base]/Subscription HTTP/1.1

Host: example.com

Content-Type: application/fhir+json

where the HTTP Body contains a FHIR R5 Backport Subscription resource, conformant to Subscription


4.1.2.4. Example Create Subscription

Request Message:

HTTP Method:

POST

Headers:

Content-Type: application/fhir+json

Address:

[base]/Subscription/

Request message body:

{
    "resourceType": "Subscription",
     "identifier": [
        {
            "system": "https://oh-subscriptions.ca/ids",
            "value": "emr_subscription-12345_GUID"
        }
    ],    

    "text": {
        "status": "generated",
        --- We have skipped the narrative for better readability of the resource ---
    },
    "status": "active",
    "end": "2020-12-31T12:00:00Z",
    "reason": "Subsc for Patient Admission",
    "extension": [
            {
            "url": "http://example.org/fhir/StructureDefinition/subscription-managingEntity",
            "valueReference": {
                "reference": "Organization/123",
                "display": "Orion EMR Instance"
            }
            }
    ],
    "criteria": "http://hl7.org/SubscriptionTopic/admission",
    "_criteria": {
        "extension":  [
            {
                "url": "http://hl7.org/fhir/uv/subscriptions-backport/StructureDefinition/backport-filter-criteria",
                "valueString": "Encounter?patient=Patient/123"
            }
        ]
    },
    "channel": {
        "extension":  [
            {
                "url": "http://hl7.org/fhir/uv/subscriptions-backport/StructureDefinition/backport-heartbeat-period",
                "valueUnsignedInt": 86400
            },
            {
                "url": "http://hl7.org/fhir/uv/subscriptions-backport/StructureDefinition/backport-timeout",
                "valueUnsignedInt": 60
            },
            {
                "url": "http://hl7.org/fhir/uv/subscriptions-backport/StructureDefinition/backport-max-count",
                "valuePositiveInt": 20
            }
        ],
        "type": "rest-hook",
        "endpoint": "https://example.org/Endpoints/d7dcc004-808d-452b-8030-3a3a13cd871d",
        "payload": "application/fhir+json",
        "_payload": {
            "extension":  [
                {
                    "url": "http://hl7.org/fhir/uv/subscriptions-backport/StructureDefinition/backport-payload-content",
                    "valueCode": "id-only"
                }
            ]
        }
    }
}

Example Create Subscriptions Response

{
  "resourceType": "Subscription",
  "id": "f63b8b72-23b4-4c3f-8a07-8fbe93d46f9d",
  "meta": {
    "versionId": "1",
    "lastUpdated": "2025-11-23T14:22:00Z"
  },
  "status": "active",
  "reason": "Notify client when new Patient resources are created",
  "criteria": "Patient?status=active",
  "channel": {
    "type": "rest-hook",
    "endpoint": "https://example.org/Endpoints/d7dcc004-808d-452b-8030-3a3a13cd871d",
    "payload": "application/fhir+json",
    "header": [
      "Authorization: Bearer ey123..."
    ]
  }
}


4.1.2.5. Supported Profiles

Profile Name URL
Backport Subscription R4/B Topic-Based Subscription

4.1.2.6. Expected Behaviour

Case Scenario Description HTTP Status Code Response Payload
1 A valid Subscription is submitted, accepted, and created in the repository HTTP 201 Created. Returns the created resource.
2 The subscribtion has been received but is being processed asynchronously HTTP 202 Accepted.
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