FHIR Chat · Observation date sorting · implementers

Stream: implementers

Topic: Observation date sorting


view this post on Zulip Rowan Foster (Sep 28 2016 at 03:16):

Hi,

I was looking at implementing sorting by 'date' in Observation, but it is not clear to me from the spec how that is supposed to work. The date Search Parameter maps to Observation.effective[x]. Which can be a single date, a period (where both start and end are optional) or not specified at all.

How should I sort a period?
How should I deal with resources where no 'effective' is provided?

One option is to sort by the first non-null of effectiveDateTime, effectivePeriod.start, effectivePeriod.end, lastUpdated, however I'm not sure if using lastUpdated is an appropriate way of dealing with a potentially null effective?

view this post on Zulip Lloyd McKenzie (Sep 28 2016 at 03:26):

Can you raise a tracker item for this? We need to specify rules for this. My guess is we'd sort by the first encountered value in the range (to be consistent with searching on elements that can repeat). So the low boundary for ascending searches and the high boundary for descending searches

view this post on Zulip Rowan Foster (Sep 28 2016 at 03:27):

Ok, will do

view this post on Zulip Grahame Grieve (Sep 28 2016 at 04:11):

I think we do specify all the rules for this under date earching

view this post on Zulip Rowan Foster (Sep 28 2016 at 07:42):

Do you mean this part from _sort @Grahame Grieve?

A search parameter can refer to an element that repeats, and therefore there can be multiple values for a given search parameter for a single resource. In this case, the sort is based on the item in the set of multiple parameters that comes earliest in the specified sort order when ordering the returned resources.

It refers to repeating items, but I guess the same concept could be applied to periods as well. Although that doesn't cover what to do for resources where the item being sorted on doesn't exist. For sorting with a dates, should no value mean the dawn of time?

view this post on Zulip Lloyd McKenzie (Sep 28 2016 at 20:27):

@Grahame Grieve I don't see anything about sorting by date or quantity ranges

view this post on Zulip Grahame Grieve (Sep 29 2016 at 03:07):

well, that's what :missing is for

view this post on Zulip Grahame Grieve (Sep 29 2016 at 03:07):

no, we don't say anything about sorting, that's true

view this post on Zulip Rowan Foster (Sep 29 2016 at 19:40):

Raised tracker item in gforge
http://gforge.hl7.org/gf/project/fhir/tracker/?action=TrackerItemEdit&tracker_item_id=12205


Last updated: Apr 12 2022 at 19:14 UTC