Not able to link multiple care contexts

Hi Team,
We are facing an issue in the discover flow.
We are not able to link multiple visits for a hospital at once via /v1/links/link/init/ api, it only links the first visit being passed.
Please check this

Hey @kartikkaushal,

Link/on-init call can have a unique link reference number - https://dev.ndhm.gov.in/cm/v1/links/link/init

{
““transactionId””: "“7ce376e6-f33e-471d-aaaa-3296e3885516"”,
““link””: {
““referenceNumber””: ““UNIQUE LINK REFERNCE NUMBER FROM hip FOR ABOVE TRANSACTIONID””,
““authenticationType””: ““MEDIATED””,
““meta””: {
““communicationMedium””: ““M0BILE””,
““communicationHint””: ““Reference HIP””,
““communicationExpiry””: "“2022-01-11T06:42:45.502"”
}
}
}

This should be different and unique from the care context reference number. The Link reference number should be maintained at the HIP end.

Hey @neha.parnami
I am passing the UNIQUE LINK REFERNCE NUMBER FROM hip to the confirm api
/v1/links/link/confirm/{linkRefNumber} but only the first care context is getting linked.

What is the issue if you can elaborate?

Please share the request and response of link on-int and link on-confirm

Sure,
please check

Link on-init
curl
curl --location --request POST ‘https://dev.abdm.gov.in/cm/v1/links/link/init
–header ‘Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJBbFJiNVdDbThUbTlFSl9JZk85ejA2ajlvQ3Y1MXBLS0ZrbkdiX1RCdkswIn0.eyJleHAiOjE2NDU3MTExMjgsImlhdCI6MTY0NTcxMDUyOCwianRpIjoiNGE2YTcxMWMtNTNkNy00MmM2LTk5M2QtMGU0OWJjZTY0MTU5IiwiaXNzIjoiaHR0cHM6Ly9kZXYubmRobS5nb3YuaW4vYXV0aC9yZWFsbXMvY2VudHJhbC1yZWdpc3RyeSIsImF1ZCI6ImFjY291bnQiLCJzdWIiOiJhNzIxM2I3MS0zZWExLTQ1OGEtOGYyNC0yZDFiMWFlZDg5ZDQiLCJ0eXAiOiJCZWFyZXIiLCJhenAiOiJTQlhfMDAwNDAyIiwic2Vzc2lvbl9zdGF0ZSI6ImM0ZWYwNzU5LWUwZGYtNDMwOC1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DIwMyIsImNsaWVudElkIjoiU0JYXzAwMDQwMiIsIm1vYmlsZSI6Ijk2NDYxNDgxMTAiLCJoZWFsdGhJZCI6ImthcnRpa2thdXNoYWwwN0BzYngiLCJleHAiOjE2NDU3MTA5NjEsImhlYWx0aElkTnVtYmVyIjoiNjMtMTMzMS0xMDgwLTQyMDMiLCJpYXQiOjE2NDU3MDkxNjF9.prw9PzROlzm1eH37q0KQ1C-RlVbu6qqWELSkmjyYc6mBW4FilKRD_4vjG54nf3PJ50iekJWZ9WB9BnDOV48kAQk9XWRkSPeyx41caO0T9My5bGIsOGA1Df55Zs20H1zAg5e5-0dSg0BYCIK2yK3-EsP5Ak_2yxYzaKkRUbM1aelXcIhQYi3xw1cSP-zLtbaPhDEuRnevepdwNZP0NIgoM0laoEPiW2gT7ArSw1jSU_8CWFjP7dy0udrf22nzdkBZ9asCkUXbvixI9qJnDSE4SaOxZiFB2eErhUR69TDbzzoDfvyJuQ_a-0DqmsdqGzjZO9lccc1lKwkEMXWGQEHzIEzyFycLthI1w8fwzaaTY5WYJnm42NaK2e7WhJA5SRQ5UhRabETK_fMrUyCxOW2z-F5B6KJWSrtmfsTm1KIgj1TmaRcyK_gTJBcIfoKYD-6MGMWQMHZiGsszHbokoX2EAEfSlq6MK1F7PoDhNw5sNYF3nz1zjEFNNtfJul3Afj5YcgGoLHxhCEeyJqRDrklXWbUq0297S605EGubQBpLqprFDeBkJsveR01T3-RNFDq5pLfvwwN0KYpT51MumdrL9ATvO0ntY332u8g9bBWaRSCO00v2BS9zFIYr_LoKKKWbiOQADnkAv9XFSxR7MEgvdv8aTSFTtf-yElqHZaf2IS8’
–header ‘Content-Type: application/json’
–header ‘Cookie: TS011c04bd=01115a1c900aa5d5641be1bc537b621b9bdcfc533b67ee93946bc3f4302b33bce190bdea7c4c425f5a01039ae5634b8aee86bc7a8d’
–data-raw ‘{
“requestId”: “ba83bf0d-b53d-4bb2-a042-ce371e58939b”,
“transactionId”: “6eaf31ca-f6e6-4f91-abdf-64359ece9174”,
“patient”: {
“referenceNumber”: “kartikkaushal07@sbx”,
“careContexts”: [
{
“referenceNumber”: “17524”
},
{
“referenceNumber”: “17525”
}
]
}
}’

Response
{
“transactionId”: “6eaf31ca-f6e6-4f91-abdf-64359ece9174”,
“link”: {
“referenceNumber”: “17524”,
“authenticationType”: “MEDIATED”,
“meta”: {
“communicationMedium”: “M0BILE”,
“communicationHint”: “NDHM - emrweb”,
“communicationExpiry”: “2022-02-24T13:41:12.005”
}
}
}

Link on-confirm
curl

curl --location --request POST ‘https://dev.abdm.gov.in/cm/v1/links/link/confirm/17524
–header ‘Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJBbFJiNVdDbThUbTlFSl9JZk85ejA2ajlvQ3Y1MXBLS0ZrbkdiX1RCdkswIn0.eyJleHAiOjE2NDU3MTExMjgsImlhdCI6MTY0NTcxMDUyOCwianRpIjoiNGE2YTcxMWMtNTNkNy00MmM2LTk5M2QtMGU0OWJjZTY0MTU5IiwiaXNzIjoiaHR0cHM6Ly9kZXYubmRobS5nb3YuaW4vYXV0aC9yZWFsbXMvY2VudHJhbC1yZWdpc3RyeSIsImF1ZCI6ImFjY291bnQiLCJzdWIiOiJhNzIxM2I3MS0zZWExLTQ1OGEtOGYyNC0yZDFiMWFlZDg5ZDQiLCJ0eXAiOiJCZWFyZXIiLCJhenAiOiJTQlhfMDAwNDAyIiwic2Vzc2lvbl9zdGF0ZSI6ImM0ZWYwNzU5LWUwZGYtNDMwOC1hNjg0LWIwYmUxZjJkMTUxYSIsImFjciI6IjEiLCJhbGxvd2VkLW9yaWdpbnMiOlsiaHR0cDovL2xvY2FsaG9zdDo5MDA3Il0sInJlYWxtX2FjY2VzcyI6eyJyb2xlcyI6WyJoaXUiLCJvZmZsaW5lX2FjY2VzcyIsImhlYWx0aElkIiwiT0lEQyIsImhpcCJdfSwicmVzb3VyY2VfYWNjZXNzIjp7IlNCWF8wMDA0MDIiOnsicm9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yYc6mBW4FilKRD_4vjG54nf3PJ50iekJWZ9WB9BnDOV48kAQk9XWRkSPeyx41caO0T9My5bGIsOGA1Df55Zs20H1zAg5e5-0dSg0BYCIK2yK3-EsP5Ak_2yxYzaKkRUbM1aelXcIhQYi3xw1cSP-zLtbaPhDEuRnevepdwNZP0NIgoM0laoEPiW2gT7ArSw1jSU_8CWFjP7dy0udrf22nzdkBZ9asCkUXbvixI9qJnDSE4SaOxZiFB2eErhUR69TDbzzoDfvyJuQ_a-0DqmsdqGzjZO9lccc1lKwkEMXWGQEHzIEzyFycLthI1w8fwzaaTY5WYJnm42NaK2e7WhJA5SRQ5UhRabETK_fMrUyCxOW2z-F5B6KJWSrtmfsTm1KIgj1TmaRcyK_gTJBcIfoKYD-6MGMWQMHZiGsszHbokoX2EAEfSlq6MK1F7PoDhNw5sNYF3nz1zjEFNNtfJul3Afj5YcgGoLHxhCEeyJqRDrklXWbUq0297S605EGubQBpLqprFDeBkJsveR01T3-RNFDq5pLfvwwN0KYpT51MumdrL9ATvO0ntY332u8g9bBWaRSCO00v2BS9zFIYr_LoKKKWbiOQADnkAv9XFSxR7MEgvdv8aTSFTtf-yElqHZaf2IS8’
–header ‘Content-Type: application/json’
–header ‘Cookie: TS011c04bd=01115a1c90717e74298e6b536b1ca341cce80022fe98487dcf97b0229872f3837d4e48dfc1d1a253968be1e4d75e85117d0765bd23’
–data-raw ‘{
“token”: “999999”
}’

Response
{
“patient”: {
“referenceNumber”: “17524”,
“display”: “Patient Visit Details”,
“careContexts”: [
{
“referenceNumber”: “17524”,
“display”: “No Data Available”
}
]
}
}

hi @neha.parnami
any update on this ?

Hi @neha.parnami @Arvind_Tomar
Can you please check this, what is the issue ?

Hey @kartikkaushal, from our mock HIP (EMR) only 1 care context is linked.