Operation: Update Subscription
The Update Subscription operation is used to update a exist subscription on the Ontario Health publication service.
Specification
This specification is based on the FHIR R4 Update operations.
Subscription Update Request
The Update Subscription will update an existing FHIR Subscription resource in the repository.
Usage:
PUT [base]/Subscription/[id]
, where [id] is the logical id of the existing Subscription resource, and the HTTP Body contains a FHIR R4 Subscription resource, conformant to Profile: Subscription
Subscription Update Response
The server returns a 200 OK HTTP status code, and also returns a Location header which contains the new Logical Id and Version Id of the updated resource version
Example Create Message
HTTP Method:
POST
Headers:
Content-Type: application/fhir+json
Address:
[base]/Subscription/
Message body:
{
"resourceType" : "Subscription",
"meta" : {
"profile" : [
"http://hl7.org/fhir/uv/subscriptions-backport/StructureDefinition/backport-subscription"
]
},
"status": "active",
"criteria": "http://ontariohealth.ca/SubscriptionTopic/healthcareservice",
"_criteria": {
"extension": [
{
"url" : "http://hl7.org/fhir/uv/subscriptions-backport/StructureDefinition/backport-filter-criteria",
"valueString" : "HealthcareService?program=http://ehealthontario.ca/fhir/CodeSystem/ca-on-phsd-programs|evisit,http://ehealthontario.ca/fhir/CodeSystem/ca-on-phsd-programs|econsult"
}
]
},
"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" : 10
}
],
"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" : "full-resource"
}
]
}
}
}
Expected Behaviour
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 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. |
3 | 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. |