Transaction: Request Context Change
Transaction | Request Context Change |
---|---|
Description | The application will publish the initial context (or context changes) by POSTing to the hub.topic url. Application (EMR , ClinicalConnect) uses HTTP POST to send context information to the CMS server based on context topic and context key (e.g. patient) In phase 2 once a requested context change is accepted, the Hub will broadcast the context notification to all subscribers, including the original requestor. |
HTTP Context | POST |
HTTP Response Codes | 200: OK 400: Bad Request 404: Not Found 500: Internal Server Error |
Parameters
Field | Optionality | Type | Description |
---|---|---|---|
timestamp | Required | string | ISO 8601-2 timestamp in UTC describing the time at which the event occurred with subsecond accuracy. |
id | Required | string | Event identifier, which MAY be used to recognize retried notifications. This id SHALL be uniquely generated by the subscriber and could be a GUID. Following an accepted context change request, the Hub MAY re-use this value in the broadcasted event notifications. |
event | Required | object | A json object describing the event. See the table below: |
Field | Optionality | Type | Description |
---|---|---|---|
hub.topic | Required | String | The session topic given in the subscription request. The hub.topic is created by CMS via createHubTopic call. |
hub.event | Required | string | The event that triggered this notification, taken from the list of events from the subscription request. |
context | Required | array | An array of named FHIR objects corresponding to the user's context after the given event has occurred. The hub SHALL only return FHIR resources that are authorized to be accessed with the existing OAuth 2.0 access_token. |
Examples:
Sample POST Request (JSON)
POST [base] HTTP/1.1
Authorization: Bearer i8hweunweunweofiwweoijewiwe
Host: hub
Content-Type: application/json
X-Request-Id - 3640dd516011da0243e26ce2
{
"timestamp": "2019-01-08T01:37:05.14",
"id": "q9v3jubddqt63n3",
"event": {
"hub.topic": "7jaa86kgdudewiaq0wtu",
"hub.event": "Patient-open",
"context": [{
"key": "patient",
"resource": {
"resourceType": "Patient",
"id": "cms-patient-example",
"meta": {
"profile": ["http://ehealthontario.ca/fhir/StructureDefinition/ca-on-cms-profile-Patient|1.0.0"]
},
"identifier": [
{
"system": "https://fhir.infoway-inforoute.ca/NamingSystem/ca-on-patient-hcn",
"value": "1234567890"
}
],
"name": [
{
"use": "official",
"text": "Onjohn Onsmith"
}
],
"telecom": [
{
"system": "phone",
"value": "416-123-3456"
}
],
"gender": "male",
"birthDate": "1926-02-24"
}
}
]
}
}
Sample POST Response (JSON):
HTTP/1.1 200 OK
Cache-Control: private
Content-Length: 700
Content-Type: application/json; charset=utf-8
Server: Microsoft-IIS/8.0
X-AspNet-Version: 4.0.30319
X-SourceFiles: =?UTF-8?B?WjpcdGVjaG5pY2FsU2VydmljZXNcU291cmNlQ29kZVxDb250ZXh0TUdNVFxDb250ZXh0TUdNVFxDb250ZXh0TUdNVC5zdmNceG1sXENvbnRleHRJbmZv?=
X-Powered-By: ASP.NET
{
"hub.topic": "7jaa86kgdudewiaq0wtu",
"timestamp": "2018-04-23T10:50:56.2309425-04:00"
}