Stream: implementers
Topic: Timing : event operation vs. repeat
Olivier Boux (Oct 13 2021 at 12:33):
Timing : event operation vs. repeat
I'm not clear on how event vs repeat works.
Exemple of timing:
"timing": {
"event": [
"2021-10-13T10:30:00Z"
],
"repeat": {
"boundsPeriod": {
"start": "2021-10-13",
"end": "2021-10-20"
},
"frequency": 1,
"period": 1,
"periodUnit": "d",
"timeOfDay": [
"07:00:00",
"18:00:00"
]
}
}
Does it means :
-
the 2021-10-13T10:30:00Z dose is added to every day doses at 07:00 and 18:00
i.e. operation: event + repeat
or -
no dose is scheduled as there is no match between 2021-10-13T10:30:00Z and the times of day 07:00 or 18:00
i.e. operatioin event * repeat
Grahame Grieve (Oct 13 2021 at 19:52):
I think it's invalid - if you say 'once a day', you can't specify two times of the data
Olivier Boux (Oct 15 2021 at 11:38):
Sorry, forget "frequency": 1
as I want "repeat" to express "every day at 7h and 18h form 10/13/21 to 10/20/21".
How do I understand its combination with "event": ["2021-10-13T10:30:00Z"] ?
Olivier Boux (Oct 15 2021 at 11:52):
(I delete the frequency element because the timeOfDay element is more accurate)
Lloyd McKenzie (Oct 15 2021 at 14:25):
I don't think you need 'event'. You just need repeat.boundsRange, repeat.time
Olivier Boux (Oct 15 2021 at 21:55):
Yes, I think so.
But my question is, what does it mean when I get this mix of event and repeat?
- Is it allowed or not?
- If it is allowed, do I have to do the intersection of event and repeat (which gives the empty set) or do I have to do the union of event and repeat (which gives 17 time-stamped unit events)
Lloyd McKenzie (Oct 15 2021 at 22:19):
My understanding is that if both are present, the events indicate the 'instantiation' of the repeat pattern. If the two don't jive, then I think you've got an error.
Lloyd McKenzie (Oct 15 2021 at 22:21):
@Grahame Grieve ?
Grahame Grieve (Oct 15 2021 at 22:53):
When both event and a repeating specification are provided, the list of events should be understood as an interpretation of the information in the repeat structure
Lloyd McKenzie (Oct 15 2021 at 23:01):
Right - but if the repeat structure says "do this twice a day for 10 days" and event lists 3 times on one day and nothing else, that's an error - correct?
Grahame Grieve (Oct 15 2021 at 23:08):
yes
Olivier Boux (Oct 16 2021 at 13:31):
Grahame Grieve said:
When both event and a repeating specification are provided, the list of events should be understood as an interpretation of the information in the repeat structure
1st lesson in computer science: learning to read. Sorry.
If, in practice, event and repeat are exclusive, wouldn't it be better to have an 11th rule (I suppose : event.empty() or repeat.emty()), like tim-10 (timeOfDay.empty() or when.empty())
Lloyd McKenzie (Oct 16 2021 at 15:58):
They're not exclusive - and there's value in having both. Some systems start with the 'repeat' timing and then generate an 'event' timing to be used by downstream systems that aren't bright enough to figure out the event timing and/or to realize the repeat expectations in a manner that aligns with organizational practices/optimizes workflows.
Olivier Boux (Oct 18 2021 at 05:29):
Ok, I didn't imagine this use case.
Thanks
Last updated: Apr 12 2022 at 19:14 UTC