Sorting on nested types
# support
j
Hi, is there a way to sort on nested types where there is a one-to-one mapping? For example, we'd like to sort a list of ExplanationOfBenefits on
billablePeriod.start
. Thanks!
r
Hi @jnak - sorting is only possible on the search paramaters defined for the resource type (https://www.medplum.com/docs/search/basic-search#sorting-the-results) Unfortunately, the EOB resource type only defines the
created
field as a search datetime search parameter https://www.medplum.com/docs/api/fhir/resources/explanationofbenefit#search-parameters
j
Got it. Thanks for the clarification! I guess we'll have to do the sorting ourselves, but that's totally fine for now. Are these searchable fields defined by FHIR?
Btw the doc currently says "The _sort parameter allows you specify a list of search parameters to sort by, in order". It might be a good place to mention that every resource defines its own set of searchable parameters and that those are listed on each resource page. I had missed that when I first read that page.
r
@jnak , yes these are defined by the FHIR spec 🙂 Thanks for the feedback. Curious what you think the right solution is here? At the top of the doc, we provide some background on FHIR search parameters. Would the solution be to add a link on the phrase "search parameters" to the earlier section of the doc? https://www.medplum.com/docs/search/basic-search#search-parameters
j
I guess it was not clear that search parameters were a defined concept in that context. Linking to it may would help convey that. Or maybe I just read it too fast the first time 😉