forked from department-of-veterans-affairs/va.gov-cms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
migrate_plus.migration.va_node_facility_nca.yml
361 lines (361 loc) · 7.91 KB
/
migrate_plus.migration.va_node_facility_nca.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
uuid: 4a2758e4-e615-4669-a307-292cf0569231
langcode: en
status: true
dependencies:
enforced:
module:
- tzfield
id: va_node_facility_nca
class: null
field_plugin_method: null
cck_plugin_method: null
migration_tags:
- Continuous
- Content
- Node
migration_group: facility
label: 'Node - National Cemetary Administration Facility'
source:
track_changes: true
cache_counts: true
plugin: url
data_fetcher_plugin: http
data_parser_plugin: json
urls:
- 'https://dev-api.va.gov/services/va_facilities/v0/facilities/all'
headers:
Accept: application/vnd.geo+json
apikey: 'DEFINED IN settings.php'
item_selector: features/
ids:
id:
type: string
constants:
country_code: US
fields:
-
name: facility_type
label: facility_type
selector: properties/facility_type
-
name: id
label: id
selector: properties/id
-
name: name
label: name
selector: properties/name
-
name: classification
label: classification
selector: properties/classification
-
name: website
label: website
selector: properties/website
-
name: time_zone
label: time_zone
selector: properties/time_zone
-
name: mailing_city
label: mailing_city
selector: properties/address/mailing/city
-
name: mailing_state
label: mailing_state
selector: properties/address/mailing/state
-
name: mailing_zip
label: mailing_zip
selector: properties/address/mailing/zip
-
name: mailing_address1
label: mailing_address1
selector: properties/address/mailing/address_1
-
name: mailing_address2
label: mailing_address2
selector: properties/address/mailing/address_2
-
name: mailing_address3
label: mailing_address3
selector: properties/address/mailing/address_3
-
name: physical_city
label: physical_city
selector: properties/address/physical/city
-
name: physical_state
label: physical_state
selector: properties/address/physical/state
-
name: physical_zip
label: physical_zip
selector: properties/address/physical/zip
-
name: physical_address1
label: physical_address1
selector: properties/address/physical/address_1
-
name: physical_address2
label: physical_address2
selector: properties/address/physical/address_2
-
name: physical_address3
label: physical_address3
selector: properties/address/physical/address_3
-
name: fax
label: fax
selector: properties/phone/fax
-
name: phone
label: phone
selector: properties/phone/main
-
name: hours
label: hours
selector: properties/hours
-
name: coordinates
label: coordinates
selector: geometry/coordinates
process:
non_field1:
plugin: skip_on_value
not_equals: true
source: facility_type
method: row
value:
- va_cemetery
non_field2:
plugin: skip_on_value
source: classification
method: row
value:
- 'State Cemetery'
title:
plugin: skip_on_empty
method: row
source: name
message: 'Skipped: Source title/name is empty, can not have a node without title.'
field_facility_locator_api_id:
plugin: skip_on_empty
method: row
source: id
message: 'Skipped: Source API ID is empty, must have it.'
field_nca_classification:
-
plugin: static_map
source: classification
map:
'Confederate Cemetery': 1
'Government Lots': 2
'Monument Sites': 3
'National Cemetery': 4
'Post Cemetery': 5
Rural: 6
'Soldiers Lot': 7
field_link/uri:
-
plugin: str_replace
source: website
search: 'NULL'
replace: ''
field_link/title:
-
plugin: str_replace
source: name
search: 'NULL'
replace: ''
field_timezone: time_zone
field_mailing_address/langcode:
plugin: default_value
default_value: en
field_mailing_address/address_line1:
plugin: callback
callable: trim
source: mailing_address1
field_mailing_address/address_line2:
-
plugin: get
source:
- mailing_address2
- mailing_address3
-
plugin: callback
callable: array_filter
-
plugin: multiple_values
-
plugin: callback
callable: trim
-
plugin: concat
delimiter: ', '
field_mailing_address/locality: mailing_city
field_mailing_address/administrative_area: mailing_state
field_mailing_address/postal_code: mailing_zip
field_mailing_address/country_code:
-
plugin: skip_on_empty
method: process
source: mailing_zip
-
plugin: get
source: constants/country_code
field_address/langcode:
plugin: default_value
default_value: en
field_address/address_line1:
plugin: callback
callable: trim
source: physical_address1
field_address/address_line2:
-
plugin: get
source:
- physical_address2
- physical_address3
-
plugin: callback
callable: array_filter
-
plugin: multiple_values
-
plugin: callback
callable: trim
-
plugin: concat
delimiter: ', '
field_address/locality: physical_city
field_address/administrative_area: physical_state
field_address/postal_code: physical_zip
field_address/country_code:
-
plugin: skip_on_empty
method: process
source: physical_zip
-
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'
field_phone_number:
-
plugin: str_replace
source: phone
search: Ext.
replace: x
-
plugin: explode
delimiter: x
-
plugin: callback
callable: trim
-
plugin: concat
delimiter: ' x'
field_office_hours:
plugin: va_field_office_hours
source: hours
field_administration:
plugin: default_value
default_value: 192
latitude:
plugin: extract
source: coordinates
index:
- 1
longitude:
plugin: extract
source: coordinates
index:
- 0
field_geolocation:
plugin: geofield_latlon
source:
- '@latitude'
- '@longitude'
langcode:
plugin: default_value
default_value: en
status:
plugin: default_value
default_value: 0
promote:
plugin: default_value
default_value: 0
sticky:
plugin: default_value
default_value: 0
path/pathauto:
plugin: default_value
default_value: 1
published_status:
plugin: default_value
default_value: 0
moderation_state:
plugin: default_value
default_value: draft
changed:
plugin: callback
callable: va_gov_migrate_time
new_revision:
plugin: default_value
default_value: true
revision_default:
plugin: default_value
default_value: true
revision_log:
plugin: default_value
default_value: 'Update of Facility API data by migration.'
revision_timestamp:
plugin: callback
callable: va_gov_migrate_time
revision_uid:
plugin: default_value
default_value: 1317
uid:
plugin: default_value
default_value: 1317
type:
plugin: default_value
default_value: nca_facility
destination:
plugin: 'entity:node'
default_bundle: nca_facility
overwrite_properties:
- field_geolocation
- field_nca_classification
- field_link
- field_timezone
- field_mailing_address
- field_address
- field_fax_number
- field_phone_number
- field_office_hours
- changed
- new_revision
- revision_default
- revision_log
- revision_timestamp
- revision_uid
- title
- uid
migration_dependencies:
required: { }