@rahul1 thanks! I'm using the useSubscription() hook to create a subscription and establish a WebSocket channel. When I log in as a practitioner, I'm able to trigger the addEventListener for receiving messages successfully. However, when I log in as a patient, the message listener isn’t triggered if the patient has an access policy assigned.
Here’s an example of the access policy I’ve assigned to the patient:
{
"resourceType": "Subscription",
"criteria": "Subscription?type=websocket&author=%profile"
}
Interestingly, if I don’t assign an access policy to the patient, the WebSocket connection works just fine and the addEventListener for messages is triggered as expected.
Could there be additional permissions or configurations I need to assign to the patient’s access policy to allow them to receive WebSocket messages properly?