FHIR Chat · Sort Order for a value set? · implementers

Stream: implementers

Topic: Sort Order for a value set?


view this post on Zulip Marvin Greenberg (Dec 01 2021 at 18:14):

This came up with someone wanting to sort on DetectedIssue.severity. https://www.hl7.org/fhir/valueset-detectedissue-severity.html

The codes are 'high', 'moderate', 'low' which gives an alphabetic sort like 'high', 'low', 'medium' which is not obviously sensible. Is there a way for ValueSet or a SearchParameter to somehow express sort order?

view this post on Zulip Grahame Grieve (Dec 01 2021 at 19:12):

you can assign them a score which gives them a logical order. https://hl7.org/fhir/extension-ordinalvalue.html. But displaying them in order... ? Typically, they are defined in a value set in the order you should display them in

view this post on Zulip Marvin Greenberg (Dec 01 2021 at 19:25):

So display in order: I mean, if I did GET .../DetectedIssue?_sort=severity I would want the severity high to be displayed first when paginating, then medium, then low. (We defined a SearchParameter for severity) I think we would have to make more changes to our implementation to be able to use an ordinalvalue extension for sorting, but its good to know the "correct" FHIR to model this.

view this post on Zulip Lloyd McKenzie (Dec 01 2021 at 23:44):

_sort=severity will typically sort the content alphabetically by code. If you want to sort by an ordinal value associated with a code, you'll typically need a special search parameter for that.


Last updated: Apr 12 2022 at 19:14 UTC