-
Notifications
You must be signed in to change notification settings - Fork 354
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dab977a
commit f383bac
Showing
3 changed files
with
62 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
...ervices/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/common/CTEUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package org.hisp.dhis.analytics.common; | ||
|
||
import org.hisp.dhis.common.QueryItem; | ||
|
||
public class CTEUtils { | ||
|
||
public static String createFilterName(QueryItem queryItem) { | ||
return "filter_" + getIdentifier(queryItem).replace('.', '_').toLowerCase(); | ||
} | ||
|
||
public static String createFilterNameByIdentifier(String identifier) { | ||
return "filter_" + identifier.replace('.', '_').toLowerCase(); | ||
} | ||
|
||
public static String getIdentifier(QueryItem queryItem) { | ||
String stage = queryItem.hasProgramStage() ? queryItem.getProgramStage().getUid() : "default"; | ||
return stage + "." + queryItem.getItemId(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters