Skip to content

Commit

Permalink
VACMS-14238 Update phone processing in all facility migrations.
Browse files Browse the repository at this point in the history
  • Loading branch information
swirtSJW committed Dec 20, 2023
1 parent 6b7e95a commit 3b1f08a
Show file tree
Hide file tree
Showing 12 changed files with 216 additions and 240 deletions.
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
52 changes: 22 additions & 30 deletions config/sync/migrate_plus.migration.va_node_facility_vba.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,36 +175,28 @@ process:
'Veteran Readiness and Employment Office': 6
'VetSuccess On Campus': 7
field_phone_number:
-
plugin: str_replace
search:
- (
- )
- X
- ' '
- ext
- .
- ','
- Ext
replace:
- ''
- '-'
- x
- ''
- Ext
- ''
- ''
- x
source: phone-main
-
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
36 changes: 22 additions & 14 deletions config/sync/migrate_plus.migration.va_node_facility_vet_centers.yml
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

0 comments on commit 3b1f08a

Please sign in to comment.