Transaction: Query for Current Context
| Transaction | Query for current context |
|---|---|
| Description | Returns context information based on the context topic and context key (e.g. patient) |
| HTTP Context | GET |
| HTTP Response Codes | 200 OK: Valid session for parameters provided in the request 400 Bad Request 404 Not Found: Invalid Session for parameters provided in the request 500 Internal Server Error |
Note: To support ‘Query for Current Context’, the CMS iGuide uses FHIRcast May 2019 Ballot version - http://fhircast.org/specification/May2019Ballot/
Parameters : Request Parameters
| Field | Optionality | Type | Description |
|---|---|---|---|
| hub.topic | Required | String | The uri of the user's session that the subscriber wishes to subscribe to or unsubscribe from. The hub.topic is created by CMS via createHubTopic call. |
Parameters: Response 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. |
| 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. In phase 1, It will be a uuid generated by the launching app (e.g. EMR) |
| context | Required | array | An array of named FHIR objects corresponding to the user's context after the given event has occurred. The Consumer CMS will return the Patient context authorized to be accesses with the existing OAuth 2.0 access_token. |
Examples:
Sample GET Request – Not Found:
GET [base]/7jaa86kgdudewiaq0wtu
HTTP/1.1 404 Not Found
Cache-Control: private
Server: Microsoft-IIS/8.0
X-AspNet-Version: 4.0.30319
Sample GET Request – Found (JSON):
GET [base]/7jaa86kgdudewiaq0wtu
Authorization: Bearer i8hweunweunweofiwweoijewiwe
X-Request-Id - 3640dd516011da0243e26ce2
X-Gtwy-Client-Id - 2ff512d5865fb2a458078d40cb56c0b9
X-Gtwy-Client-Secret - 68317438049a8be42dfa8a35509813d1
Sample GET Response – Found (JSON)
{
"timestamp": "2018-04-23T10:43:00",
"id": "7jaa86kgdudewiaq0wtu",
"event": {
"hub.topic": "7jaa86kgdudewiaq0wtu",
"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://infoway-inforoute.ca/fhir/NamingSystem/ca-on-patient-hcn",
"value": "1234567890"
},
{
"system": "http://ehealthontario.ca/fhir/NamingSystem/ca-on-panorama-immunization-id",
"value": "1244566"
}
],
"name": [
{
"use": "official",
"family": "Onsmith",
"given": ["Onjohn"]
}
],
"telecom": [
{
"system": "phone",
"value": "416-123-3456"
}
],
"gender": "male",
"birthDate": "1926-02-24",
"address": [
{
"use": "home",
"type": "physical",
"line": ["13 Boring St"],
"city": "Toronto",
"state": "ON",
"postalCode": "M1M M2M",
"country": "CAN"
}
]
}
}
]
}
}