...
Code Block |
---|
class Schedule2 {
List<StudyBurst> studyBursts;
}
// Session is augmented to reference one or more study bursts. A session
// must referenced at least one event ID or study burst ID (it does not
// need to have both, but it can).
class Session {
List<String> studyBurstIds;
}
class StudyBurst {
String identifier;
String originEventId;
String int occurrences;
Period interval; // positive or negative
} |
When an event is published (this can be a custom event or a compound system event, like the time a session is finished), and it matches a study burst originEventId
, then a sequence of events will be published based on the StudyBurst
configuration. The event ID will be in the format burst:<studyBurstIdentifier>:#
where the # is the occurrence number of the new event (1-based). The value will be the timestamp of the event + (the interval specified by the study burst * the occurrence number). All these events are published up-front because they are mutable. If the internal publication of these events finds that the event is already in the user’s event map, then it will not be regenerated.
Info |
---|
Example A study burst with an identifier of “foo” triggered on enrollment, four times, with an interval of P1W, would produce the following event IDs and timestamps if the enrollment was published at 2021-05-14T10:00:00.000-07:00:
|
...
|
In effect, study bursts are calculated and treated similarly to automatic custom events, but they are defined in a way that captures the intent of automatic custom events.
When a study is converted to a Timeline, each session that has one or more study bursts will determine the event identifiers of the study burst (which does not require calculation of a time), and all these event IDs will be added to the session’s startEventIds before the session is then converted into scheduled sessions that encode one starting event each.
For example, a study burst named “foo” triggered from “enrollment” four times, at an interval of P1W, would (in the old notation) generate the automatic custom events “foo1 → enrollment:P1W”, “foo2 → enrollment:P2W”, “foo3 → enrollment:P3W”, “foo4 → enrollment:P4W”.
Initially a schedule would need to reference these automatic custom events, but we can probably include a study burst reference in the Session object and expand that when generating a timeline, so that the client still works with automatic custom events, which is what it finds in the participant’s event map.
This last part is a drag for Alina until we can improve the system; I will try and do that when I add the ability to associate multiple event IDs as triggers for a given session.
Make automatic custom events mutable
Once created, it should be possible to change the timestamp associated with an automatic custom event through the existing study custom event APIs
Info |
---|
Example Continuing the example above, if the “foo” study burst were referenced in a Session that specified startEventIds as [“event1”, “event2”] then the final set of events that would be processed into a timeline would be [“event1”, “event2”, “burst:foo:1”, “burst:foo:2”, “burst:foo:3”, “burst:foo:4”]. Every single instance of a scheduled session would produce six scheduled sessions, each of which would encode a different instanceGuid for a different event ID, but all would point to the same |