Epidemic calendar as reporting period

I am creating a kobo project for health team. They want an epidemic calendar for reporting period. For example the selection period will be 10 may to 20 may again 21 may to 30 may in this way but not as single date. Is there any way /code to do that?


@khorsed_a Do you want to implement this at the form stage or during data analysis? If it’s in the form stage then just use a Select One question, listing all the reporting periods as individual options. If it’s the analysis stage, you could just use a regular Date question and then summarize it afterwards in Excel or whatever tool you’re using.

1 Like

@tinok Thanks a lot. Basically this kobo form will be used through out the year. And the challenge is if we create it using select one question, the drop down will be very long cause options will be around 28/30. And this is required both form and analysis stage. Do you think we can do it in any other way?

I’m not 100% sure, but are you basically asking for a way to map a specific date (eg today?) to an interval (eg May 10 - May 20)? That is, the user enters a date (or its computed automatically from today() ) but what you want to actually record in the form is the interval this lies within?

If so, are these ‘intervals’ a fixed number of days, or per week, or per month, or arbitrary? (this may affect best solution).

@Xiphware is right, we need a few more details for the ideal suggested solution. It sounds like you have 10 day intervals and you’re planning to have 28-30 periods overall.

If the periods are predefined AND the user should be able to select any of these periods, using a select_one question is the best option.

If you want to only show some of the periods based on the current date (e.g. only show periods that are during or before the current date, or only show the four most recent periods), then you could so that with a combination of a calculate question and adding a choice_filter.

1 Like

Alternatively, if the periods are well-defined (eg 10 days) AND you want the form to determine the period given a specific date (either today() or the user enters it an date question), then you should be able to calculate the period number (1,2,3…) from the year’s day number (using decimal-date-time()). Then, given the period number, you can map that to a interval name using either a jr:choice-name(), or - if the interval name doesn’t contain spaces - a selected-at().

1 Like

I think I can go with this way. Thanks a lot @tinok and @Xiphware!

umm… which way? (ie select_one vs jr:choice-name vs selected-at…)