Health Locker : Consent Auto approval Issue

Hi
I have registered Health locker successfully and also i have implemented subscriptions api. I am getting long term token and consent auto approval after approved Health locker request from phr android app. The subscriptions api flow is working.
When i am linking some carecontext through the phr android app. As a Health Locker i am getting notification(/v0.5/subscriptions/hiu/notify) form CM. I am getting carecontext in api /v0.5/subscriptions/hiu/notify. Using this carecontext i am raised consent request and it’s get auto approved but i am getting error when i am calling ‘/v0.5/consents/fetch’

API: /v0.5/consents/fetch
Error: (500) Internal Server Error

Below is json payload
Request : /v0.5/consent-requests/init
{“requestId”:“e41a4283-c649-459f-942d-9325e1e8abbd”,“timestamp”:“2021-02-24T14:32:00.4428605Z”,“consent”:{“purpose”:{“text”:“Self Requested”,“code”:“PATRQT”,“refUri”:""},“patient”:{“id”:“jatin@sbx”,“name”:null},“hip”:{“id”:“driefcasehip”},“hiu”:{“id”:“driefcasehl”},“careContexts”:[{“patientReference”:“jatin@sbx”,“careContextReference”:“DCAR2021022200042”}],“requester”:{“name”:“DRiefcase Health Locker”,“identifier”:{“type”:“Health Locker”,“value”:"",“system”:""}},“hiTypes”:[“Prescription”,“DiagnosticReport”,“OPConsultation”,“DischargeSummary”,“ImmunizationRecord”],“permission”:{“accessMode”:“VIEW”,“dataEraseAt”:“2021-02-25T14:30:00.4428538Z”,“dateRange”:{“from”:“2021-02-23T14:30:00.4428487Z”,“to”:“2021-02-25T14:30:00.4428533Z”},“frequency”:{“unit”:“HOUR”,“value”:“1”,“repeats”:“1”}}}}

Response: /v0.5/consent-requests/on-init
{“requestId”:“fc2400ee-9f87-444e-88ea-6780bd472cba”,“timestamp”:“2021-02-24T14:30:05.702796”,“consentRequest”:{“id”:“d9afb20c-d8d4-49e1-9b9f-3503ff305fb5”},“error”:null,“resp”:{“requestId”:“e41a4283-c649-459f-942d-9325e1e8abbd”}}

v0.5/consents/hiu/notify :
{“requestId”:“50ad41d7-0bfd-4cae-bbe9-177a4502cbd9”,“timestamp”:“2021-02-24T14:30:05.878972”,“notification”:{“consentRequestId”:“d9afb20c-d8d4-49e1-9b9f-3503ff305fb5”,“status”:“GRANTED”,“consentArtefacts”:[{“id”:“dc674c63-30ef-40fe-ab2d-1d3e8b33a413”}]}}

Request: v0.5/consents/fetch
{“requestId”:“3d413486-3c70-4e66-954e-115cef7cbbce”,“timestamp”:“2021-02-24T14:30:01.1777261Z”,“consentId”:“dc674c63-30ef-40fe-ab2d-1d3e8b33a413”}

/v0.5/consents/fetch getting Error (500) Internal Server Error

When i am raised consent request using HIU app the flow is working

Please guide us

Hi @jatin,

We see an error in our logs as below:

No mapping found for X-CM-ID : ncg

The X-CM-ID must be sbx in this case, which you would have used for consent-request/init as well.

Could you please try with the right X-CM-ID.

Thank you

Hi @mdubey, thanks for reply
Above problem is solved.

Now i am not getting call back response of api ‘v0.5/health-information/cm/request’
Call back api : v0.5/health-information/cm/on-request is not call

Please guide us.

Below is json payload

Request: ‘v0.5/health-information/cm/request’
{“requestId”:“ae6a5714-0fbc-4bb7-9169-0238636e129f”,“timestamp”:“2021-02-25T08:34:24.1316449Z”,“hiRequest”:{“consent”:{“id”:“a721a190-d207-44cd-8f65-e2e9b6ce0b6f”,“digitalSignature”:“gG+YfVHRp2LOktjgR3hQ3oHg16uTLgEyOSCGYMGoinmTon9Cbzj2O6nHgugpHQuvZBOHCU4pKmucggy360804QtEQcwRDY4rq6fkjpv95j7+i/Zj2r79kUu8UqaqLMDwIheobbXTfG33LqsTZ/4QucWT3+8aXD0S02eH10ceYtyDvzGsW6FG324ETLvOkVzrw7HJbCPjBDy9FEY+tYGDyqWIZuBnaQzWfXWoF1TtcTy1gwgFlb/5FtMJLCyYETuc8GQzuruFZxNNuRbU/f89tAOxHx7l/rJnjxp8PfJNrrrjdxCK6TJUHXog3EuQyPap+KuQHe9ChxioVi0pWxprKg==”},“dateRange”:{“from”:null,“to”:null},“dataPushUrl”:“https://uatndhm.driefcase.com/data/notification/v0.5/health-information/transfer",“keyMaterial”:{“cryptoAlg”:“ECDH”,“curve”:“Curve25519”,“dhPublicKey”:{“expiry”:“2021-02-26T08:34:23.943Z”,“parameters”:"",“keyValue”:“MIIBMTCB6gYHKoZIzj0CATCB3gIBATArBgcqhkjOPQEBAiB/////////////////////////////////////////7TBEBCAqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqYSRShRAQge0Je0Je0Je0Je0Je0Je0Je0Je0Je0Je0JgtenHcQyGQEQQQqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq0kWiCuGaG4oIa04B7dLHdI0UySPU1+bXxhsinpxaJ+ztPZAiAQAAAAAAAAAAAAAAAAAAAAFN753qL3nNZYEmMaXPXT7QIBCANCAAQVdVj5EpgO3l2exG+NpG/SA7k6rg9EE6cEvX53kNPIKgjhKdeqaVMHm1SdkFdt+qEfvf2apEWbuqIAxEI31gx+”},“nonce”:"OWFkOGRlN2QtZmJiNi00ZDFiLThjNDItYjBlNTdiZGNlNjli”}}}

Hi @jatin,

This is the issue. The DateRange has values from and to as null. Please correct it and send again. Meanwhile we will look into why our validations did not work.

{“from”:null,“to”:null}

Thank you

Hi @mdubey,
Issue is solved
Thanks for you support