Greetings,
The health locker obtained the locker access token through locker request which the user accepted for auto-approval of consent requests. When a care context is created for that user, callback “subscriptions/hiu/notify” is triggered with a care context. Then we sent the consent request to the respective user for the auto-approval, but the request isn’t getting accepted automatically.
Attached is the body of the respected APIs
PAYLOAD OF SUBSCRIPTION-REQUESTS/NOTIFY CALLBACK
URL: v0.5/subscription-requests/hiu/notify
REQUEST BODY:
{
“requestId”: “2ae0bc23-5484-41b2-b2be-c8239f2fccc9”,
“timestamp”: “2022-07-30T10:28:12.040295”,
“notification”: {
“subscriptionRequestId”: “35a01f32-b27c-4d8d-805e-03d1f6c4ab07”,
“status”: “GRANTED”,
“subscription”: {
“id”: “69081be5-e992-41fa-9894-527010230ddc”,
“patient”: {
“id”: “harishyam@sbx”
},
“hiu”: {
“id”: “test-ninto-locker”,
“name”: “Ninto”
},
“sources”: [
{
“hip”: {
“id”: “test-ninto-locker”,
“name”: null
},
“categories”: [
“LINK”,
“DATA”
],
“period”: {
“from”: “2020-12-01T04:39:04.368”,
“to”: “2023-12-03T04:39:04.368”
}
},
{
“hip”: {
“id”: “test-ninto-dev-708808”,
“name”: null
},
“categories”: [
“LINK”,
“DATA”
],
“period”: {
“from”: “2020-12-01T04:39:04.368”,
“to”: “2023-12-03T04:39:04.368”
}
}
]
}
}
}
PAYLOAD OF SUBSCRIPTION/NOTIFY CALLBACK
URL: /v0.5/subscriptions/hiu/notify
REQUEST BODY:
{ "requestId": "a4c4e523-da9e-478a-8aea-cae321237a64", "timestamp": "2022-07-30T10:08:16.422593", "event": { "id": "b0b8ef53-693d-4fc9-bea4-0126898704b4", "published": "2022-07-30T10:08:16.372367", "subscriptionId": "b5df3b63-cd4f-489f-83a7-ba2b9c6d0e9e", "category": "LINK", "content": { "patient": { "id": "harishyam@sbx" }, "hip": { "id": "test-ninto-locker", "name": null }, "context": [ { "careContext": { "patientReference": "harishyam@sbx", "careContextReference": "ef2b23cf-3843-48e7-9a1d-db4a6c005d7e" }, "hiTypes": [] } ] } } }
cURL: cur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TU5NSIsImNsaWVudEhvc3QiOiIxMC4yMzMuNjguMjA1IiwiZW1haWxfdmVyaWZpZWQiOmZhbHNlLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJzZXJ2aWNlLWFjY291bnQtc2J4XzAwMTU5NSIsImNsaWVudEFkZHJlc3MiOiIxMC4yMzMuNjguMjA1In0.C0F13AELUwqVQZqDKc71aYYIAU2mzWcDibMjY46LG2f31Sg8SW50_mMxqNZctibSXr9Qd4kVApbgZoRZUI4X1_Yq2n_0wAcxnU19nN9bQuIezlHuAuKGhrHHzd1zdOWO-G23V5aCcESlR_Jc6JUBNxB2P701SK59KQo1G3UNRgDfQvxhaZFnW4wtX67prIe3AwYNHpwfpVss9PY34ivvyJ7wS6LaRSvQK8BoZtrIVViw22fxfR2Mozh5iQcKj1O1FNvEYYygE6yc0UGbNRqotoem4dv_RWWZ7g6OSX9H1Bb6D7FaGrkmRj06YPFErMI9rhOxLqdODWJJJ18Pc1vTgg’
–header ‘Content-Type: application/json’
–header ‘Accept: application/json’
–data-raw ‘{“requestId”:“2075fa7f-ca38-4cbf-acd6-7e18eab0883b”,“timestamp”:“2022-07-30T10:08:17.107Z”,“consent”:{“purpose”:{“text”:“locker sync up request”,“code”:“PATRQT”},“careContexts”:[{“patientReference”:“harishyam@sbx”,“careContextReference”:“ef2b23cf-3843-48e7-9a1d-db4a6c005d7e”}],“patient”:{“id”:“harishyam@sbx”},“hiu”:{“id”:“test-ninto-locker”},“hip”:{“id”:“test-ninto-locker”},“requester”:{“name”:“test-ninto-locker”},“hiTypes”:[“OPConsultation”],“permission”:{“accessMode”:“VIEW”,“dateRange”:{“from”:“2020-12-01T04:39:04.368”,“to”:“2023-12-03T04:39:04.368”},“dataEraseAt”:“2023-12-03T04:39:04.368”,“frequency”:{“unit”:“HOUR”,“value”:100,“repeats”:100}}}}’