Skip to content

Commit 11f2580

Browse files
committed
exclude deleted provider cell phones from D_Provider
1 parent fe4fa1d commit 11f2580

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

liquibase-service/src/main/resources/db/005-rdb_modern/routines/052-sp_provider_event-001.sql

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -113,14 +113,9 @@ BEGIN
113113
ON elp.locator_uid = tl.tele_locator_uid
114114
WHERE elp.entity_uid = p.person_uid
115115
AND elp.CLASS_CD = 'TELE'
116+
AND elp.RECORD_STATUS_CD = 'ACTIVE'
116117
AND tl.phone_nbr_txt IS NOT NULL
117-
AND (
118-
(elp.USE_CD = 'WP' AND elp.CD = 'O' AND elp.RECORD_STATUS_CD = 'ACTIVE') -- provider office phone
119-
OR
120-
(elp.USE_CD = 'WP' AND elp.CD = 'PH' AND elp.STATUS_CD = 'A') -- provider workplace phone
121-
OR
122-
(elp.CD = 'CP') -- provider cell phone
123-
)
118+
AND (elp.USE_CD = 'WP' OR elp.CD = 'CP')
124119
FOR json path, INCLUDE_NULL_VALUES) AS phone) AS phone,
125120
-- person email
126121
(SELECT (SELECT tl.tele_locator_uid AS [email_tl_uid],

0 commit comments

Comments
 (0)