FHIR Chat · Searching by number of elements · hapi

Stream: hapi

Topic: Searching by number of elements


view this post on Zulip Vladimir Shapira (Apr 06 2022 at 18:26):

Hello experts,

I'm playing with searching requests on Hapi server.
I was wondering if its possible to search by number of elements in the resource?
Something like - get all patient resources with 20 or more elements/fields in the resource
Or - get all patient with less than 10 elements in the resource?

Thanks ahead for any info and help,
Vlad

view this post on Zulip Daniel Venton (Apr 06 2022 at 21:05):

I don't imagine that it would be. That's very subject to interpretation. For instance you have an array of names. Is it 1 element because the array exists? Is it 2 because the array exists and it has 1 slot filled? Is it 4 elements because it exists, has 1 slot, slot 1 has family and suffix attributes populated? .......

view this post on Zulip Patrick Werner (Apr 07 2022 at 07:40):

Vladimir Shapira said:

Hello experts,

I'm playing with searching requests on Hapi server.
I was wondering if its possible to search by number of elements in the resource?
Something like - get all patient resources with 20 or more elements/fields in the resource
Or - get all patient with less than 10 elements in the resource?

Thanks ahead for any info and help,
Vlad

Hi, your use-case is not covered by the FHIR spec and hapi.
Out of curiosity, what is the use-case for such a search?

view this post on Zulip Brian Postlethwaite (Apr 07 2022 at 08:20):

I expect that might be possible with a custom search parameter using the descendants().count fhirpath expression

view this post on Zulip Vladimir Shapira (Apr 07 2022 at 16:09):

Hi,
Thanks for replies for this.

Hi, your use-case is not covered by the FHIR spec and hapi.
Out of curiosity, what is the use-case for such a search?

Probably no specific use case for this, just testing different searches.
Most responses i get from Hapi are simple examples, for example for patient are just name and last name.
Was thinking if there is such a search possible, it will find me patients with more data/complex examples - just to have more diversity of returned data. Patient is just example of resource, yeah i could use patient specific parameters, but these will not work for other resources.

view this post on Zulip James Agnew (Apr 08 2022 at 22:17):

Yeah, I actually expect @Brian Postlethwaite 's idea would work if you created a search parameter of type number. Definitely have never tried this though...


Last updated: Apr 12 2022 at 19:14 UTC