Skip to content

Commit

Permalink
Merge pull request #17136 from CDCgov/fix/engagement/apham/deliveries…
Browse files Browse the repository at this point in the history
…-query-quickfix

quick fix for deliveries query for ELIMS reports
  • Loading branch information
the-andrew authored Jan 23, 2025
2 parents cadc9fa + 386d68a commit 4a2231a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,15 @@ class DatabaseDeliveryAccess(
val org = BaseEngine.settingsProviderSingleton.findOrganization(organization)

var filter = if (org?.featureFlags?.contains("ELIMS_DATA") == true) {
REPORT_FILE.NEXT_ACTION.isNull
.and(REPORT_FILE.TRANSPORT_PARAMS.isNotNull)
.and(REPORT_FILE.TRANSPORT_RESULT.notLike("%downloadedBy%"))
.and(REPORT_FILE.SCHEMA_TOPIC.equalIgnoreCase(Topic.ELR_ELIMS.jsonVal))
.and(REPORT_FILE.RECEIVING_ORG.eq(organization))
REPORT_FILE.NEXT_ACTION.eq(TaskAction.send)
.and(REPORT_FILE.SCHEMA_TOPIC.notEqualIgnoreCase(Topic.ELR_ELIMS.jsonVal))
.or(
REPORT_FILE.NEXT_ACTION.isNull
.and(REPORT_FILE.TRANSPORT_PARAMS.isNotNull)
.and(REPORT_FILE.TRANSPORT_RESULT.notLike("%downloadedBy%"))
.and(REPORT_FILE.SCHEMA_TOPIC.equalIgnoreCase(Topic.ELR_ELIMS.jsonVal))
)
.and(REPORT_FILE.RECEIVING_ORG.eq(organization))
} else {
REPORT_FILE.NEXT_ACTION.eq(TaskAction.send)
.and(REPORT_FILE.RECEIVING_ORG.eq(organization))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,18 @@ class HistoryDatabaseAccessTests {
fun `test organizationFilter with feature flag`() {
var conditionExpected = """
(
"public"."report_file"."next_action" is null
and "public"."report_file"."transport_params" is not null
and "public"."report_file"."transport_result" not like '%downloadedBy%'
and lower(cast("public"."report_file"."schema_topic" as varchar)) = lower('elr-elims')
(
(
"public"."report_file"."next_action" = 'send'
and lower(cast("public"."report_file"."schema_topic" as varchar)) <> lower('elr-elims')
)
or (
"public"."report_file"."next_action" is null
and "public"."report_file"."transport_params" is not null
and "public"."report_file"."transport_result" not like '%downloadedBy%'
and lower(cast("public"."report_file"."schema_topic" as varchar)) = lower('elr-elims')
)
)
and "public"."report_file"."receiving_org" = 'test'
and "public"."report_file"."receiving_org_svc" = 'test'
)
Expand Down

0 comments on commit 4a2231a

Please sign in to comment.