Number of days between dates from different program stages

Hi All,

I would like to know if it is possible to calculate number of days between dates in different program stages.

Thanks

Hi there!
Yes you can. Have a look at the reference table and see the d2:xxxBetween date functions:
https://docs.dhis2.org/en/use/user-guides/dhis-core-version-236/configuring-the-system/programs.html#program_indicator_functions_variables_operators

These functions accepts a syntax that references the (latest) event date for a program stage in an enrollment:
PS_EVENTDATE:(programStageUid)
In your example:
d2:daysBetween(PS_EVENTDATE:(admisstionProgramStageUid), PS_EVENTDATE:(dischargeProgramStageUid))

Markus

2 Likes