-
Notifications
You must be signed in to change notification settings - Fork 355
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Analytics API: Add Options aggregation and disaggregation[2.42-DHIS2-18368_3] #19558
Draft
d-bernat
wants to merge
39
commits into
master
Choose a base branch
from
2.42-DHIS2-18368_3
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,195
−58
Draft
Changes from all commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
5aa2582
cherrypicking, resolve conflicts, part1
d-bernat 8bbb20f
cherrypicking, resolve conflicts, part2
d-bernat 3a85626
cherrypicking, resolve conflicts, part3
d-bernat 123bc05
cherrypicking, resolve conflicts, part3.1
d-bernat 10f0c8d
Revert "cherrypicking, resolve conflicts, part3.1"
d-bernat b2a5cdc
cherrypicking, resolve conflicts, part3.2
d-bernat 9641e6b
cherrypicking, resolve conflicts, part3.2
d-bernat 36520de
cherrypicking, resolve conflicts, part3.2
d-bernat 30ab376
code cleaning
d-bernat a6cce87
Merge branch 'master' into 2.42-DHIS2-18368_3
d-bernat 5fd5343
code cleaning
d-bernat 4c48f68
QA issues
d-bernat 55ed40d
QA issues
d-bernat f5c2da5
QA issues
d-bernat 5bcf118
bugfix unit test
d-bernat 092ab3e
bugfix unit test
d-bernat ad4b4a8
bugfix unit test
d-bernat 9614438
Merge branch 'master' into 2.42-DHIS2-18368_3
d-bernat e898458
Merge branch 'master' into 2.42-DHIS2-18368_3
d-bernat 49f4af5
code cleaning
d-bernat 86d704e
request caching
d-bernat a15edae
Merge branch 'master' into 2.42-DHIS2-18368_3
d-bernat 7e1282f
Merge branch 'master' into 2.42-DHIS2-18368_3
maikelarabori 5fdd521
fix: Small bugs and clean-up [DHIS2-18368]
maikelarabori cc51c89
fix: Conflict with master [DHIS2-18368]
maikelarabori 6c00bf2
fix: prevent NPE [DHIS2-18368]
maikelarabori 049a9c4
fix: Group by issue [DHIS2-18368]
maikelarabori 542d0f4
fix: Regex/separator for options [DHIS2-18368]
maikelarabori 6aa4be6
refactor: Extract common code [DHIS2-18368]
maikelarabori 4cf8eee
chore: Replace dot by constat [DHIS2-18368]
maikelarabori baee323
chore: Comment typo [DHIS2-18368]
maikelarabori 3eae096
chore: Comment typo [DHIS2-18368]
maikelarabori 774a948
chore: Replace dot by constat [DHIS2-18368]
maikelarabori bb64ae8
chore: Code clean-up [DHIS2-18368]
maikelarabori 656c5c2
fix: Conflicts with master [DHIS2-18368]
maikelarabori 3282d23
fix: Merge issue [DHIS2-18368]
maikelarabori 466f8d8
fix: Sonar issue [DHIS2-18368]
maikelarabori 73b0276
Merge branch 'master' of github.com:dhis2/dhis2-core into 2.42-DHIS2-…
maikelarabori a7a4bc3
fix: Bugs and missing features [DHIS2-18368]
maikelarabori File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
57 changes: 57 additions & 0 deletions
57
dhis-2/dhis-api/src/main/java/org/hisp/dhis/analytics/OptionSetSelection.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,57 @@ | ||
/* | ||
* Copyright (c) 2004-2024, University of Oslo | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions are met: | ||
* Redistributions of source code must retain the above copyright notice, this | ||
* list of conditions and the following disclaimer. | ||
* | ||
* Redistributions in binary form must reproduce the above copyright notice, | ||
* this list of conditions and the following disclaimer in the documentation | ||
* and/or other materials provided with the distribution. | ||
* Neither the name of the HISP project nor the names of its contributors may | ||
* be used to endorse or promote products derived from this software without | ||
* specific prior written permission. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR | ||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
*/ | ||
package org.hisp.dhis.analytics; | ||
|
||
import java.util.Set; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
@AllArgsConstructor | ||
@Getter | ||
public class OptionSetSelection { | ||
private String qualifiedUid; | ||
private String optionSetUid; | ||
private Set<String> options; | ||
private OptionSetSelectionMode optionSetSelectionMode; | ||
|
||
@Override | ||
public String toString() { | ||
return "OptionSetSelection{" | ||
+ "qualifiedUid='" | ||
+ qualifiedUid | ||
+ '\'' | ||
+ "optionSetUid='" | ||
+ optionSetUid | ||
+ '\'' | ||
+ ", options=" | ||
+ options | ||
+ ", optionSetSelectionMode=" | ||
+ optionSetSelectionMode | ||
+ '}'; | ||
} | ||
} |
49 changes: 49 additions & 0 deletions
49
dhis-2/dhis-api/src/main/java/org/hisp/dhis/analytics/OptionSetSelectionCriteria.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,49 @@ | ||
/* | ||
* Copyright (c) 2004-2024, University of Oslo | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions are met: | ||
* Redistributions of source code must retain the above copyright notice, this | ||
* list of conditions and the following disclaimer. | ||
* | ||
* Redistributions in binary form must reproduce the above copyright notice, | ||
* this list of conditions and the following disclaimer in the documentation | ||
* and/or other materials provided with the distribution. | ||
* Neither the name of the HISP project nor the names of its contributors may | ||
* be used to endorse or promote products derived from this software without | ||
* specific prior written permission. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR | ||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
*/ | ||
package org.hisp.dhis.analytics; | ||
|
||
import static org.apache.commons.lang3.StringUtils.EMPTY; | ||
|
||
import java.util.Map; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
public class OptionSetSelectionCriteria { | ||
private Map<String, OptionSetSelection> optionSetSelections; | ||
|
||
@Override | ||
public String toString() { | ||
if (optionSetSelections == null || optionSetSelections.isEmpty()) { | ||
return EMPTY; | ||
} | ||
|
||
return "OptionSetSelectionCriteria{" + "optionSetSelections=" + optionSetSelections + '}'; | ||
} | ||
} |
49 changes: 49 additions & 0 deletions
49
dhis-2/dhis-api/src/main/java/org/hisp/dhis/analytics/OptionSetSelectionMode.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,49 @@ | ||
/* | ||
* Copyright (c) 2004-2024, University of Oslo | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions are met: | ||
* Redistributions of source code must retain the above copyright notice, this | ||
* list of conditions and the following disclaimer. | ||
* | ||
* Redistributions in binary form must reproduce the above copyright notice, | ||
* this list of conditions and the following disclaimer in the documentation | ||
* and/or other materials provided with the distribution. | ||
* Neither the name of the HISP project nor the names of its contributors may | ||
* be used to endorse or promote products derived from this software without | ||
* specific prior written permission. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR | ||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
*/ | ||
package org.hisp.dhis.analytics; | ||
|
||
import java.util.Arrays; | ||
import java.util.List; | ||
|
||
/** The selection modes for dimension items with {@link OptionSet}. */ | ||
public enum OptionSetSelectionMode { | ||
/** | ||
* All options in an option set are chosen and aggregated into a single column. This selection is | ||
* relative, so any new options added to the option set are included. This is the default mode. | ||
*/ | ||
AGGREGATED, | ||
/** | ||
* All options in an option set are chosen and displayed as data items. This selection is | ||
* relative, so any new options added to the option set are included. | ||
*/ | ||
DISAGGREGATED; | ||
|
||
public static List<String> getOptionSetSelectionModes() { | ||
return Arrays.stream(OptionSetSelectionMode.values()).map(Enum::toString).toList(); | ||
} | ||
} |
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check notice
Code scanning / CodeQL
Exposing internal representation Note