Search bundle links are excluding `_revinclude:ite...
# support
y
Hi there! I'm using
MedplumClient#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`:
Copy code
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.
r
Hi @yaaaaale , unfortunately that looks like a bug. i can file the GH issue. Thanks for surfacing it!
just one note, for pagination to be consistent, you'll also need to introduce a consistent sort
y
Ah, that’s a great callout!
Thanks @rahul1
128 Views