Skip to content

Commit

Permalink
fix: full prefix for dataemelent [DHIS2-13779] (#15701)
Browse files Browse the repository at this point in the history
Co-authored-by: Jan Henrik Øverland <[email protected]>
  • Loading branch information
gnespolino and janhenrikoverland authored Nov 16, 2023
1 parent d3d504f commit 77a9662
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,22 @@

import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.hisp.dhis.common.PrefixedDimension;
import org.hisp.dhis.dataelement.DataElement;
import org.hisp.dhis.program.ProgramStageDataElement;

@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class TeiAnalyticsPrefixStrategy implements PrefixStrategy {

public static final PrefixStrategy INSTANCE = EnrollmentAnalyticsPrefixStrategy.INSTANCE;
public static final PrefixStrategy INSTANCE = new TeiAnalyticsPrefixStrategy();

@Override
public String apply(PrefixedDimension pDimension) {
throw new UnsupportedOperationException("This method should not be called for TEI analytics");
if (pDimension.getItem() instanceof DataElement
|| pDimension.getItem() instanceof ProgramStageDataElement) {
return pDimension.getPrefix();
}
return StringUtils.EMPTY;
}
}

0 comments on commit 77a9662

Please sign in to comment.