Skip to main content

Program Indicator Engine

The SDK includes its own Program Indicator engine for the evaluation of in-line Program Indicators. These kind of indicators are evaluated within the context of an enrollment or a single event and they are usually placed in the data entry form offering additional information to the data encoder. This means that, even though they are regular Program Indicators and can be calculated across enrollments, they have provide useful information within a single enrollment.

A good example, "Average time between visits".

A bad example, "Number of active TEIs": it would always be 1.

In order to trigger the Program Indicator Engine, just execute:

d2.programModule()
.programIndicatorEngine()
.getProgramIndicatorValue(<enrollment-uid>, <event-uid>, <program-indicator-uid>);

Either enrollment-uid or event-uid must be non-null.

Compatibility table:

Common functionsSupported
ifYes
isNullYes
isNotNullYes
firstNonNullYes
greatestYes
leastYes
Function (d2:)(doc)Supported
addDaysYes
ceilYes
concatenateYes
conditionYes
countYes
countIfConditionYes
countIfValueYes
countIfZeroPosNo doc
daysBetweenYes
floorYes
hasUserRoleNo doc
hasValueYes
inOrgUnitGroupNo doc
leftYes
lengthYes
minutesBetweenYes
modulusYes
monthsBetweenYes
oizpYes
relationshipCountNo
rightYes
roundYes
splitYes
substringYes
validatePattenYes
weeksBetweenYes
yearsBetweenYes
zingYes
zpvcYes
Variables (doc)Supported
completed_dateYes
creation_dateYes
current_dateYes
due_dateYes
enrollment_countYes
enrollment_dateYes
enrollment_statusYes
event_countYes
event_dateYes
incident_dateYes
organisationunit_countN/A
program_stage_idNo
program_stage_nameNo
reporting_period_endN/A
reporting_period_startN/A
sync_dateNo
tei_countN/A
value_countYes
zero_pos_value_countYes

Other components:

ComponentSupported
PS_EVENTDATEYes