Skip to content

[APP-628] Convert PA02 Library#3317

Draft
krista-skylight wants to merge 41 commits into
mainfrom
kc/APP-628-Convert-PA02
Draft

[APP-628] Convert PA02 Library#3317
krista-skylight wants to merge 41 commits into
mainfrom
kc/APP-628-Convert-PA02

Conversation

@krista-skylight

@krista-skylight krista-skylight commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Checklist for adding a library:

  • 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

@krista-skylight
krista-skylight marked this pull request as ready for review July 16, 2026 00:19
@krista-skylight
krista-skylight requested a review from a team as a code owner July 16, 2026 00:19
@krista-skylight
krista-skylight requested a review from a team as a code owner July 16, 2026 00:19
@krista-skylight
krista-skylight requested review from adaball and timoballard and removed request for a team July 16, 2026 00:19
Comment thread apps/report-execution/src/libraries/pa_02.py
Comment thread apps/report-execution/src/libraries/pa_02.py Outdated
Comment thread apps/report-execution/src/libraries/support/pa_02/queries.py Outdated
Comment thread apps/report-execution/tests/integration/libraries/pa_02.py Outdated
@krista-skylight
krista-skylight requested a review from adaball July 17, 2026 18:52

@adaball adaball left a comment

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.

  • For the HIV variant I can see that for "Dispo G" through "Dispo Z" Category 1 shows "Exam'd". In the data mockup Category 1 is "Not Examined"
  • Looking at the "ALL WORKERS" portion of the exported CSV for the HIV variant I can see there are some differences when compared to the PDF output, relevant lines included here:
Worker,Category 1,Category 2,Part.,Clus.,Reac.,Other,Total
ALL,Exam'd,Exam'd w/in 3:,0,0,0,0,0
ALL,Exam'd,Exam'd w/in 5:,0,0,0,0,0
ALL,Exam'd,Exam'd w/in 7:,0,0,0,0,0
ALL,Exam'd,Exam'd w/in 14:,1,0,0,0,1
ALL,Non-Assigned,,401,0,248,0,649
  • Looking at the "ALL WORKERS" portion of the exported CSV for the STD variant I can see there are some differences when compared to the PDF output, relevant lines included here:
Worker,Category 1,Category 2,Part.,Clus.,Reac.,Other,Total
ALL,Non-Assigned,,401,0,248,0,649

@sonarqubecloud

Copy link
Copy Markdown

@krista-skylight
krista-skylight marked this pull request as draft July 20, 2026 18:24
@krista-skylight

Copy link
Copy Markdown
Contributor Author

@adaball I pushed some changes that should fix the label issue. The discrepancies for non-assigned should be due to the known bug. I suspect the exam'd w/in discrepancies are also related to the bug but putting this back into draft mode for now while I investigate!

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