1

I'm looking at the DSTU2 CarePlan resource which has a date search parameter that searches the CarePlan.period field.

The DSTU2 search page specifies that when the target value is a Period, the target is explicitly a range (though the upper or lower bound may not be actually specified on the resource), with the following example:

date=ge2013-03-14    |    Includes a period "from 21-Jan 2013 onwards"

Does the target explicitly being a range mean that the date search parameter in this case should be treated as a range from "ge2013-03-14" to "highest possible date"?

In this case, would all CarePlans that have a period that encompasses some subset of that range qualify? For example, would a CarePlan with period:

"period": {
  "end": "2013-03-15"
}

also be included in the results?

Max
  • 13
  • 3

2 Answers2

1

All dates that aren't fully expressed down to the 10th of a millisecond are automatically treated as periods for comparison purposes. And matches would be based on whether there's a non-empty intersection between the period specified in the search and the period specified in the instance. So yes, in the example you provided, ge2013-03-14 would search for any timestamp from 2013-03-14T00:00:00.0000 and higher in the receiver's default timezone. From a matching perspective, the instance you indicated would be treated as having a start of negative-infinity and an end that would encompass all times from 2013-03-15T00:00:00.0000 through 2013-03-15:23:59:59.9999. That would have an overlap of the range of just under 2 days.

Lloyd McKenzie
  • 6,345
  • 1
  • 13
  • 10
0

The short answer: Yes
The longer answer:

"period": {
  "end": "2013-03-15"
}

means the target range is (-∞, 2013-03-15T00:00:00Z)

The search query is

date=ge2013-03-14 

means the search range is [2013-03-14T00:00:00Z, +∞)
The search prefix is ge and there exists overlaps between search range and target range. so the target is included in the search result.

If the prefix is eq then target range must be fully included in the search range.

Linden X. Quan
  • 584
  • 5
  • 18