ucam-department-of-psychiatry / camcops

Cambridge Cognitive and Psychiatric Test Kit (CamCOPS)
Other
12 stars 8 forks source link

Report request: Monthly count of questionnaires "sent out" and responses received #254

Closed martinburchell closed 1 year ago

martinburchell commented 1 year ago

The Covid Clinic would like a monthly count of questionnaires "sent out" and responses received.

RudolfCardinal commented 1 year ago
  1. For "responses received" (= tasks added), we have the existing report ("Count current task instances"); is the missing feature "Split by group" (default true)?
  2. For "questionnaires sent", that's presumably a new report. I presume they're after "tasks scheduled" (and schedule activated?), and/or "e-mails sent out to patients"? There's one scenario where an e-mail is sent and the patient doesn't respond, then another where the patient responds and everything else is via the app rather than by e-mail. So, rather than e-mails, are the two things of interest (a) schedules that have been set up/sent out but not activated, and (b) tasks triggered for activated schedules?
martinburchell commented 1 year ago

Ah yes, I hadn't spotted that. No need to split by group I would have thought. Presumably you don't see anything outside your own group(s).

I think the new feature would be for each server-side patient, the number of tasks scheduled for the date range in question.

They send follow-up emails so there isn't necessarily one email per patient.

RudolfCardinal commented 1 year ago

Oh, yes. I worried briefly about the group restriction but it is there in cc_taskreports.TaskCountReport.get_rows_colnames:

group_ids = req.user.ids_of_groups_user_may_report_on
# ...
if not superuser:
    # Restrict to accessible groups
    query = query.where(TaskIndexEntry.group_id.in_(group_ids))