Align provider phone mapping with legacy behavior and exclude inactive cell phones#785
Open
mehansen wants to merge 11 commits into
Open
Align provider phone mapping with legacy behavior and exclude inactive cell phones#785mehansen wants to merge 11 commits into
mehansen wants to merge 11 commits into
Conversation
0d50b7e to
7bb53ed
Compare
This reverts commit a2fd3e3.
7bb53ed to
34a657e
Compare
34a657e to
23591f6
Compare
ae5175d to
43f058a
Compare
mehansen
commented
May 20, 2026
Comment on lines
+32
to
+33
| phone_work_phone varchar(50) null, | ||
| phone_ext_work_phone varchar(50) null, |
Contributor
Author
There was a problem hiding this comment.
would love thoughts on better names for these, or other ways to differentiate between the two types of work phones
Contributor
There was a problem hiding this comment.
Are these two different types of work phones, or are they work phone (ex: 716-555-1212) and work phone extension (ex: 12345)?
Contributor
Author
There was a problem hiding this comment.
if you look at the fields above these you'll see
phone_workandphone_ext_workwhich represent the phone (and extension) entered with Use = Primary Workplace and Type = Office in the UI- these are different from
phone_work_phoneandphone_ext_work_phonewhich represent the phone (and extension) entered with Use = Primary Workplace and Type = Phone
we need both types in the nrt_provider table to replicate MasterETL behavior, but I'm cringing at the name for the ones I added
Contributor
There was a problem hiding this comment.
Oh then maybe:
phone_primary_officephone_primary_office_ext
Also, maybe another issue but it appears that the area code is being saved in the country_code field.
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.
Description
This PR addresses two JIRAs related to person phone numbers in RDB.
APP-461 — Phone mapping mismatches in COVID Lab Datamart,
D_Provider, andD_PatientRTR was not matching MasterETL's logic for filtering person phone numbers by
use_cdandcdin several different scenarios, causing diffs in the aforementioned tables under certain circumstances. The root issue was that RTR conflated distinct phone types rather than treating them separately as MasterETL does.The diffs were:
D_Providerwork phone is explicitly "office" type (cd = O, use_cd = WP) in MasterETL, but RTR filtering logic was allowing cell phones.COVID_LAB_DATAMARTprovider work phone is explicitly "workplace phone" type (cd = PH, use_cd = WP) in MasterETL, but RTR was referencingnrt_provider/D_Providerwork phone, so getting the office phone or cell phone.D_Patientwork phone is explicitly "workplace phone" type (cd = PH, use_cd = WP) in MasterETL, but RTR was allowing othercdvalues.D_Patienthome phone is explicitly "home phone" type (cd = PH, use_cd = H) in MasterETL, but RTR was allowing othercdvalues.To fix:
phone_work_phone,phone_ext_work_phone) are added tonrt_providerto store thePH-type work number separately from the existingphone_work/phone_ext_workcolumns (which hold theO-type office number).sp_covid_lab_datamart_postprocessingis updated to read from the new columns for ordering provider phone.sp_provider_eventis simplified from aUNION ALLand updated to allow othercdvalues besidesOandCP.DataPostProcessorandPhone.updatePerson()is refactored to map each phone type to the correct field based on bothuseCdandcd. Note that provider work phone and patient work phone are mapped differently which matches MasterETL.APP-595 — Inactive provider cell phone numbers incorrectly included
Discovered during APP-461 testing: RTR was populating
D_PROVIDER.PROVIDER_PHONE_CELLwith cell phone records that had been soft-deleted in ODSE (i.e.,RECORD_STATUS_CD != 'ACTIVE'). This was carried over from MasterETL, but SME review confirmed it is a bug. This PR fixes it by adding anACTIVErecord status filter to cell phone lookups for providers, consistent with how inactive records are already excluded for provider work phones and patient cell phones.Related Issue
APP-461 | APP-595
Additional Notes
Per APP-595, the fix to exclude inactive cell phones is a deliberate divergence from MasterETL behavior; will update https://cdc-nbs.atlassian.net/wiki/x/A4BYfw to document the change.
Checklist