Skip to content

Commit

Permalink
fix: Remove event end enrollment checks for TE tables [DHIS2-16705] (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
larshelge authored Dec 11, 2024
1 parent ecbacc1 commit a76d1ee
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -325,12 +325,6 @@ public void populateTable(AnalyticsTableUpdateParams params, AnalyticsTableParti
"""
\swhere te.trackedentitytypeid = ${tetId} \
and te.lastupdated < '${startTime}' \
and exists (select 1 from ${enrollment} en \
where en.trackedentityid = te.trackedentityid \
and exists (select 1 from ${event} ev \
where ev.enrollmentid = en.enrollmentid \
and ev.status in (${statuses}) \
and ev.deleted = false)) \
and te.created is not null \
and te.deleted = false""",
Map.of(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,6 @@ public JdbcTrackedEntityEnrollmentsAnalyticsTableManager(
this.trackedEntityTypeService = trackedEntityTypeService;
}

/**
* Returns the {@link AnalyticsTableType} of analytics table which this manager handles.
*
* @return type of analytics table.
*/
@Override
public AnalyticsTableType getAnalyticsTableType() {
return TRACKED_ENTITY_INSTANCE_ENROLLMENTS;
Expand Down Expand Up @@ -239,10 +234,7 @@ public void populateTable(AnalyticsTableUpdateParams params, AnalyticsTableParti
and te.lastupdated < '${startTime}' \
left join ${program} p on en.programid=p.programid \
left join analytics_rs_orgunitstructure ous on en.organisationunitid=ous.organisationunitid \
where exists (select 1 from ${event} ev where ev.deleted = false \
and ev.enrollmentid = en.enrollmentid \
and ev.status in (${statuses})) \
and en.occurreddate is not null \
where en.occurreddate is not null \
and en.deleted = false\s""",
Map.of(
"trackedEntityTypeId", valueOf(tetId),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,6 @@ public JdbcTrackedEntityEventsAnalyticsTableManager(
this.analyticsSqlBuilder = analyticsSqlBuilder;
}

/**
* Returns the {@link AnalyticsTableType} of analytics table which this manager handles.
*
* @return type of analytics table.
*/
@Override
public AnalyticsTableType getAnalyticsTableType() {
return TRACKED_ENTITY_INSTANCE_EVENTS;
Expand Down

0 comments on commit a76d1ee

Please sign in to comment.