Skip to content

feat: Add reserved no-value keyword for option sets [DHIS2-21600]#24281

Open
luciano-fiandesio wants to merge 4 commits into
masterfrom
DHIS2-21600-no-value-keyword
Open

feat: Add reserved no-value keyword for option sets [DHIS2-21600]#24281
luciano-fiandesio wants to merge 4 commits into
masterfrom
DHIS2-21600-no-value-keyword

Conversation

@luciano-fiandesio

@luciano-fiandesio luciano-fiandesio commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Introduce D2__NOVALUE as the reserved no-value keyword for option-set analytics query dimensions, while keeping legacy NV behavior for non-option-set dimensions.

events

  • Treat D2__NOVALUE as IS NULL only for option-set query items.
  • Treat NV as a literal option code for option-set dimensions.
  • Preserve legacy NV no-value behavior for non-option-set dimensions.
  • Reject D2__NOVALUE on non-option-set dimensions with E7246.
  • Append D2__NOVALUE to metaData.dimensions only when an option-set query item is explicitly filtered by it.
  • Keep rows unchanged: missing option-set values still render as empty strings.

Request

dimension=ou:ImspTQPwCqd,fWIAEtYVEGk:IN:D2__NOVALUE

Response

 "metaData": {
   "dimensions": {
      "fWIAEtYVEGk": [
                "D2__NOVALUE"
            ]
   }
 }

enrollments

  • Apply the same option-set-aware no-value keyword rules in enrollment query filtering.
  • Thread option-set context through QueryFilter, InQueryFilter, CTE filter handling, and validation.
  • Preserve CTE/null-filter semantics so no-value filters remain outside CTE filtering where required.
  • Add/update tests covering D2__NOVALUE, legacy NV, mixed filters, and validation behavior.

tracked entities

  • Add tracked entity query validation to reject D2__NOVALUE on non-option-set dimensions with E7246.
  • Pass option-set context through the tracked entity condition renderer chain.
  • Add dimensions-only metadata handling for option-set filters using D2__NOVALUE.
  • Remove the reverted row relabeling/synthetic metadata item behavior.
  • Ensure both normal query and explain paths apply the new validation rules.

@janhenrikoverland janhenrikoverland added the deploy Deploy DHIS2 instance with IM. label Jun 25, 2026
@luciano-fiandesio luciano-fiandesio force-pushed the DHIS2-21600-no-value-keyword branch from 45633c1 to 31f7071 Compare June 26, 2026 10:54
@luciano-fiandesio luciano-fiandesio removed the deploy Deploy DHIS2 instance with IM. label Jun 29, 2026
@github-actions

Copy link
Copy Markdown

Instance deployed to https://dev.im.dhis2.org/pr-24281

@sonarqubecloud

sonarqubecloud Bot commented Jul 6, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
1 New issue
1 New Code Smells (required ≤ 0)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-api-analytics-tests Enables analytics e2e tests run-api-analytics-tests-clickhouse run-api-analytics-tests-doris Enables analytics e2e tests on Doris

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants