Hello Team, Nice to meet you all, I am currently ...
# general
f
Hello Team, Nice to meet you all, I am currently integrating the Medplum access policy in our app. I have done all these steps

 - Created an organization
 - Created a Practitioner and Patient profile and added the organization for both - Attached is the access policy to both patient and practitioner

 So now when I am accessing the patient list from the practitioner it returns a blank array. I get the empty array from this access policy 

Copy code
{
      "resourceType": "Patient",
      "compartment": "%patient",
      "criteria": "Patient?organization=%provider_organization"
    },
Get a blank array from this as well

Copy code
{
      "resourceType": "Patient",
      "criteria": "Patient?organization=%provider_organization"
    },
But If I do this 
 `{ "resourceType": "Patient", "compartment": “%provider_organization", },
 or this

Copy code
{
      "resourceType": "Patient",
      "compartment": “%provider_organization",
    },


 It returns all the patients including those from different organization

 Don’t know if I have missed any steps. I have followed the documentation

 Can you please help me with this?

 Thanks in advance
c
Hi @faisalali19 - A few questions so I make sure I understand: 1. I assume that you're setting "provider_organization" using parameterized Access Policies? 2. Is the organization value stored in
Patient.meta.account
? 3. Are you also storing the organization in
Patient.managingOrganization
? Using
"criteria": "Patient?organization=%provider_organization"
will only work if the Organization is in
Patient.managingOrganization
f
Hi @cody 1. Yes 2. How can I check that, I checked the response I am getting for Patient but it doesn't have
Patient.meta.account
3. Yes organization is being stored in the
Patient.managingOrganization
So I have the organization in
Patient.managingOranization
but still the response is blank Thanks in advance for the help
@cody Can you please help me with this when you are online thanks
c
Hi @faisalali19 ok, I think I understand now. This is getting into pretty complicated territory, so we may need to schedule some time to discuss how these concepts all fit together.
Patient.meta.account
is set using access policies. You can see docs here: https://www.medplum.com/docs/auth/access-control#healthcare-partnerships
Patient.managingOrganization
is not connected to
Patient.meta.account
or compartments. We could help you set that up, but it is a little involved. Feel free to DM if you'd like to discuss more
r
@faisalali19 - I'll reach out via DM
151 Views