Align provider phone mapping with legacy behavior and exclude inactive cell phones#785
Merged
Merged
Conversation
0d50b7e to
7bb53ed
Compare
This reverts commit a2fd3e3.
7bb53ed to
34a657e
Compare
34a657e to
23591f6
Compare
ae5175d to
43f058a
Compare
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