-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRvIG-2020-01-01.yaml
500 lines (457 loc) · 13.2 KB
/
RvIG-2020-01-01.yaml
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
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
$id: https://raw.githubusercontent.com/MinBZK/poc-machine-law/refs/heads/main/schema/v0.1.3/schema.json
uuid: fcf09c18-1584-4565-9223-e8a86fbddc09
name: Bepalen persoonsgegevens BRP
law: wet_brp
valid_from: 2020-01-01
service: "RvIG"
description: >
Regels voor het bepalen van persoonsgegevens volgens de Wet Basisregistratie
Personen (RvIG). Dit omvat basisgegevens (artikel 1.6 en 1.7), woonsituatie (artikel 2.4)
en verblijfsgegevens (artikel 2.7).
references:
- law: "Wet BRP"
article: "1.6"
url: "https://wetten.overheid.nl/BWBR0033715/2024-01-01#Hoofdstuk1_Paragraaf1.2_Artikel1.6"
- law: "Wet BRP"
article: "1.7"
url: "https://wetten.overheid.nl/BWBR0033715/2024-01-01#Hoofdstuk1_Paragraaf1.2_Artikel1.7"
- law: "Wet BRP"
article: "2.4"
url: "https://wetten.overheid.nl/BWBR0033715/2024-01-01#Hoofdstuk2_Paragraaf2.1_Artikel2.4"
- law: "Wet BRP"
article: "2.7"
url: "https://wetten.overheid.nl/BWBR0033715/2024-01-01#Hoofdstuk2_Paragraaf2.2_Artikel2.7"
properties:
parameters:
- name: "BSN"
description: "BSN van de persoon"
type: "string"
required: true
sources:
- name: "BIRTH_DATE"
description: "Geboortedatum van de persoon"
type: "date"
temporal:
type: "point_in_time"
reference: "$calculation_date"
source_reference:
table: "personen"
field: "geboortedatum"
select_on:
- name: "bsn"
description: "Burgerservicenummer van de persoon"
type: "string"
value: "$BSN"
- name: "PARTNER_BIRTH_DATE"
description: "Geboortedatum van de partner"
type: "date"
temporal:
type: "point_in_time"
reference: "$calculation_date"
source_reference:
table: "personen"
field: "geboortedatum"
select_on:
- name: "bsn"
description: "Burgerservicenummer van de partner"
type: "string"
value: "$PARTNER_BSN"
- name: "PARTNER_TYPE"
description: "Type partnerschap registratie"
type: "object"
temporal:
type: "period"
period_type: "continuous"
source_reference:
table: "relaties"
field: "partnerschap_type"
select_on:
- name: "bsn"
description: "Burgerservicenummer van de persoon"
type: "string"
value: "$BSN"
- name: "PARTNER_BSN"
description: "BSN nummer van de partner"
type: "string"
temporal:
type: "period"
period_type: "continuous"
source_reference:
table: "relaties"
field: "partner_bsn"
select_on:
- name: "bsn"
description: "Burgerservicenummer van de persoon"
type: "string"
value: "$BSN"
- name: "RESIDENCE_ADDRESS"
description: "Woonadres van de persoon"
type: "object"
temporal:
type: "period"
period_type: "continuous"
source_reference:
table: "personen"
field: "verblijfsadres"
select_on:
- name: "bsn"
description: "Burgerservicenummer van de persoon"
type: "string"
value: "$BSN"
- name: "PARENT_ADDRESSES"
description: "Woonadressen van de ouders"
type: "array"
temporal:
type: "period"
period_type: "continuous"
source_reference:
table: "relaties"
field: "ouder_adressen"
select_on:
- name: "bsn"
description: "Burgerservicenummer van de persoon"
type: "string"
value: "$BSN"
- name: "COUNTRY_OF_RESIDENCE"
description: "Land van verblijf"
type: "string"
temporal:
type: "period"
period_type: "continuous"
source_reference:
table: "personen"
field: "land_verblijf"
select_on:
- name: "bsn"
description: "Burgerservicenummer van de persoon"
type: "string"
value: "$BSN"
- name: "NATIONALITY"
description: "Nationaliteit"
type: "string"
temporal:
type: "period"
period_type: "continuous"
source_reference:
table: "personen"
field: "nationaliteit"
select_on:
- name: "bsn"
description: "Burgerservicenummer van de persoon"
type: "string"
value: "$BSN"
- name: "ADDRESS"
description: "Adresgegevens"
type: "object"
temporal:
type: "point_in_time"
reference: "$calculation_date"
source_reference:
table: "verblijfplaats"
fields: [ "straat", "huisnummer", "postcode", "woonplaats", "type" ]
select_on:
- name: "bsn"
description: "Burgerservicenummer van de persoon"
type: "string"
value: "$BSN"
- name: "HOUSEHOLD"
description: "Huishoudgegevens"
type: "array"
temporal:
type: "point_in_time"
reference: "$calculation_date"
source_reference:
table: "bewoners"
field: "medebewoners"
select_on:
- name: "postcode"
value: "$ADDRESS.postcode"
description: "Postcode van het adres van de persoon"
type: "string"
- name: "huisnummer"
value: "$ADDRESS.huisnummer"
description: "Huisnummer van het adres van de persoon"
type: "string"
- name: "CHILDREN_DATA"
description: "Gegevens over kinderen van de persoon"
type: "array"
temporal:
type: "point_in_time"
reference: "$calculation_date"
source_reference:
table: "relaties"
field: "kinderen"
select_on:
- name: "bsn"
description: "Burgerservicenummer van de persoon"
type: "string"
value: "$BSN"
output:
- name: "age"
description: "Leeftijd van de persoon in jaren"
type: "number"
type_spec:
unit: "years"
precision: 0
min: 0
temporal:
type: "point_in_time"
reference: "$calculation_date"
- name: "has_partner"
description: "Heeft de persoon een partner volgens RvIG"
type: "boolean"
temporal:
type: "point_in_time"
reference: "$calculation_date"
- name: "partner_bsn"
description: "BSN nummber van de partner"
type: "string"
temporal:
type: "point_in_time"
reference: "$calculation_date"
- name: "living_situation"
description: "Woonsituatie van de persoon (UIT/THUIS)"
type: "string"
temporal:
type: "period"
period_type: "month"
- name: "country_of_residence"
description: "Land van verblijf volgens RvIG"
type: "string"
temporal:
type: "period"
reference: "$calculation_date"
- name: "has_dutch_nationality"
description: "Heeft Nederlandse nationaliteit"
type: "boolean"
temporal:
type: "period"
reference: "$calculation_date"
- name: "birth_date"
description: "Geboortedatum van de persoon"
type: "date"
temporal:
type: "point_in_time"
reference: "$calculation_date"
- name: "partner_birth_date"
description: "Geboortedatum van de persoon"
type: "date"
temporal:
type: "point_in_time"
reference: "$calculation_date"
- name: "has_fixed_address"
description: "Heeft vast woonadres"
type: "boolean"
temporal:
type: "point_in_time"
reference: "$calculation_date"
- name: "residence_address"
description: "Volledig adres"
type: "string"
temporal:
type: "point_in_time"
reference: "$calculation_date"
- name: "postal_address"
description: "Volledig post adres"
type: "string"
temporal:
type: "point_in_time"
reference: "$calculation_date"
- name: "woonplaats"
description: "Woonplaats"
type: "string"
temporal:
type: "point_in_time"
reference: "$calculation_date"
- name: "household_size"
description: "Aantal personen in huishouden"
type: "number"
type_spec:
precision: 0
min: 1
temporal:
type: "point_in_time"
reference: "$calculation_date"
- name: "household_members"
description: "Lijst met gegevens van medebewoners"
type: "array"
temporal:
type: "point_in_time"
reference: "$calculation_date"
- name: "children"
description: "Lijst met gegevens van kinderen"
type: "array"
temporal:
type: "point_in_time"
reference: "$calculation_date"
# Nieuwe output voor de inkomstenbelastingwet
- name: "has_children_under_12"
description: "Heeft de persoon kinderen jonger dan 12 jaar"
type: "boolean"
temporal:
type: "point_in_time"
reference: "$calculation_date"
definitions:
DUTCH_NATIONALITIES:
- "NEDERLANDS"
ADDRESS_MATCH_DISTANCE_M: 100
VALID_PARTNER_TYPES:
- "HUWELIJK"
- "GEREGISTREERD_PARTNERSCHAP"
FIXED_ADDRESS_TYPES:
- "WOONADRES"
POSTAL_ADDRESS_TYPES:
- "BRIEFADRES"
CHILD_MAX_AGE_COMBINATIEKORTING: 12
requirements:
- all:
- subject: "$BIRTH_DATE"
operation: NOT_NULL
- subject: "$RESIDENCE_ADDRESS"
operation: NOT_NULL
actions:
- output: "birth_date"
value: "$BIRTH_DATE"
- output: "partner_birth_date"
value: "$PARTNER_BIRTH_DATE"
- output: "partner_bsn"
value: "$PARTNER_BSN"
- output: "age"
operation: SUBTRACT_DATE
unit: "years"
values:
- "$calculation_date"
- "$BIRTH_DATE"
reference: "Wet BRP Art. 1.6"
- output: "has_partner"
subject: "$PARTNER_TYPE"
operation: IN
values: "$VALID_PARTNER_TYPES"
reference: "Wet BRP Art. 1.7"
- output: "living_situation"
operation: IF
conditions:
- test:
subject: "$RESIDENCE_ADDRESS"
operation: EQUALS
value: "$PARENT_ADDRESSES"
then: "THUIS"
- else: "UIT"
reference: "Wet BRP Art. 2.4"
- output: "country_of_residence"
value: "$COUNTRY_OF_RESIDENCE"
reference: "Wet BRP Art. 2.7"
- output: "has_dutch_nationality"
subject: "$NATIONALITY"
operation: IN
values: "$DUTCH_NATIONALITIES"
- output: "has_fixed_address"
operation: IN
subject: "$ADDRESS.type"
values: "$FIXED_ADDRESS_TYPES"
- output: "residence_address"
operation: IF
conditions:
- test:
subject: "$ADDRESS"
operation: NOT_NULL
then:
operation: CONCAT
values:
- "$ADDRESS.straat"
- " "
- "$ADDRESS.huisnummer"
- ", "
- "$ADDRESS.postcode"
- " "
- "$ADDRESS.woonplaats"
- else: null
- output: "household_size"
operation: IF
conditions:
- test:
subject: "$HOUSEHOLD"
operation: NOT_NULL
then:
operation: ADD
values:
- 1 # De persoon zelf
- operation: FOREACH
subject: "$HOUSEHOLD"
combine: "ADD"
value: 1
- else: 1
- output: "postal_address"
operation: IF
conditions:
- test:
subject: "$ADDRESS.type"
operation: IN
values: "$POSTAL_ADDRESS_TYPES"
then:
operation: CONCAT
values:
- "$ADDRESS.straat"
- " "
- "$ADDRESS.huisnummer"
- ", "
- "$ADDRESS.postcode"
- " "
- "$ADDRESS.woonplaats"
- else: null
- output: "woonplaats"
value: "$ADDRESS.woonplaats"
- output: "household_members"
operation: IF
conditions:
- test:
subject: "$HOUSEHOLD"
operation: NOT_NULL
then: "$HOUSEHOLD"
- else:
value: null # Leeg resultaat
reference: "Wet BRP Art. 2.4"
- output: "children"
operation: IF
conditions:
- test:
subject: "$HOUSEHOLD"
operation: NOT_NULL
then:
operation: FOREACH # Gebruik FOREACH voor filtering
subject: "$HOUSEHOLD"
combine: "ADD" # Combineer resultaten in een array
value:
operation: IF
conditions:
- test:
operation: LESS_THAN
values:
- "$age"
- 18
then: "$item" # Voeg dit item toe als kind
- else: null # Anders niets toevoegen
- else:
value: null # Leeg resultaat
reference: "Wet BRP Art. 1.6"
# Nieuwe actie voor het bepalen of de persoon kinderen jonger dan 12 jaar heeft
- output: "has_children_under_12"
operation: IF
conditions:
- test:
subject: "$CHILDREN_DATA"
operation: NOT_NULL
then:
operation: EXISTS
subject: "$CHILDREN_DATA"
value:
operation: LESS_THAN
values:
- operation: SUBTRACT_DATE
unit: "years"
values:
- "$calculation_date"
- "$item.geboortedatum"
- "$CHILD_MAX_AGE_COMBINATIEKORTING"
- else: false
reference: "Wet BRP Art. 1.6"