FHIR Chat · Timing with frequency but no period · implementers

Stream: implementers

Topic: Timing with frequency but no period


view this post on Zulip Morten Ernebjerg (Mar 18 2021 at 17:03):

In the Timing datatype, the repeat.frequency element is defined with explicit reference to the period ("Event occurs frequency times per period"). However, there is no constraint to prevent using repeat.frequency without filling repeat.period, i.e. this would be a valid Timing:

{
     "repeat": { "frequency":  5 }
}

For the opposite case (period but no frequency), the spec says an absent frequency is equivalent to "1". However, there is no "Meaning if Missing" for repeat.period. So what would smt. like the above example mean? Or it simply one of the "nonsensical timing specifications" that the documentation explicitly acknowledges is possible?

view this post on Zulip Jean Duteau (Mar 18 2021 at 17:06):

Yes, I think it falls under the nonsensical timing specifications. It seems that a "light hand" was taken when creating the constraints on this datatype.

view this post on Zulip Jean Duteau (Mar 18 2021 at 17:07):

it could be interpreted "do 5 times at any time over the effective date range of the enclosing timing data element"

view this post on Zulip Morten Ernebjerg (Mar 18 2021 at 17:09):

Thanks @Jean Duteau, makes sense.

view this post on Zulip Lloyd McKenzie (Mar 18 2021 at 17:10):

If you'd like to make a change request for us to officially clarify that interpretation, that'd be a good thing @Morten Ernebjerg

view this post on Zulip Jean Duteau (Mar 18 2021 at 17:10):

Sort of :). That conflicts with repeat.count which be a more correct way of expressing "take 5 times at any time".

view this post on Zulip Morten Ernebjerg (Mar 18 2021 at 17:11):

Right, I was rather going with the "that would be a nonsesical timing" comment.

view this post on Zulip Jean Duteau (Mar 18 2021 at 17:12):

I went looking at timeOfDay because I thought maybe you could say "take 2 times on Saturday, Tuesday, and Thursday" but the timeOfDay comments say that isn't allowed: "The elements frequency and period cannot be used as well as dayOfWeek"

view this post on Zulip Arianne van de Wetering (May 10 2021 at 16:09):

Jean Duteau said:

I went looking at timeOfDay because I thought maybe you could say "take 2 times on Saturday, Tuesday, and Thursday" but the timeOfDay comments say that isn't allowed: "The elements frequency and period cannot be used as well as dayOfWeek"

This has been corrected in the current build, following issues FHIR-25289 and FHIR-23710.

However it now reads:

When time of day is specified, it is inferred that the action happens every day (as filtered by dayofWeek) on the specified times. If there's a timeOfDay, there cannot be a when, or vice versa.

I believe that the 'as filtered by dayofweek' is not complete, since you may also say: "Take 10:00 AM every other day", in which case it is not everyday either and frequency actually changes the repeat interval. Should we raise (another) issue to correct that?

Futhermore I believe it would be really helpful to implementers to expand the current example section and the Table with most common use cases with at least the examples mentioned here and ideally some more.

view this post on Zulip Ardon Toonstra (May 17 2021 at 16:16):

An example instance for the use case described by Arianne that does not seem to fit with the comment in the build version:

      <timing>
         <repeat>
            <frequency value="1"/>
            <period value="2"/>
            <periodUnit value="d"/>
            <timeOfDay value="10:00"/>
         </repeat>
      </timing>

This timing instance should not be interpreted as "take every day at 10:00". Do we need to fill another ticket to improve the comment? Or are we missing something?


Last updated: Apr 12 2022 at 19:14 UTC