Skip to content

APP-489: Convert NBSSR00010 (Multi-Year Line Graph of Disease Cases)#3209

Merged
JordanGuinn merged 16 commits into
mainfrom
jg/APP-489
May 12, 2026
Merged

APP-489: Convert NBSSR00010 (Multi-Year Line Graph of Disease Cases)#3209
JordanGuinn merged 16 commits into
mainfrom
jg/APP-489

Conversation

@JordanGuinn
Copy link
Copy Markdown
Contributor

@JordanGuinn JordanGuinn commented May 5, 2026

Description

This PR converts NBSSR00010 to Python (which is effectively just NBSSR00011 in line-graph form).

Tickets

Checklist before requesting a review

  • Copy this checklist into your (draft) PR description
  • Check the existing description for the library in apps/modernization-api/src/main/resources/db/changelog/report/execution/03_ODSE_Data_Report_Library_Init.sql
    • If the report execution service is not yet in use by any STLT (even beta), you should update this file
    • Update the description in the library-specific migration
  • Add a migration to apps/modernization-api/src/main/resources/db/report/execution/libraries named <your library name>.sql
    • Copy another migration and update the variables at the top of the file
  • Add the migration to apps/modernization-api/src/main/resources/db/report-execution-changelog.yml. It should be added to the latest changeSet since the last release - this could require a new changeSet if there isn't one since last release
  • Check the migration works by building/running the containerized dev setup
  • Add a python library file to apps/report-execution/src/libraries named in lowercase, but generally following the naming convention of SAS (needs to be human recognizable as the same library)
  • Follow the pattern established in existing libraries to create your library. The execute function is the required method and its signature will (someday) be checked for validity
    • Make sure pertinent text embedded in the reports is included in the description of the report
    • Note in the doc string any deviation from the SAS
  • Keep an eye out for things in the sas library that are/could be centralized to pre- or post-processing or a util would be helpful for (e.g. common formatting needs)
  • Add integration tests in a apps/report-execution/tests/libraries/<your_library_here>py file following the conventions established for other libraries
    • The subset_sql can be assumed to be well tested by the modernization-api, so focus on any logic and additional joins/queries/analysis that is added in the library
    • The database used in integration testing is our standard golden db + seed used in other testing - if additional data is needed to test the report, add it to the seeding process
  • Add e2e test coverage for the report
    • If this step is not set up, create a ticket to track this as follow on work needed for this report
  • Check that the report has parity with the NBS 6 version using (https://cdc-nbs.atlassian.net/wiki/spaces/NE/pages/2372272139/Comparison+Testing+Libraries)
  • Keep an eye out for opportunities to:
    • Consolidate reports by using parameters (parameter design tbd)
    • Improve the report spec or result expectations
  • Update the SAS to Python tracking spreadsheet with information about the newly converted library
  • Update/clarify these instructions in the epic based on your experience

('NBSSR00008.SAS', 'SR8: Report of Disease Cases Over Selected Time Period. Report demonstrates, in table form, the total number of Investigation(s) [both Individual and Summary] by County irrespective of Case Status.'),
('NBSSR00009.SAS', 'SR9: Selected Disease by Month and County. Report demonstrates the total number of monthly Investigation(s) [both Individual and Summary] for a given disease and State, by County, irrespective of Case Status.'),
('NBSSR00010.SAS', 'SR10: Multi-Year Line Graph of Disease Cases. Report demonstrates, using a multi-year line graph, the total number of yearly Investigation(s) [both Individual and Summary] for a given disease, by State, irrespective of Case Status.'),
('NBSSR00010.SAS', 'SR10: Multi-Year Line Graph of Disease Cases. Report demonstrates, in table form, the total number of yearly Investigation(s) [both Individual and Summary] for a given disease, by State, irrespective of Case Status.'),
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Not sure what we want to do about the name of the report here - Multi-Year Line Graph is in the title 😬 Do we want to simply rename it?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think I'd leave it since this is one we're not directly replacing and are ultimately deleting this data if all goes well

@JordanGuinn JordanGuinn marked this pull request as ready for review May 5, 2026 19:10
@JordanGuinn JordanGuinn requested a review from a team as a code owner May 5, 2026 19:10
@JordanGuinn JordanGuinn requested review from brick-green and mcmcgrath13 and removed request for a team May 5, 2026 19:10
@mcmcgrath13
Copy link
Copy Markdown
Contributor

@JordanGuinn I don't see the functional testing CSVs in the library catalog - can you upload?

@JordanGuinn
Copy link
Copy Markdown
Contributor Author

@mcmcgrath13 Will do, just wanted to get enough data in the reports first so that comparisons were relatively meaningful.

YEAR(event_date) as [Year],
SUM(group_case_cnt) as [Cases]
FROM subset
WHERE event_date IS NOT NULL
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added this to avoid discrepancies found during functional testing for both 11 and 10.

@mcmcgrath13
Copy link
Copy Markdown
Contributor

I ran diff, but it looks like there's a bunch of wonky whitespace on the python version - any ideas?
image

@mcmcgrath13
Copy link
Copy Markdown
Contributor

found the padding issue: #3210

@JordanGuinn
Copy link
Copy Markdown
Contributor Author

@mcmcgrath13 Python report for testing has been regenerated and re-uploaded!

@mcmcgrath13
Copy link
Copy Markdown
Contributor

I'm still seeing non-printable character/new line discrepancies on the diff, which makes the diff noisy - any ideas why?

Copy link
Copy Markdown
Contributor

@mcmcgrath13 mcmcgrath13 left a comment

Choose a reason for hiding this comment

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

🥇

@JordanGuinn
Copy link
Copy Markdown
Contributor Author

Finally realized that the failing regression test is not in fact a flaky test, but the result of the conversion/modernization of the SR10 report. The test currently resides in the nbs-classic test suite, but I'm not sure if we want to keep validating that 6 version of the module, or instead validate 7 (or both!). So I suppose the options I see here are:

  • Update the existing test to work with the new 7 UI
  • Update the existing test to instead reference 6 directly (or disable reporting for this test case)
  • Skip the test entirely for now

@sonarqubecloud
Copy link
Copy Markdown

@JordanGuinn JordanGuinn merged commit 8b504ff into main May 12, 2026
7 checks passed
@JordanGuinn JordanGuinn deleted the jg/APP-489 branch May 12, 2026 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants