yaaaaale
03/11/2024, 7:27 PMMedplumClient#searchResourcePages to iterate over all of our project memberships, and pulling in their associated practitioners and practitioner roles. To do this, I'm using _include and _revinclude:iterate.
The search is returning the correct results for the first page. However, the results on the following pages are missing the practitioner roles. When I dug a little deeper, I saw that the search parameters on the search bundle's links were a little bit off.
Here's an example. The params passed into `searchResourcePages`:
for await (const resources of this.medplumAdmin.searchResourcePages<ResultType>('ProjectMembership', {
'profile-type': 'Practitioner',
_include: 'ProjectMembership:profile',
'_revinclude:iterate': 'PractitionerRole:practitioner',
_count: 5,
})) {
The first result set contains all the resources I would expect. However, I notice that the bundle link for the next page shows this:
https://api.medplum.com/fhir/R4/ProjectMembership?_count=5&_include=ProjectMembership:profile&_offset=5&_revinclude=PractitionerRole:practitioner&profile-type=Practitioner
Notice that _revinclude does not have the :iterate modifier.rahul1
03/11/2024, 7:47 PMrahul1
03/11/2024, 7:48 PMyaaaaale
03/11/2024, 7:48 PMyaaaaale
03/11/2024, 7:48 PMrahul1
03/12/2024, 6:24 PM