FHIR Chat · Timing constraint tim-3: frequency, period and when · implementers

Stream: implementers

Topic: Timing constraint tim-3: frequency, period and when


view this post on Zulip Mustafa Yuksel (Jan 02 2017 at 12:15):

Copying Timing constraint tim-3:

On Timing.repeat: Either frequency or when can exist, not both (expression on Timing.repeat: ((period or frequency) and when).not())

This constraint creates some problems on our side, because it does not allow quite simple statements like "once a week in the morning", or "twice a day, (30 minutes) before meals". In fact, this constraint invalidates the following 3 timing examples at http://build.fhir.org/datatypes.html#Timing when they are implemented as shown on the table:

  • 1 tablet 3 times daily, 30 minutes before meals -> this can be handled by using when and offset only
  • BID, 30 mins before meal, for next 10 days -> it is not possible to express this, as aligning with meal normally implies 3 major meals in http://hl7.org/fhir/event-timing while BID means twice a day
  • Mon, Wed, Fri Morning -> this can be handled by using dayOfWeek and when only

Would it be possible to relax or remove this constraint?

Secondly, although the constraint verbally states that frequency and when cannot exist at the same time, the expression in the parenthesis does not allow period with when either. It is implemented this way in HL7 validator and in some public servers as well (e.g. Grahame's). Well, of course period implies frequency and vice versa by definition ("Event occurs frequency times per period"), but I think it would be better if a separate constraint is introduced for that if that is absolutely necessary.

view this post on Zulip Grahame Grieve (Jan 02 2017 at 16:50):

this has come up before. What if you said, every hour before meals?

view this post on Zulip Grahame Grieve (Jan 02 2017 at 16:57):

GF#12460

view this post on Zulip Lloyd McKenzie (Jan 02 2017 at 16:58):

Then you'd have a non-sensical timing - just is if you said 20mg 2-4 times a day to a maximum of 10mg/day. I'm not sure we should prevent saying useful things on the premise that sometimes people might say nonsensical things . . .

view this post on Zulip Grahame Grieve (Jan 02 2017 at 16:59):

no we shouldn't. Question is whether that task shoud be deferred - I think not

view this post on Zulip Melva Peters (Jan 02 2017 at 20:53):

Agree, this should be fixed for this release.

view this post on Zulip Grahame Grieve (Jan 02 2017 at 22:17):

I undeferred it

view this post on Zulip Mustafa Yuksel (Jan 03 2017 at 06:46):

Thanks. I have read the forge tracker item. It is a quite similar issue with "timeOfDay" and "dayOfWeek", but not exactly the same with our problem with "when". Therefore I issued a follow-up in forge.

view this post on Zulip Eric Haas (Jan 08 2017 at 19:51):

I ran into a similar problem for nutrition orders like " give this protein supplement at 12 and 4 and before bed." The contstraint makes it so you need multiple timings to mix n match 'whens' with frequency. So I support removing the constraint.


Last updated: Apr 12 2022 at 19:14 UTC