Skip to content
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

16409 do not use receive step to determine root report #16723

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

jack-h-wang
Copy link
Collaborator

@jack-h-wang jack-h-wang commented Dec 5, 2024

This PR adjusts the search for root reports to not rely on explicitly searching for the receive step report. Additionally, the root report from the submissions endpoint should now include the sender-supplied payloadname if present.

Test Steps:

  1. The tests in ReportGraphTest and FhirTranslatorIntegrationTests are sufficient

Changes

  • Do not use receive step as indicator of a root report.
    • Instead, a root report is determined by a report ID that does not appear in the report_lineage table as a child report.
  • Retrieve payloadname from submission endpoint message headers when creating root report.

Checklist

Testing

  • Tested locally?
  • Ran ./prime test or ./gradlew testSmoke against local Docker ReportStream container?
  • (For Changes to /frontend-react/...) Ran npm run lint:write?
  • Added tests?

Linked Issues

Copy link

github-actions bot commented Dec 5, 2024

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails

Scanned Manifest Files

Copy link

github-actions bot commented Dec 5, 2024

Test Results

1 257 tests  +2   1 253 ✅ +2   7m 45s ⏱️ +10s
  164 suites ±0       4 💤 ±0 
  164 files   ±0       0 ❌ ±0 

Results for commit b7c1982. ± Comparison against base commit e8025be.

This pull request removes 2 and adds 4 tests. Note that renamed tests count towards both.
gov.cdc.prime.router.fhirengine.azure.FHIRTranslatorIntegrationTests ‑ successfully translate HL7 for FHIR receiver when isSendOriginal is true()
gov.cdc.prime.router.fhirengine.azure.FHIRTranslatorIntegrationTests ‑ successfully translate for FHIR receiver when isSendOriginal is true()
gov.cdc.prime.router.fhirengine.azure.FHIRTranslatorIntegrationTests ‑ successfully translate HL7 for FHIR receiver when isSendOriginal is true from convert step()
gov.cdc.prime.router.fhirengine.azure.FHIRTranslatorIntegrationTests ‑ successfully translate HL7 for FHIR receiver when isSendOriginal is true from receive step()
gov.cdc.prime.router.fhirengine.azure.FHIRTranslatorIntegrationTests ‑ successfully translate for FHIR receiver when isSendOriginal is true from convert step()
gov.cdc.prime.router.fhirengine.azure.FHIRTranslatorIntegrationTests ‑ successfully translate for FHIR receiver when isSendOriginal is true from receive step()

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Dec 5, 2024

Integration Test Results

 59 files  ±0   59 suites  ±0   38m 34s ⏱️ +28s
423 tests ±0  413 ✅ ±0  10 💤 ±0  0 ❌ ±0 
426 runs  ±0  416 ✅ ±0  10 💤 ±0  0 ❌ ±0 

Results for commit b7c1982. ± Comparison against base commit e8025be.

♻️ This comment has been updated with latest results.

@jack-h-wang jack-h-wang added the platform Platform Team label Dec 6, 2024
@jack-h-wang jack-h-wang force-pushed the platform/jwang/16409-query-root-report-without-receive branch from 5c35630 to 4f56b4b Compare December 9, 2024 17:21
@jack-h-wang jack-h-wang marked this pull request as ready for review December 11, 2024 03:37
@jack-h-wang jack-h-wang requested a review from a team as a code owner December 11, 2024 03:37
@@ -178,7 +180,8 @@ class FHIRConverter(
// is properly recorded in the report file table with the correct sender
actionHistory.trackExternalInputReport(
report,
BlobAccess.BlobInfo(format, blobUrl, blobDigest.toByteArray())
BlobAccess.BlobInfo(format, blobUrl, blobDigest.toByteArray()),
payloadName
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change to carry over payloadname from the submissions API is needed to continue supporting the sendOriginal function. This adds the information to the root report being created here.

.leftJoin(REPORT_LINEAGE)
.on(REPORT_FILE.REPORT_ID.eq(REPORT_LINEAGE.CHILD_REPORT_ID))
.where(REPORT_LINEAGE.PARENT_REPORT_ID.isNull())
.orderBy(REPORT_FILE.ACTION_ID.asc())
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The previous query was to join the action table in order to check if the action_name is receive. The new query instead filters the list of reports to only include those that do not appear in report_lineage as a child. This list is then ordered by action_id to ensure the results are output in a consistent order. The join to the action table is removed since it is no longer necessary.

@@ -798,4 +798,166 @@ class FHIRTranslatorIntegrationTests : Logging {
assertThat(translatedValue).isEqualTo(reportContents.toByteArray())
}
}

@Test
fun `successfully translate HL7 for FHIR receiver when isSendOriginal is true from convert step`() {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These tests ensure sendOriginal items still function when convert is the root report, as the case would be when the submissions API is used.

@jack-h-wang jack-h-wang force-pushed the platform/jwang/16409-query-root-report-without-receive branch from d665d9b to b7c1982 Compare December 11, 2024 23:52
Copy link

sonarcloud bot commented Dec 12, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform Platform Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Identify and update DB queries to be independent of the Receive step
1 participant