APP-769: filter unmapped race codes from demographics summary card#3365
Merged
Conversation
The patient demographics Summary card rendered raw race_category_cd values (e.g. "UNK", "1") for codes with no NBS_SRTE RACE_CALCULATED match, while the Demographics card correctly showed only matched values. The two cards use different finders: the Summary finder LEFT JOINed the SRTE code table and fell back to the raw code via coalesce, whereas the Demographics finder INNER JOINs and drops unmatched codes. Switch the Summary race finder to an INNER JOIN (matching the Demographics finder) so unmapped category codes are filtered out instead of shown raw, and drop the now-dead coalesce fallbacks. Adds a demographics-summary scenario covering a race category code with no SRTE match. SEER #18435
|
emyl3
approved these changes
Jun 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
The patient demographics Summary card showed raw
race_category_cdvalues (e.g. "UNK", "1") for race codes with noNBS_SRTE..Code_value_generalRACE_CALCULATED match, while the Demographics card correctly showed only matched values. Reported by Montana (SEER #18435).Root cause: the two cards use different finders.
PatientDemographicsSummaryRaceFinderLEFT JOINed the SRTE code table and fell back to the raw code viacoalesce(..., race_category_cd, ''), so an unmatched code rendered raw.PatientRaceDemographicFinder(Demographics) INNER JOINs and drops unmatched codes.Change
Switch the Summary race finder to an INNER JOIN, matching the Demographics finder, so unmapped category codes are filtered out instead of shown raw. Drops the now-dead
coalescefallbacks.Testing
Added a
demographics-summaryCucumber scenario with a race category code that has no SRTE match. Verified red→green against thenedssdbTestcontainer: before the fix$.raceswas["Asian","ZTEST"]; after,["Asian"]. Full@patient-demographics-summaryand@patient-race-demographicssuites pass with no regression.