...
Method | Path (Under /v5/studies/{studyId} | Description |
---|---|---|
GET | /participants/{userId}/adherence/eventstream | List of SessionStream reports for one user. The only view that shows scheduling for events the user does not have, this is a detailed view for one user of the whole schedule. |
GET | /participants/{userId}/adherence/daterangePaginated list of SessionsOnDate objects. Date range-based with local dates spanning 14 or less days. Does not show sessions that are not applicable to the userweekly | A single WeeklyAdherenceReport for one users. This API would generate and persist this report before returning it in the call, so that this call can be used by a worker process to build a record for every participant, but the call could also be called for up-to-date state information on a specific participant. |
GET | /participants/adherence/daterangeweekly | A paged list where each record is a set of SessionsOnDate reports for a specific user with 1-7 SessionsOnDate reports. Date-range-based with local dates spanning 7 days or less. Does not show sessions that are not applicable to the user. |
...
WeeklyAdherenceReport for one user. If no call has generated this report, it is not generated as part of this call, so a worker process will need to periodically generate these out-of-request. |
Each report builds on the latter report.
EventStream Report (all adherence data for one participant)
Weekly Adherence Report
This report always returns seven days of adherence records for a given user. The report calculates this information by finding the “week since event N” for every event and every session that includes the date for “today” (I don’t propose this timestamp will be adjustable since every timestamp would require a recalculation of all these reports). This means that the individual sessions listed in this report are not on the same calendar date. The structure of this report would be as follows:
Code Block | ||
---|---|---|
| ||
{
"participant": {
"firstName": "A-chan",
"email": "alx.dark+achan@sagebase.org",
"externalId": "asdfasdf",
"identifier": "GqYpNUWolebxS2eQudF1hc-a",
"type": "AccountRef"
},
"timestamp": "2021-11-22T21:02:24.052Z",
"weeklyAdherencePercent": 10,
"dailyReports": [
{
"day": 0,
"sessions": [
{
"sessionGuid": "LcWpQFKaGY5FSQ0LT4tnvdO7",
"label": "Session #1",
"symbol": "1",
"startDay": 7,
"startDate": "2021-11-16",
"timeWindows": [
{
"sessionInstanceGuid": "jX9oQDeCJhGvI5Ee76obsQ",
"timeWindowGuid": "GNp94CnfTTtR-s0OzrFeftrh",
"state": "expired",
"endDay": 7,
"endDate": "2021-11-16",
"type": "EventStreamWindow"
},
{
"sessionInstanceGuid": "QIi64sd_gZYbA5fgLau8ig",
"timeWindowGuid": "aRaHNKIY0yKgOl5CLuA3ZDHJ",
"state": "expired",
"endDay": 7,
"endDate": "2021-11-16",
"type": "EventStreamWindow"
}
],
"type": "EventStreamDay"
},
{
"sessionGuid": "eRLgI5gfe1kef_XRZDfdFU9I",
"label": "Session #2",
"symbol": "2",
"startDay": 7,
"startDate": "2021-11-16",
"timeWindows": [
{
"sessionInstanceGuid": "MzqzKXnkfIrcSiwkH7Yjig",
"timeWindowGuid": "KZ1piANVdeD-r8PCHL2bviLh",
"state": "expired",
"endDay": 7,
"endDate": "2021-11-16",
"type": "EventStreamWindow"
}
],
"type": "EventStreamDay"
},
{
"sessionGuid": "z_jb4p2Lr9Q56z8AwiYNieqw",
"label": "Session #3",
"symbol": "3",
"startDay": 9,
"startDate": "2021-11-24",
"timeWindows": [
{
"sessionInstanceGuid": "WHE_gHE71tk8qFERatcruA",
"timeWindowGuid": "gF6hy-UiipJLXqe7F_yK-wQc",
"state": "started",
"endDay": 9,
"endDate": "2021-11-24",
"type": "EventStreamWindow"
}
],
"type": "EventStreamDay"
}
],
"type": "DailyAdherenceReport"
},
{
"day": 1,
"sessions": [
{
"sessionGuid": "LcWpQFKaGY5FSQ0LT4tnvdO7",
"label": "Session #1",
"symbol": "1",
"startDay": 8,
"startDate": "2021-11-17",
"timeWindows": [
{
"sessionInstanceGuid": "CS8QpTlrTSJdOE39U7SfKQ",
"timeWindowGuid": "GNp94CnfTTtR-s0OzrFeftrh",
"state": "expired",
"endDay": 8,
"endDate": "2021-11-17",
"type": "EventStreamWindow"
},
{
"sessionInstanceGuid": "aeVdiKislHPpC2w0VBn5fg",
"timeWindowGuid": "aRaHNKIY0yKgOl5CLuA3ZDHJ",
"state": "expired",
"endDay": 8,
"endDate": "2021-11-17",
"type": "EventStreamWindow"
}
],
"type": "EventStreamDay"
},
{
"sessionGuid": "eRLgI5gfe1kef_XRZDfdFU9I",
"label": "Session #2",
"symbol": "2",
"startDay": 8,
"startDate": "2021-11-17",
"timeWindows": [
{
"sessionInstanceGuid": "K-P_nDWic33zjrxtlABE6Q",
"timeWindowGuid": "KZ1piANVdeD-r8PCHL2bviLh",
"state": "expired",
"endDay": 8,
"endDate": "2021-11-17",
"type": "EventStreamWindow"
}
],
"type": "EventStreamDay"
},
{
"sessionGuid": "z_jb4p2Lr9Q56z8AwiYNieqw",
"label": "Session #3",
"symbol": "3",
"startDay": 12,
"startDate": "2021-11-27",
"timeWindows": [
{
"sessionInstanceGuid": "2O-jPnpWOYZLx0VjBvvO8g",
"timeWindowGuid": "gF6hy-UiipJLXqe7F_yK-wQc",
"state": "not_yet_available",
"endDay": 12,
"endDate": "2021-11-27",
"type": "EventStreamWindow"
}
],
"type": "EventStreamDay"
}
],
"type": "DailyAdherenceReport"
},
{
"day": 2,
"sessions": [
{
"sessionGuid": "LcWpQFKaGY5FSQ0LT4tnvdO7",
"label": "Session #1",
"symbol": "1",
"startDay": 9,
"startDate": "2021-11-18",
"timeWindows": [
{
"sessionInstanceGuid": "tMiVyAuQeENIe7fi3ZI_EQ",
"timeWindowGuid": "GNp94CnfTTtR-s0OzrFeftrh",
"state": "expired",
"endDay": 9,
"endDate": "2021-11-18",
"type": "EventStreamWindow"
},
{
"sessionInstanceGuid": "OnIUXo9tqKJ3oLykKpXR0w",
"timeWindowGuid": "aRaHNKIY0yKgOl5CLuA3ZDHJ",
"state": "expired",
"endDay": 9,
"endDate": "2021-11-18",
"type": "EventStreamWindow"
}
],
"type": "EventStreamDay"
},
{
"sessionGuid": "eRLgI5gfe1kef_XRZDfdFU9I",
"label": "Session #2",
"symbol": "2",
"startDay": 9,
"startDate": "2021-11-18",
"timeWindows": [
{
"sessionInstanceGuid": "78rD1t3CCZgnZEKGhAPd_A",
"timeWindowGuid": "KZ1piANVdeD-r8PCHL2bviLh",
"state": "expired",
"endDay": 9,
"endDate": "2021-11-18",
"type": "EventStreamWindow"
}
],
"type": "EventStreamDay"
}
],
"type": "DailyAdherenceReport"
},
{
"day": 3,
"sessions": [
{
"sessionGuid": "LcWpQFKaGY5FSQ0LT4tnvdO7",
"label": "Session #1",
"symbol": "1",
"startDay": 10,
"startDate": "2021-11-19",
"timeWindows": [
{
"sessionInstanceGuid": "UqPwrEAaulC5k0dYxepz7Q",
"timeWindowGuid": "GNp94CnfTTtR-s0OzrFeftrh",
"state": "expired",
"endDay": 10,
"endDate": "2021-11-19",
"type": "EventStreamWindow"
},
{
"sessionInstanceGuid": "Tk5jW1z3zqQ7c3wt3AaCPg",
"timeWindowGuid": "aRaHNKIY0yKgOl5CLuA3ZDHJ",
"state": "expired",
"endDay": 10,
"endDate": "2021-11-19",
"type": "EventStreamWindow"
}
],
"type": "EventStreamDay"
},
{
"sessionGuid": "eRLgI5gfe1kef_XRZDfdFU9I",
"label": "Session #2",
"symbol": "2",
"startDay": 10,
"startDate": "2021-11-19",
"timeWindows": [
{
"sessionInstanceGuid": "uroDJD8YLKUmfnd4Bbd01g",
"timeWindowGuid": "KZ1piANVdeD-r8PCHL2bviLh",
"state": "expired",
"endDay": 10,
"endDate": "2021-11-19",
"type": "EventStreamWindow"
}
],
"type": "EventStreamDay"
}
],
"type": "DailyAdherenceReport"
},
{
"day": 4,
"sessions": [
{
"sessionGuid": "LcWpQFKaGY5FSQ0LT4tnvdO7",
"label": "Session #1",
"symbol": "1",
"startDay": 11,
"startDate": "2021-11-20",
"timeWindows": [
{
"sessionInstanceGuid": "ssg3P5IbxI3hlZp-AMtBKw",
"timeWindowGuid": "GNp94CnfTTtR-s0OzrFeftrh",
"state": "expired",
"endDay": 11,
"endDate": "2021-11-20",
"type": "EventStreamWindow"
},
{
"sessionInstanceGuid": "mnYMFcarqiDyhLh0DAFUaA",
"timeWindowGuid": "aRaHNKIY0yKgOl5CLuA3ZDHJ",
"state": "expired",
"endDay": 11,
"endDate": "2021-11-20",
"type": "EventStreamWindow"
}
],
"type": "EventStreamDay"
},
{
"sessionGuid": "eRLgI5gfe1kef_XRZDfdFU9I",
"label": "Session #2",
"symbol": "2",
"startDay": 11,
"startDate": "2021-11-20",
"timeWindows": [
{
"sessionInstanceGuid": "gyT_tnruCAye7_e7fODLFQ",
"timeWindowGuid": "KZ1piANVdeD-r8PCHL2bviLh",
"state": "expired",
"endDay": 11,
"endDate": "2021-11-20",
"type": "EventStreamWindow"
}
],
"type": "EventStreamDay"
}
],
"type": "DailyAdherenceReport"
},
{
"day": 5,
"sessions": [
{
"sessionGuid": "LcWpQFKaGY5FSQ0LT4tnvdO7",
"label": "Session #1",
"symbol": "1",
"startDay": 12,
"startDate": "2021-11-21",
"timeWindows": [
{
"sessionInstanceGuid": "I8dIRFzbYl6htXUSA97cHg",
"timeWindowGuid": "GNp94CnfTTtR-s0OzrFeftrh",
"state": "completed",
"endDay": 12,
"endDate": "2021-11-21",
"type": "EventStreamWindow"
},
{
"sessionInstanceGuid": "drXRrvzrBRti-4u2Pnmlxw",
"timeWindowGuid": "aRaHNKIY0yKgOl5CLuA3ZDHJ",
"state": "expired",
"endDay": 12,
"endDate": "2021-11-21",
"type": "EventStreamWindow"
}
],
"type": "EventStreamDay"
},
{
"sessionGuid": "eRLgI5gfe1kef_XRZDfdFU9I",
"label": "Session #2",
"symbol": "2",
"startDay": 12,
"startDate": "2021-11-21",
"timeWindows": [
{
"sessionInstanceGuid": "peBi0EBF60x7eKoRjRaXfQ",
"timeWindowGuid": "KZ1piANVdeD-r8PCHL2bviLh",
"state": "expired",
"endDay": 12,
"endDate": "2021-11-21",
"type": "EventStreamWindow"
}
],
"type": "EventStreamDay"
}
],
"type": "DailyAdherenceReport"
},
{
"day": 6,
"sessions": [
{
"sessionGuid": "LcWpQFKaGY5FSQ0LT4tnvdO7",
"label": "Session #1",
"symbol": "1",
"startDay": 13,
"startDate": "2021-11-22",
"timeWindows": [
{
"sessionInstanceGuid": "FHBhnKvSxoNXk9ubiWJVSw",
"timeWindowGuid": "GNp94CnfTTtR-s0OzrFeftrh",
"state": "unstarted",
"endDay": 13,
"endDate": "2021-11-22",
"type": "EventStreamWindow"
},
{
"sessionInstanceGuid": "PzplumYKek685k_DUU1lqg",
"timeWindowGuid": "aRaHNKIY0yKgOl5CLuA3ZDHJ",
"state": "completed",
"endDay": 13,
"endDate": "2021-11-22",
"type": "EventStreamWindow"
}
],
"type": "EventStreamDay"
},
{
"sessionGuid": "eRLgI5gfe1kef_XRZDfdFU9I",
"label": "Session #2",
"symbol": "2",
"startDay": 13,
"startDate": "2021-11-22",
"timeWindows": [
{
"sessionInstanceGuid": "Kz1NQRlXiDnW_viqoGYfJA",
"timeWindowGuid": "KZ1piANVdeD-r8PCHL2bviLh",
"state": "unstarted",
"endDay": 13,
"endDate": "2021-11-22",
"type": "EventStreamWindow"
}
],
"type": "EventStreamDay"
}
],
"type": "DailyAdherenceReport"
}
],
"type": "WeeklyAdherenceReport"
} |
Weekly Adherence Reports for Study
SessionStream Report
Given the designs I have seen so far, I would suggest a set of records that show the sessions to be performed N days after each event, available as a single report that’ll be similar in size to the Timeline.
...
All of these views operate on the most recent timestamps for all events. Building schedules that rely on a mutable event changing, and triggering a new timeline of sessions to perform, will not work with these adherence APIs. That would be events like “session type X has been completed.” OTOH, it will show compliance with the most recent time stream, and that might be all that matters. Past time streams are no longer actionable.
Weekly Adherence Report
Given an input date, we can take each stream, divide it into weeks, and return the week that has sessions which overlap with the input date. These seven records can generate a weekly report for the user (still a set of streams, one per event that is relevant to the schedule).
...