Getting error in granting consent

While granting the consent, there is a failure error in the PHR app. Attached :Screenshot for the same

Hey @rahulChugh,

For Granting Consent Request, There must be linked care context, then only Consent can be granted

Thanks

Hi @Shubhanshu_Shukla,

I’ve two care contexts linked but still it is giving error. PFA the related screenshots.

Hello @rahulChugh

Could you please add patient care contexts in HIP. After that arise consent request and grant. it should work.

Thank You

Hi @Arvind_Tomar,

I just added some health data in my HIP and linked the care context with ABDM -


I sent the consent request and it is showing the same error after clicking on the Grant Consent button -

@rahulChugh pls refer to the other thread, reference number needs to be set correctly.

Thank you for the response.
I’ll look into it.

Hey @Shubhanshu_Shukla,
We are also getting this error (consents[0].careContexts[0].careContextReference: Care context reference not specified) in the PHR app while granting the consent.

The error is no longer there if I explicitly provide the hip and careContexts in the consent request.
In the schema of this API, the hip and careContexts fields are not mandatory. Why is it erroring out without those fields then?

Also as an HIU, how can I know the care contexts in advance?
Is there any API to list all the careContexts for the HIU?

Hai @rahulChugh @IntegrationSupport Now I am getting same issue, could you please help me.

@ramakrishna337 Share the payload body to debug this issue.

Hai @IntegrationSupport Payload body for the API " https://dev.abdm.gov.in/gateway/v0.5/consent-requests/init " is

const axios = require(‘axios’);
let data = JSON.stringify({
“requestId”: “e083ae8a-c2fa-4715-90ac-41d58d54abcf”,
“timestamp”: “2023-10-02T18:05:51.813Z”,
“consent”: {
“purpose”: {
“text”: “string”,
“code”: “CAREMGT”
},
“patient”: {
“id”: “gunupudir23@sbx”
},
“hiu”: {
“id”: “eVaidya_HIU”
},
“requester”: {
“name”: “Dr. Surendra Kavali”,
“identifier”: {
“type”: “REGNO”,
“value”: “MH1001”,
“system”: “https://www.evaidya.com
}
},
“hiTypes”: [
“OPConsultation”
],
“permission”: {
“accessMode”: “VIEW”,
“dateRange”: {
“from”: “2022-09-25T12:52:34.925Z”,
“to”: “2023-09-10T12:52:34.925Z”
},
“dataEraseAt”: “2023-11-25T12:52:34.925Z”,
“frequency”: {
“unit”: “HOUR”,
“value”: 1,
“repeats”: 0
}
}
}
});

let config = {
method: ‘post’,
maxBodyLength: Infinity,
url: ‘https://dev.abdm.gov.in/gateway/v0.5/consent-requests/init’,
headers: {
‘Authorization’: ‘Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJBbFJiNVdDbThUbTlFSl9JZk85ejA2ajlvQ3Y1MXBLS0ZrbkdiX1RCdkswIn0.eyJleHAiOjE2OTYxODI4MTUsImlhdCI6MTY5NjE2MTIxNSwianRpIjoiMWMzMWU3ZmEtZTYzYi00NTUwLWExMDMtZWIzNjQ5NmI4NzdlIiwiaXNzIjoiaHR0cHM6Ly9kZXYubmRobS5nb3YuaW4vYXV0aC9yZWFsbXMvY2VudHJhbC1yZWdpc3RyeSIsImF1ZCI6ImFjY291bnQiLCJzdWIiOiJjN2EzMGM1ZC0xYjExLTQ1MmQtOWEwYy1jN2NiM2VjYTEzMjgiLCJ0eXAiOiJCZWFyZXIiLCJhenAiOiJTQlhfMDAwMzg3Iiwic2Vzc2lvbl9zdGF0ZSI6IjVhYzRiZWU1LTU1NjYtNGNjNS04ZjY3LTc0MGVlZGQ4ZTI2NSIsImFjciI6IjEiLCJhbGxvd2VkLW9yaWdpbnMiOlsiaHR0cDovL2xvY2FsaG9zdDo5MDA3Il0sInJlYWxtX2FjY2VzcyI6eyJyb2xlcyI6WyJoaXUiLCJvZmZsaW5lX2FjY2VzcyIsImNtIiwiaGVhbHRoSWQiLCJwaHIiLCJPSURDIiwiZ2F0ZXdheSIsImhpcCJdfSwicmVzb3VyY2VfYWNjZXNzIjp7IlNCWF8wMDAzODciOnsicm9sZXMiOlsidW1hX3Byb3RlY3Rpb24iXX0sImFjY291bnQiOnsicm9sZXMiOlsibWFuYWdlLWFjY291bnQiLCJtYW5hZ2UtYWNjb3VudC1saW5rcyIsInZpZXctcHJvZmlsZSJdfX0sInNjb3BlIjoib3BlbmlkIGVtYWlsIHByb2ZpbGUiLCJjbGllbnRIb3N0IjoiMTAuMjMzLjY3LjI0IiwiZW1haWxfdmVyaWZpZWQiOmZhbHNlLCJjbGllbnRJZCI6IlNCWF8wMDAzODciLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJzZXJ2aWNlLWFjY291bnQtc2J4XzAwMDM4NyIsImNsaWVudEFkZHJlc3MiOiIxMC4yMzMuNjcuMjQifQ.mJ9G1TpcuPZTW1XrZnKYoWSLMO6Oa41wW4kwz8JaigKR38NENJO078S8CARvqX_YN0C_y1Ss6pz_LCqtw1EeymFL_OwG6gxLoh_3Neh_fq5w2lOkvhFQDrBlYFBubLkoe3D2OpepfhFlD6K1oCYDVorksGs6k34Mak_bUV_hQYnAMDzE-uj3un0zI6QWpSC5EKiWg_OxteucfaEQlYOFBM1l19ME74oW06WVXtb5zryUTkLd2Cl4lju42Nby2FwfYiD_eFo6_GuqSPiqR2TkhJK3Av7ARd6pp3cbvTwJ-6L8JsB0gSUBVpX4WsN8ISqPhMu3eQRwmbTR4MqgJUDaWQ’,
‘X-CM-ID’: ‘sbx’,
‘Content-Type’: ‘application/json’
},
data : data
};

axios.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});

Hai @IntegrationSupport May I know which value I need to pass to refURi in this API “https://dev.abdm.gov.in/gateway/v0.5/consent-requests/init” body