Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VACMS-14238 Improve parsing of Facility phone numbers in facility migrations #16500

Merged
merged 3 commits into from
Jan 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 44 additions & 28 deletions config/sync/migrate_plus.migration.va_node_facility_nca.yml
Original file line number Diff line number Diff line change
Expand Up @@ -241,35 +241,51 @@ process:
plugin: get
source: constants/country_code
field_fax_number:
-
plugin: str_replace
source: fax
search: Ext.
replace: x
-
plugin: explode
delimiter: x
-
plugin: callback
callable: trim
-
plugin: concat
delimiter: ' x'
plugin: str_replace
search:
- (
- )
- X
- ' '
- ext
- Ext
- .
- ','
- x
replace:
- ''
- '-'
- x
- ''
- x
- x
- ''
- ''
- ', ext. '
source: fax
field_phone_number:
-
plugin: str_replace
source: phone
search: Ext.
replace: x
-
plugin: explode
delimiter: x
-
plugin: callback
callable: trim
-
plugin: concat
delimiter: ' x'
plugin: str_replace
search:
- (
- )
- X
- ' '
- ext
- Ext
- .
- ','
- x
replace:
- ''
- '-'
- x
- ''
- x
- x
- ''
- ''
- ', ext. '
source: phone
field_office_hours:
plugin: va_field_office_hours
source: hours
Expand Down
36 changes: 22 additions & 14 deletions config/sync/migrate_plus.migration.va_node_facility_vba.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,20 +175,28 @@ process:
'Veteran Readiness and Employment Office': 6
'VetSuccess On Campus': 7
field_phone_number:
-
plugin: str_replace
source: phone-main
search: Ext.
replace: x
-
plugin: explode
delimiter: x
-
plugin: callback
callable: trim
-
plugin: concat
delimiter: ' x'
plugin: str_replace
search:
- (
- )
- X
- ' '
- ext
- Ext
- .
- ','
- x
replace:
- ''
- '-'
- x
- ''
- x
- x
- ''
- ''
- ', ext. '
source: phone-main
status:
plugin: default_value
default_value: 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,20 +162,28 @@ process:
- '@latitude'
- '@longitude'
field_phone_number:
-
plugin: str_replace
source: phone-main
search: Ext.
replace: x
-
plugin: explode
delimiter: x
-
plugin: callback
callable: trim
-
plugin: concat
delimiter: ' x'
plugin: str_replace
search:
- (
- )
- X
- ' '
- ext
- Ext
- .
- ','
- x
replace:
- ''
- '-'
- x
- ''
- x
- x
- ''
- ''
- ', ext. '
source: phone-main
field_office_hours:
plugin: va_field_office_hours
source: hours
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,20 +159,28 @@ process:
field_address/administrative_area: state
field_address/postal_code: zip
field_phone_number:
-
plugin: str_replace
source: phone-main
search: Ext.
replace: x
-
plugin: explode
delimiter: x
-
plugin: callback
callable: trim
-
plugin: concat
delimiter: ' x'
plugin: str_replace
search:
- (
- )
- X
- ' '
- ext
- Ext
- .
- ','
- x
replace:
- ''
- '-'
- x
- ''
- x
- x
- ''
- ''
- ', ext. '
source: phone-main
field_office_hours:
plugin: va_field_office_hours
source: hours
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,20 +156,28 @@ process:
- '@latitude'
- '@longitude'
field_phone_number:
-
plugin: str_replace
source: phone-main
search: Ext.
replace: x
-
plugin: explode
delimiter: x
-
plugin: callback
callable: trim
-
plugin: concat
delimiter: ' x'
plugin: str_replace
search:
- (
- )
- X
- ' '
- ext
- Ext
- .
- ','
- x
replace:
- ''
- '-'
- x
- ''
- x
- x
- ''
- ''
- ', ext. '
source: phone-main
field_office_hours:
plugin: va_field_office_hours
source: hours
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,35 +180,51 @@ process:
'Extended Care Site (Community Living Center) (Stand-Alone)': 7
'Residential Care Site (MH RRTP/DRRTP) (Stand-Alone)': 8
field_mental_health_phone:
-
plugin: str_replace
source: phone-mental-health
search: Ext.
replace: x
-
plugin: explode
delimiter: x
-
plugin: callback
callable: trim
-
plugin: concat
delimiter: ' x'
plugin: str_replace
search:
- (
- )
- X
- ' '
- ext
- Ext
- .
- ','
- x
replace:
- ''
- '-'
- x
- ''
- x
- x
- ''
- ''
- ', ext. '
source: phone-mental-health
field_phone_number:
-
plugin: str_replace
source: phone-main
search: Ext.
replace: x
-
plugin: explode
delimiter: x
-
plugin: callback
callable: trim
-
plugin: concat
delimiter: ' x'
plugin: str_replace
search:
- (
- )
- X
- ' '
- ext
- Ext
- .
- ','
- x
replace:
- ''
- '-'
- x
- ''
- x
- x
- ''
- ''
- ', ext. '
source: phone-main
field_mobile:
plugin: convert_boolean
source: mobile
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,35 +254,17 @@ process:
plugin: get
source: 'constants/country_code'
field_fax_number:
-
plugin: str_replace
source: fax
search: Ext.
replace: x
-
plugin: explode
delimiter: x
-
plugin: callback
callable: trim
-
plugin: concat
delimiter: ' x'
# Covert all ext variants to x and then replace it with, ', ext. ' last.
plugin: str_replace
search: ['(', ')', 'X', ' ', 'ext', 'Ext', '.', ',', 'x']
replace: ['', '-', 'x', '', 'x', 'x', '', '', ', ext. ']
source: fax
field_phone_number:
-
plugin: str_replace
source: phone
search: Ext.
replace: x
-
plugin: explode
delimiter: x
-
plugin: callback
callable: trim
-
plugin: concat
delimiter: ' x'
# Covert all ext variants to x and then replace it with, ', ext. ' last.
plugin: str_replace
search: ['(', ')', 'X', ' ', 'ext', 'Ext', '.', ',', 'x']
replace: ['', '-', 'x', '', 'x', 'x', '', '', ', ext. ']
source: phone
field_office_hours:
plugin: va_field_office_hours
source: hours
Expand Down
Loading
Loading