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. Currently CMS supports Patient, Practitioner, Location, Organization and Parameters resource. The hub SHALL only return FHIR resources that are authorized to be accessed 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
Sample GET Response – Found (JSON)
{
"timestamp": "2018-04-23T10:43:00",
"id": "7jaa86kgdudewiaq0wtu",
"event": {
"hub.topic": "7jaa86kgdudewiaq0wtu",
"context": [
{
"key": "patient",
"resource": {
"timestamp": "2018-01-08T01:37:05.14Z",
"id": "gf45fg34koffbddqt63n1er",
"event": {
"hub.topic": "8E4DA1DD6B6D44BCB678E86AA39435F0",
"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 Ondavid Onsmith"
}
],
"telecom": [
{
"system": "email",
"value": "abc@xyz.com"
}
],
"gender": "male",
"birthDate": "1926-02-24"
}
}
]
}
},
{
"key": "person",
"resource": {
"resourceType": "Person",
"id": "cms-person-example",
"meta": {
"profile": ["http://ehealthontario.ca/fhir/StructureDefinition/ca-on-cms-profile-Person|1.0.0"]
},
"identifier": [
{
"system": "https://infoway-inforoute.ca/fhir/NamingSystem/ca-on-patient-hcn",
"value": "78987568698"
},
{
"system": "http://ehealthontario.ca/fhir/NamingSystem/ca-on-panorama-immunization-id",
"value": "5587943"
}
],
"name": [
{
"use": "official",
"family": "Chalmers",
"given": ["Simon"]
}
],
"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"
}
]
}
},
{
"key": "parameters",
"resource": {
"resourceType": "Parameters",
"id": "cms-parameters-example",
"meta": {
"profile": ["http://ehealthontario.ca/fhir/StructureDefinition/ca-on-cms-profile-Parameters|1.0.0"]
},
"parameter": [
{
"name": "appLanguage",
"valueCoding": {
"system": "urn:ietf:bcp:47",
"code": "en",
"display": "English"
}
},
{
"name": "contextSessionId",
"valueId": "7we9hfgt45jslsl0322dhyf"
}
]
}
}
]
}
}