Verifiering av DDBID, Boende
| Detta villkor är uppfyllt... |
...om denna SQL... |
...returnerar |
Kommentar |
| Finns det personer som inte har DDBID > 0? |
select count(*)
from k137.boende
where ddbid is null
or ddbid <= 0
|
0 |
|
Personer som inkluderas ska ha en egen HL-notering, alternativt ska mamman till personen ha en HL-notering
då barn under 10 år kan få boende via mamman.
Finns det personer som inte har en egen HL-notering och där mamman också saknar HL-notering? |
with has_HL as (
select distinct i.ddbid
from sv.notering n
join sv.individ i on i.postnr = n.postnr
where materialtyp = 1
and individtyp = 0
and ddbid > 0
),
mother_has_HL as (
select distinct i.ddbid
from sv.notering n
join sv.individ i on i.postnr = n.postnr
join sv.relation r on i.ddbid = r.ddbid1
and rtyp = 2 and foraldind = 1
join sv.individ im on im.ddbid = r.ddbid2
join sv.notering nm on nm.postnr = im.postnr
where nm.materialtyp = 1
and im.individtyp = 0
and i.ddbid > 0 and im.ddbid > 0
)
select count(*)
from k137.boende
where ddbid not in (
select ddbid from has_HL
)
and ddbid not in (
select ddbid from mother_has_HL
)
|
0 |
|
Stickprov
Data från källtabeller hämtas med följande SQL-koden nedan. Den hämtar information om barn och mor.
with temp as (
select ddbid1 ddbid_barn, ddbid2 ddbid_mor
from sv.relation
where rtyp = 2 and foraldind = 1
and ddbid1 = 13224180
),
temp2 as (
select 'BARN' relation, ddbid_barn ddbid
from temp
union
select 'MOR' relation, ddbid_mor ddbid
from temp
)
select ddb.nofrs(n.postnr) nofrs, t.relation, t.ddbid, n.MATERIALTYP, i.postnr,
h.nobtyp, h.nobdat, h.nosdat, h.nostyp,
p.foddat foddat_p, p.dopdat dopdat_p, p.doddat doddat_p, p.begdat begdat_p
from temp2 t
left join sv.individ i on i.ddbid = t.ddbid
left join sv.person p on p.ddbid = t.ddbid
join sv.notering n on i.postnr = n.postnr
left join sv.hl h on h.postnr = n.postnr
left join reg.kbsid ks on ks.kbsidid = n.kbsidid
where materialtyp in (1,3,6) and individtyp = 0
order by relation, nobdat, nosdat,p.foddat,p.doddat
Barnet har dödsålder 1 år men saknar HL-notering.
Personen har följande data:
Källdata
| NOFRS | RELATION | DDBID | MATERIALTYP | POSTNR | NOBTYP | NOBDAT | NOSDAT | NOSTYP | FODDAT_P | DOPDAT_P | DODDAT_P | BEGDAT_P |
| 83520 | BARN | 13224180 | 6 | 115347 | | | | | 18750112 | 18750119 | 18760330 | 18760402 |
| 83520 | BARN | 13224180 | 3 | 115346 | | | | | 18750112 | 18750119 | 18760330 | 18760402 |
| 83520 | MOR | 18280005 | 1 | 56506 | 5 | 18730000 | 18790000 | 1 | 18490110 | 0 | 0 | 0 |
| 83520 | MOR | 18280005 | 1 | 56509 | 1 | 18800000 | 18920000 | 1 | 18490110 | 0 | 0 | 0 |
BOENDE- förväntat
Barnets boende ska följa mammans under barnets levnadstid.
| RELATION | DDBID | BOREGPREFIX | DDBID | BONR | BOBTYP | BOBDAT | BOSTYP | BOSDAT |
| BARN | 13224180 | SUL | 13224180 | 1 | 2 | 18750112 | 2 | 18760330 |
| MOR | 18280005 | SUL | 18280005 | 1 | 6 | 18730000 | 1 | 18920000 |
Kontroll!
| Detta villkor är uppfyllt |
om denna SQL-sats |
returnerar |
| Barnet ska ha en notering i BOENDE. |
select count(*)
from k137.boende
where ddbid in (13224180)
|
1 |
| För denna notering i BOENDE ska följande gälla: |
select count(*)
from k137.boende
where ddbid in (13224180)
and boregprefix = 'SUL'
and bonr = 1
and bobtyp = 2
and bobdat = 18750112
and bostyp = 2
and bosdat = 18760330
|
1 |
Barnet har dödsålder 1 år men saknar HL-notering.
Personen har följande data:
Källdata
| NOFRS | RELATION | DDBID | MATERIALTYP | POSTNR | NOBTYP | NOBDAT | NOSDAT | NOSTYP | FODDAT_P | DOPDAT_P | DODDAT_P | BEGDAT_P |
| 83220 | BARN | 4207507 | 6 | 9191379 | | | | | 18950925 | 18950929 | 18970309 | 18970314 |
| 83220 | BARN | 4207507 | 3 | 9165213 | | | | | 18950925 | 18950929 | 18970309 | 18970314 |
| 83220 | MOR | 4405234 | 1 | 9124290 | 2 | 18730609 | 18760000 | 1 | 18730609 | 18730613 | 0 | 0 |
| 83220 | MOR | 4405234 | 1 | 9130343 | 1 | 18770000 | 18900000 | 8 | 18730609 | 18730613 | 0 | 0 |
| 83220 | MOR | 4405234 | 1 | 9130345 | 8 | 18900000 | 18900000 | 1 | 18730609 | 18730613 | 0 | 0 |
| 83220 | MOR | 4405234 | 1 | 9113177 | 1 | 18910000 | 18950000 | 1 | 18730609 | 18730613 | 0 | 0 |
| 83220 | MOR | 4405234 | 1 | 9113417 | 0 | | | 0 | 18730609 | 18730613 | 0 | 0 |
| 83220 | MOR | 4405234 | 1 | 9124373 | 0 | | | 0 | 18730609 | 18730613 | 0 | 0 |
| 83220 | MOR | 4405234 | 3 | 9159864 | | | | | 18730609 | 18730613 | 0 | 0 |
BOENDE- förväntat
Barnets boende ska följa mammans under barnets levnadstid.
| RELATION | DDBID | BOREGPREFIX | DDBID | BONR | BOBTYP | BOBDAT | BOSTYP | BOSDAT |
| BARN | 4207507 | NIL | 4207507 | 1 | 2 | 18950925 | 1 | 18950000 |
| MOR | 4405234 | NIL | 4405234 | 1 | 2 | 18730609 | 1 | 18950000 |
Kontroll!
| Detta villkor är uppfyllt |
om denna SQL-sats |
returnerar |
| Barnet ska ha en notering i BOENDE. |
select count(*)
from k137.boende
where ddbid in (4207507)
|
1 |
| För denna notering i BOENDE ska följande gälla: |
select count(*)
from k137.boende
where ddbid in (4207507)
and boregprefix = 'NIL'
and bonr = 1
and bobtyp = 2
and bobdat = 18950925
and bostyp = 1
and bosdat = 18950000
|
1 |
Barnet har dödsålder 6 år men saknar HL-notering. Mor flyttar ut samma år som barnet föds. Flyttar tillbaka 6 år senare.
Barnet bör följa mammans boende fram till utflyttning. Barnet dör innan mamman flyttar tillbaka.
Personen har följande data:
Källdata
| NOFRS | RELATION | DDBID | MATERIALTYP | POSTNR | NOBTYP | NOBDAT | NOSDAT | NOSTYP | FODDAT_P | DOPDAT_P | DODDAT_P | BEGDAT_P |
| 82980 | BARN | 10209138 | 3 | 30733100 | | | | | 19000310 | 19000311 | 19060515 | 19060527 |
| 82980 | BARN | 10209138 | 3 | 30731612 | | | | | 19000310 | 19000311 | 19060515 | 19060527 |
| 82980 | BARN | 10209138 | 6 | 30844943 | | | | | 19000310 | 19000311 | 19060515 | 19060527 |
| 82980 | MOR | 14042911 | 1 | 607458 | 2 | 18710329 | 18770427 | 4 | 18710329 | 18710329 | 0 | 0 |
| 82983 | MOR | 14042911 | 1 | 607461 | 4 | 18770427 | 18780416 | 4 | 18710329 | 18710329 | 0 | 0 |
| 82980 | MOR | 14042911 | 1 | 607464 | 4 | 18780427 | 18800000 | 1 | 18710329 | 18710329 | 0 | 0 |
| 82980 | MOR | 14042911 | 1 | 607465 | 1 | 18810000 | 18900000 | 1 | 18710329 | 18710329 | 0 | 0 |
| 82980 | MOR | 14042911 | 1 | 607466 | 1 | 18910000 | 18960000 | 3 | 18710329 | 18710329 | 0 | 0 |
| 82980 | MOR | 14042911 | 1 | 607467 | 3 | 18960000 | 18970000 | 3 | 18710329 | 18710329 | 0 | 0 |
| 82980 | MOR | 14042911 | 1 | 607468 | 3 | 18970000 | 19000000 | 4 | 18710329 | 18710329 | 0 | 0 |
| 82980 | MOR | 14042911 | 1 | 30021712 | 4 | 19060523 | 19080929 | 4 | 18710329 | 18710329 | 0 | 0 |
| 82980 | MOR | 14042911 | 1 | 607469 | 0 | | | 0 | 18710329 | 18710329 | 0 | 0 |
| 82980 | MOR | 14042911 | 3 | 607457 | | | | | 18710329 | 18710329 | 0 | 0 |
BOENDE- förväntat
Barnets boende ska följa mammans under barnets levnadstid.
| RELATION | DDBID | BOREGPREFIX | DDBID | BONR | BOBTYP | BOBDAT | BOSTYP | BOSDAT |
| BARN | 10209138 | VBN | 10209138 | 1 | 2 | 19000310 | 5 | 19000000 |
| MOR | 14042911 | VBN | 14042911 | 1 | 2 | 18710329 | 5 | 19000000 |
| MOR | 14042911 | VBN | 14042911 | 2 | 5 | 19060523 | 5 | 19080929 |
Kontroll!
| Detta villkor är uppfyllt |
om denna SQL-sats |
returnerar |
| Barnet ska ha en notering i BOENDE. |
select count(*)
from k137.boende
where ddbid in (10209138)
|
1 |
| För noteringen i BOENDE ska följande gälla: |
select count(*)
from k137.boende
where ddbid in (10209138)
and boregprefix = 'VBN'
and bonr = 1
and bobtyp = 2
and bobdat = 19000310
and bostyp = 5
and bosdat = 19000000
|
1 |
Barnet har dödsålder 6 år men saknar HL-notering. Mor har HL-noteringar.
Barnet bör följa mammans boende från födsel till död.
Personen har följande data:
Källdata
| NOFRS | RELATION | DDBID | MATERIALTYP | POSTNR | NOBTYP | NOBDAT | NOSDAT | NOSTYP | FODDAT_P | DOPDAT_P | DODDAT_P | BEGDAT_P |
| 83360 | BARN | 18368320 | 3 | 9076609 | | | | | 17910927 | 17911105 | 17980406 | 17980421 |
| 83360 | BARN | 18368320 | 6 | 9081351 | | | | | 17910927 | 17911105 | 17980406 | 17980421 |
| 83360 | MOR | 16952488 | 1 | 9020565 | 0 | 17640000 | 17800000 | 1 | 17481020 | 17481030 | 0 | 0 |
| 83360 | MOR | 16952488 | 1 | 9021377 | 1 | 17810000 | 17940000 | 3 | 17481020 | 17481030 | 0 | 0 |
| 83360 | MOR | 16952488 | 1 | 9026371 | 3 | 17950000 | 17990000 | 3 | 17481020 | 17481030 | 0 | 0 |
| 83360 | MOR | 16952488 | 1 | 9022357 | 3 | 18000000 | 18050000 | 1 | 17481020 | 17481030 | 0 | 0 |
| 83360 | MOR | 16952488 | 1 | 9018178 | 1 | 18060000 | 18150000 | 0 | 17481020 | 17481030 | 0 | 0 |
| 83360 | MOR | 16952488 | 3 | 9074624 | | | | | 17481020 | 17481030 | 0 | 0 |
BOENDE- förväntat
Barnets boende ska följa mammans under barnets levnadstid.
| RELATION | DDBID | BOREGPREFIX | DDBID | BONR | BOBTYP | BOBDAT | BOSTYP | BOSDAT |
| BARN | 18368320 | NIL | 18368320 | 1 | 2 | 17910927 | 2 | 17980406 |
| MOR | 16952488 | NIL | 16952488 | 1 | 2 | 17481020 | 0 | 17581020 |
| MOR | 16952488 | NIL | 16952488 | 2 | 0 | 17640000 | 0 | 18150000 |
Kontroll!
| Detta villkor är uppfyllt |
om denna SQL-sats |
returnerar |
| Barnet ska ha en notering i BOENDE. |
select count(*)
from k137.boende
where ddbid in (18368320)
|
1 |
| För noteringen i BOENDE ska följande gälla: |
select count(*)
from k137.boende
where ddbid in (18368320)
and boregprefix = 'NIL'
and bonr = 1
and bobtyp = 2
and bobdat = 17910927
and bostyp = 2
and bosdat = 17980406
|
1 |
Barnet har dödsålder 9 år men saknar HL-notering. Mor har HL-noteringar.
Barnet bör följa mammans boende från födsel till död.
Personen har följande data:
Källdata
| NOFRS | RELATION | DDBID | MATERIALTYP | POSTNR | NOBTYP | NOBDAT | NOSDAT | NOSTYP | FODDAT_P | DOPDAT_P | DODDAT_P | BEGDAT_P |
| 82890 | BARN | 20010034 | 3 | 50020958 | | | | | 17980806 | 17980908 | 18070814 | 18071129 |
| 82890 | BARN | 20010034 | 6 | 50030662 | | | | | 17980806 | 17980908 | 18070814 | 18071129 |
| 82890 | BARN | 20010034 | 3 | 50041617 | | | | | 17980806 | 17980908 | 18070814 | 18071129 |
| 82890 | MOR | 20030798 | 1 | 50158782 | 1 | 17780000 | 17780000 | 8 | 17580000 | 0 | 18471112 | 18471127 |
| 82890 | MOR | 20030798 | 1 | 50158787 | 8 | 17780000 | 17900000 | 1 | 17580000 | 0 | 18471112 | 18471127 |
| 82890 | MOR | 20030798 | 1 | 50143845 | 1 | 17900000 | 17910000 | 3 | 17580000 | 0 | 18471112 | 18471127 |
| 82890 | MOR | 20030798 | 1 | 50146320 | 1 | 17920000 | 17970000 | 0 | 17580000 | 0 | 18471112 | 18471127 |
| 82890 | MOR | 20030798 | 1 | 50156695 | 0 | 17970000 | 18170000 | 0 | 17580000 | 0 | 18471112 | 18471127 |
| 82890 | MOR | 20030798 | 1 | 50156579 | 0 | 18100000 | 18110000 | 0 | 17580000 | 0 | 18471112 | 18471127 |
| 82890 | MOR | 20030798 | 1 | 50158507 | 0 | 18190000 | 18290000 | 1 | 17580000 | 0 | 18471112 | 18471127 |
| 82890 | MOR | 20030798 | 1 | 50152871 | 1 | 18300000 | 18400000 | 1 | 17580000 | 0 | 18471112 | 18471127 |
| 82890 | MOR | 20030798 | 1 | 50160281 | 1 | 18400000 | 18460000 | 1 | 17580000 | 0 | 18471112 | 18471127 |
| 82890 | MOR | 20030798 | 1 | 50115802 | 1 | 18470000 | 18471112 | 2 | 17580000 | 0 | 18471112 | 18471127 |
| 82890 | MOR | 20030798 | 6 | 50030318 | | | | | 17580000 | 0 | 18471112 | 18471127 |
BOENDE- förväntat
Barnets boende ska följa mammans under barnets levnadstid.
| RELATION | DDBID | BOREGPREFIX | DDBID | BONR | BOBTYP | BOBDAT | BOSTYP | BOSDAT |
| BARN | 20010034 | VBN | 20010034 | 1 | 2 | 17980806 | 2 | 18070814 |
| MOR | 20030798 | VBN | 20030798 | 1 | 1 | 17780000 | 0 | 18170000 |
| MOR | 20030798 | VBN | 20030798 | 2 | 0 | 18190000 | 2 | 18471112 |
Kontroll!
| Detta villkor är uppfyllt |
om denna SQL-sats |
returnerar |
| Barnet ska ha en notering i BOENDE. |
select count(*)
from k137.boende
where ddbid in (20010034)
|
1 |
| För noteringen i BOENDE ska följande gälla: |
select count(*)
from k137.boende
where ddbid in (20010034)
and boregprefix = 'VBN'
and bonr = 1
and bobtyp = 2
and bobdat = 17980806
and bostyp = 2
and bosdat = 18070814
|
1 |
Barnet har dödsålder 9 år men saknar HL-notering. Mor har HL-noteringar.
Barnet bör följa mammans boende från födsel till död.
Personen har följande data:
Källdata
| 83480 | BARN | 15403187 | 3 | 907794 | | | | | 18840717 | 18840718 | 18940616 | 18940623 |
| 83480 | BARN | 15403187 | 6 | 907795 | | | | | 18840717 | 18840718 | 18940616 | 18940623 |
| 83480 | MOR | 12410194 | 1 | 884208 | 4 | 18840000 | 18940000 | 1 | 18520810 | 0 | 0 | 0 |
BOENDE- förväntat
Barnets boende ska följa mammans under barnets levnadstid.
| RELATION | DDBID | BOREGPREFIX | DDBID | BONR | BOBTYP | BOBDAT | BOSTYP | BOSDAT |
| BARN | 15403187 | SUL | 15403187 | 1 | 5 | 18840000 | 1 | 18940000 |
| MOR | 12410194 | SUL | 12410194 | 1 | 5 | 18840000 | 1 | 18940000 |
Kontroll!
| Detta villkor är uppfyllt |
om denna SQL-sats |
returnerar |
| Barnet ska ha en notering i BOENDE. |
select count(*)
from k137.boende
where ddbid in (15403187)
|
1 |
| För noteringen i BOENDE ska följande gälla: |
select count(*)
from k137.boende
where ddbid in (15403187)
and boregprefix = 'SUL'
and bonr = 1
and bobtyp = 5
and bobdat = 18840000
and bostyp = 1
and bosdat = 18940000
|
1 |
Barnet har dödsålder 9 år men saknar HL-notering. Mor har HL-noteringar.
Barnet bör följa mammans boende från födsel till dessa mamman försvinner ur materialet (samma år som barnets födelse).
Personen har följande data:
Källdata
| NOFRS | RELATION | DDBID | MATERIALTYP | POSTNR | NOBTYP | NOBDAT | NOSDAT | NOSTYP | FODDAT_P | DOPDAT_P | DODDAT_P | BEGDAT_P |
| 83940 | BARN | 9346332 | 6 | 12068049 | | | | | 18000401 | 18000420 | 18090701 | 18090708 |
| 83940 | BARN | 9346332 | 3 | 12045470 | | | | | 18000401 | 18000420 | 18090701 | 18090708 |
| 83940 | MOR | 3700750 | 1 | 12037297 | 0 | 17860000 | 17860000 | 11 | 17670000 | 0 | 0 | 0 |
| 83940 | MOR | 3700750 | 1 | 12035877 | 11 | 17890000 | 17970000 | 3 | 17670000 | 0 | 0 | 0 |
| 83940 | MOR | 3700750 | 1 | 12035950 | 3 | 17970000 | 18000000 | 0 | 17670000 | 0 | 0 | 0 |
BOENDE- förväntat
Barnets boende ska följa mammans under barnets levnadstid.
| RELATION | DDBID | BOREGPREFIX | DDBID | BONR | BOBTYP | BOBDAT | BOSTYP | BOSDAT |
| BARN | 9346332 | NIL | 9346332 | 1 | 2 | 18000401 | 0 | 18000000 |
| MOR | 3700750 | NIL | 3700750 | 1 | 0 | 17860000 | 0 | 18000000 |
Kontroll!
| Detta villkor är uppfyllt |
om denna SQL-sats |
returnerar |
| Barnet ska ha en notering i BOENDE. |
select count(*)
from k137.boende
where ddbid in (9346332)
|
1 |
| För noteringen i BOENDE ska följande gälla: |
select count(*)
from k137.boende
where ddbid in (9346332)
and boregprefix = 'NIL'
and bonr = 1
and bobtyp = 2
and bobdat = 18000401
and bostyp = 0
and bosdat = 18000000
|
1 |
Barnet har dödsålder 11 år men saknar HL-notering. Mor har HL-noteringar. Mor dör före barnet, när barnet är 11 år.
Barnet bör följa mammans boende från födsel till 10 års ålder.
Personen har följande data:
Källdata
| NOFRS | RELATION | DDBID | MATERIALTYP | POSTNR | NOBTYP | NOBDAT | NOSDAT | NOSTYP | FODDAT_P | DOPDAT_P | DODDAT_P | BEGDAT_P |
| 83350 | BARN | 2247707 | 3 | 9666037 | | | | | 18500208 | 18500209 | 18611202 | 18620406 |
| 83350 | BARN | 2247707 | 6 | 9685214 | | | | | 18500208 | 18500209 | 18611202 | 18620406 |
| 83350 | MOR | 6982632 | 1 | 9646271 | 0 | 18510000 | 18610505 | 2 | 18120000 | 0 | 18610505 | 18611201 |
| 83350 | MOR | 6982632 | 6 | 9685200 | | | | | 18120000 | 0 | 18610505 | 18611201 |
BOENDE- förväntat
Barnets boende ska följa mammans under barnets levnadstid.
| RELATION | DDBID | BOREGPREFIX | DDBID | BONR | BOBTYP | BOBDAT | BOSTYP | BOSDAT |
| BARN | 2247707 | NIL | 2247707 | 1 | 0 | 18510000 | 0 | 18600208 |
| MOR | 6982632 | NIL | 6982632 | 1 | 0 | 18510000 | 2 | 18610505 |
Kontroll!
| Detta villkor är uppfyllt |
om denna SQL-sats |
returnerar |
| Barnet ska ha en notering i BOENDE. |
select count(*)
from k137.boende
where ddbid in (2247707)
|
1 |
| För noteringen i BOENDE ska följande gälla: |
select count(*)
from k137.boende
where ddbid in (2247707)
and boregprefix = 'NIL'
and bonr = 1
and bobtyp = 0
and bobdat = 18510000
and bostyp = 0
and bosdat = 18600208
|
1 |
Barnet har dödsålder 11 år men saknar HL-notering. Mor har HL-noteringar.
Barnet bör följa mammans boende från födsel till 10 års ålder.
Personen har följande data:
Källdata
| NOFRS | RELATION | DDBID | MATERIALTYP | POSTNR | NOBTYP | NOBDAT | NOSDAT | NOSTYP | FODDAT_P | DOPDAT_P | DODDAT_P | BEGDAT_P |
| 83360 | BARN | 19218983 | 3 | 9076790 | | | | | 17900110 | 17900117 | 18011000 | 18011226 |
| 83360 | BARN | 19218983 | 6 | 9081461 | | | | | 17900110 | 17900117 | 18011000 | 18011226 |
| 83360 | MOR | 12690620 | 1 | 9021294 | 0 | 17900000 | 17940000 | 3 | 17500000 | 0 | 18320000 | 0 |
| 83360 | MOR | 12690620 | 1 | 9026254 | 3 | 17950000 | 17990000 | 1 | 17500000 | 0 | 18320000 | 0 |
| 83360 | MOR | 12690620 | 1 | 9022191 | 1 | 18000000 | 18050000 | 1 | 17500000 | 0 | 18320000 | 0 |
| 83360 | MOR | 12690620 | 1 | 9018035 | 1 | 18060000 | 18150000 | 1 | 17500000 | 0 | 18320000 | 0 |
| 83360 | MOR | 12690620 | 1 | 9000029 | 1 | 18160000 | 18250000 | 1 | 17500000 | 0 | 18320000 | 0 |
| 83360 | MOR | 12690620 | 1 | 9004183 | 1 | 18260000 | 18320000 | 2 | 17500000 | 0 | 18320000 | 0 |
BOENDE- förväntat
Barnets boende ska följa mammans under barnets levnadstid.
| RELATION | DDBID | BOREGPREFIX | DDBID | BONR | BOBTYP | BOBDAT | BOSTYP | BOSDAT |
| BARN | 19218983 | NIL | 19218983 | 1 | 0 | 17900000 | 0 | 18000110 |
| MOR | 12690620 | NIL | 12690620 | 1 | 0 | 17900000 | 2 | 18320000 |
Kontroll!
| Detta villkor är uppfyllt |
om denna SQL-sats |
returnerar |
| Barnet ska ha en notering i BOENDE. |
select count(*)
from k137.boende
where ddbid in (19218983)
|
1 |
| För noteringen i BOENDE ska följande gälla: |
select count(*)
from k137.boende
where ddbid in (19218983)
and boregprefix = 'NIL'
and bonr = 1
and bobtyp = 0
and bobdat = 17900000
and bostyp = 0
and bosdat = 18000110
|
1 |
Barnet har dödsålder 15 år men saknar HL-notering. Mor har HL-noteringar.
Barnet bör följa mammans boende från födsel till 10 års ålder.
Personen har följande data:
Källdata
| NOFRS | RELATION | DDBID | MATERIALTYP | POSTNR | NOBTYP | NOBDAT | NOSDAT | NOSTYP | FODDAT_P | DOPDAT_P | DODDAT_P | BEGDAT_P |
| 83360 | BARN | 13468840 | 3 | 9075056 | | | | | 17530529 | 17531117 | 17680605 | 17681113 |
| 83360 | BARN | 13468840 | 6 | 9080585 | | | | | 17530529 | 17531117 | 17680605 | 17681113 |
| 83360 | MOR | 19251984 | 1 | 9024221 | 0 | 17470000 | 17500000 | 1 | 0 | 0 | 18031113 | 18031120 |
| 83360 | MOR | 19251984 | 1 | 9023064 | 1 | 17510000 | 17630000 | 1 | 0 | 0 | 18031113 | 18031120 |
| 83360 | MOR | 19251984 | 1 | 9020569 | 1 | 17640000 | 17800000 | 1 | 0 | 0 | 18031113 | 18031120 |
| 83360 | MOR | 19251984 | 1 | 9021438 | 1 | 17810000 | 17940000 | 1 | 0 | 0 | 18031113 | 18031120 |
| 83360 | MOR | 19251984 | 1 | 9026373 | 1 | 17950000 | 17990000 | 1 | 0 | 0 | 18031113 | 18031120 |
| 83360 | MOR | 19251984 | 1 | 9022358 | 1 | 18000000 | 18030000 | 2 | 0 | 0 | 18031113 | 18031120 |
| 83360 | MOR | 19251984 | 6 | 9081395 | | | | | 0 | 0 | 18031113 | 18031120 |
BOENDE- förväntat
Barnets boende ska följa mammans under barnets levnadstid.
| RELATION | DDBID | BOREGPREFIX | DDBID | BONR | BOBTYP | BOBDAT | BOSTYP | BOSDAT |
| BARN | 13468840 | NIL | 13468840 | 1 | 2 | 17530529 | 0 | 17630529 |
| MOR | 19251984 | NIL | 19251984 | 1 | 0 | 17470000 | 2 | 18031113 |
Kontroll!
| Detta villkor är uppfyllt |
om denna SQL-sats |
returnerar |
| Barnet ska ha en notering i BOENDE. |
select count(*)
from k137.boende
where ddbid in (13468840)
|
1 |
| För noteringen i BOENDE ska följande gälla: |
select count(*)
from k137.boende
where ddbid in (13468840)
and boregprefix = 'NIL'
and bonr = 1
and bobtyp = 2
and bobdat = 17530529
and bostyp = 0
and bosdat = 17630529
|
1 |
| För noteringen i BOENDE ska BOBTYP vara 2. |
select bobtyp
from k137.boende
where ddbid in (13468840)
and boregprefix = 'NIL'
and bonr = 1
|
2 |
| För noteringen i BOENDE ska BOBDAT vara 17530529. |
select bobdat
from k137.boende
where ddbid in (13468840)
and boregprefix = 'NIL'
and bonr = 1
|
17530529 |
| För noteringen i BOENDE ska BOSTYP vara 0. |
select bostyp
from k137.boende
where ddbid in (13468840)
and boregprefix = 'NIL'
and bonr = 1
|
0 |
| För noteringen i BOENDE ska BOSDAT vara 17630529. |
select bosdat
from k137.boende
where ddbid in (13468840)
and boregprefix = 'NIL'
and bonr = 1
|
17630529 |
Barnet har dödsålder 32 år. Barnet har HL-noteringar med start 4 år efter födelse.
Barnet saknar FD-notering.
Mor har HL-notering vid barnets födelse.
Barnet bör inte följa mammans boende från födsel utan får boende enligt egna HL-noteringar.
Personen har följande data:
Källdata
| NOFRS | RELATION | DDBID | MATERIALTYP | POSTNR | NOBTYP | NOBDAT | NOSDAT | NOSTYP | FODDAT_P | DOPDAT_P | DODDAT_P | BEGDAT_P |
| 83220 | BARN | 2045022 | 1 | 9115866 | 0 | 18460000 | 18540000 | 1 | 18421116 | 0 | 18750305 | 18750311 |
| 83220 | BARN | 2045022 | 1 | 9122263 | 1 | 18550000 | 18640000 | 1 | 18421116 | 0 | 18750305 | 18750311 |
| 83220 | BARN | 2045022 | 1 | 9127309 | 1 | 18650000 | 18690000 | 8 | 18421116 | 0 | 18750305 | 18750311 |
| 83220 | BARN | 2045022 | 1 | 9127316 | 8 | 18690000 | 18750305 | 2 | 18421116 | 0 | 18750305 | 18750311 |
| 83220 | BARN | 2045022 | 6 | 9188613 | | | | | 18421116 | 0 | 18750305 | 18750311 |
| 83220 | MOR | 2244701 | 1 | 9139715 | 2 | 18090000 | 18220000 | 3 | 18091229 | 18091230 | 18901207 | 18901214 |
| 83220 | MOR | 2244701 | 1 | 9118991 | 3 | 18230000 | 18380000 | 3 | 18091229 | 18091230 | 18901207 | 18901214 |
| 83220 | MOR | 2244701 | 1 | 9105510 | 3 | 18380000 | 18450000 | 1 | 18091229 | 18091230 | 18901207 | 18901214 |
| 83220 | MOR | 2244701 | 1 | 9115864 | 1 | 18460000 | 18540000 | 1 | 18091229 | 18091230 | 18901207 | 18901214 |
| 83220 | MOR | 2244701 | 1 | 9122261 | 1 | 18550000 | 18640000 | 1 | 18091229 | 18091230 | 18901207 | 18901214 |
| 83220 | MOR | 2244701 | 1 | 9127307 | 1 | 18650000 | 18760000 | 1 | 18091229 | 18091230 | 18901207 | 18901214 |
| 83220 | MOR | 2244701 | 1 | 9133437 | 1 | 18770000 | 18900000 | 1 | 18091229 | 18091230 | 18901207 | 18901214 |
| 83220 | MOR | 2244701 | 1 | 9102320 | 1 | 18900000 | 18901207 | 2 | 18091229 | 18091230 | 18901207 | 18901214 |
| 83220 | MOR | 2244701 | 3 | 9152573 | | | | | 18091229 | 18091230 | 18901207 | 18901214 |
| 83220 | MOR | 2244701 | 6 | 9190316 | | | | | 18091229 | 18091230 | 18901207 | 18901214 |
BOENDE- förväntat
Barnets boende ska följa mammans under barnets levnadstid.
| RELATION | DDBID | BOREGPREFIX | DDBID | BONR | BOBTYP | BOBDAT | BOSTYP | BOSDAT |
| BARN | 2045022 | NIL | 2045022 | 1 | 0 | 18460000 | 2 | 18750305 |
| MOR | 2244701 | NIL | 2244701 | 1 | 2 | 18091229 | 2 | 18901207 |
Kontroll!
| Detta villkor är uppfyllt |
om denna SQL-sats |
returnerar |
| Barnet ska ha en notering i BOENDE. |
select count(*)
from k137.boende
where ddbid in (2045022)
|
1 |
| För noteringen i BOENDE ska följande gälla: |
select count(*)
from k137.boende
where ddbid in (2045022)
and boregprefix = 'NIL'
and bonr = 1
and bobtyp = 0
and bobdat = 18460000
and bostyp = 2
and bosdat = 18750305
|
1 |
| För noteringen i BOENDE ska BOBTYP vara 2. |
select bobtyp
from k137.boende
where ddbid in (2045022)
and bonr = 1
|
0 |
| För noteringen i BOENDE ska BOBDAT vara 18421116. |
select bobdat
from k137.boende
where ddbid in (2045022)
and bonr = 1
|
18460000 |
| För noteringen i BOENDE ska BOSTYP vara 2. |
select bostyp
from k137.boende
where ddbid in (2045022)
and bonr = 1
|
2 |
| För noteringen i BOENDE ska BOSDAT vara 18750305. |
select bosdat
from k137.boende
where ddbid in (2045022)
and bonr = 1
|
18750305 |
Barnet har okänd dödsålder. Barnet har HL-noteringar med start 2 år efter födelse.
Mor har HL-notering vid barnets födelse.
Barnet bör följa mammans boende från födsel tills egen HL-notering börjar.
Personen har följande data:
Källdata
| NOFRS | RELATION | DDBID | MATERIALTYP | POSTNR | NOBTYP | NOBDAT | NOSDAT | NOSTYP | FODDAT_P | DOPDAT_P | DODDAT_P | BEGDAT_P |
| 56800 | BARN | 16681777 | 1 | 4418514 | 0 | 18260000 | 18270000 | 3 | 18241207 | 18241208 | 0 | 0 |
| 56800 | BARN | 16681777 | 1 | 4418429 | 3 | 18270000 | 18280000 | 3 | 18241207 | 18241208 | 0 | 0 |
| 56800 | BARN | 16681777 | 1 | 4418508 | 3 | 18280000 | 18290000 | 3 | 18241207 | 18241208 | 0 | 0 |
| 56800 | BARN | 16681777 | 1 | 4418194 | 3 | 18290000 | 18300000 | 1 | 18241207 | 18241208 | 0 | 0 |
| 56800 | BARN | 16681777 | 1 | 4462171 | 1 | 18310000 | 18330403 | 4 | 18241207 | 18241208 | 0 | 0 |
| 56800 | BARN | 16681777 | 3 | 4441764 | | | | | 18241207 | 18241208 | 0 | 0 |
| ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
| 56800 | BARN | 16681777 | 1 | 3345024 | 4 | 18480000 | 18501024 | 4 | 18241207 | 18241208 | 0 | 0 |
| 56800 | MOR | 17928997 | 1 | 4412319 | 4 | 18150830 | 18150000 | 3 | 17981229 | 0 | 0 | 0 |
| 56800 | MOR | 17928997 | 1 | 4414203 | 3 | 18160000 | 18180000 | 3 | 17981229 | 0 | 0 | 0 |
| 56800 | MOR | 17928997 | 1 | 4414228 | 3 | 18180000 | 18200000 | 3 | 17981229 | 0 | 0 | 0 |
| 56800 | MOR | 17928997 | 1 | 4414947 | 3 | 18200000 | 18210000 | 1 | 17981229 | 0 | 0 | 0 |
| 56800 | MOR | 17928997 | 1 | 4430879 | 1 | 18210000 | 18240000 | 3 | 17981229 | 0 | 0 | 0 |
| 56800 | MOR | 17928997 | 1 | 4431120 | 3 | 18240000 | 18250000 | 3 | 17981229 | 0 | 0 | 0 |
| 56800 | MOR | 17928997 | 1 | 4430534 | 3 | 18250000 | 18250000 | 1 | 17981229 | 0 | 0 | 0 |
| 56800 | MOR | 17928997 | 1 | 4418513 | 1 | 18260000 | 18270000 | 3 | 17981229 | 0 | 0 | 0 |
| 56800 | MOR | 17928997 | 1 | 4418428 | 3 | 18270000 | 18270000 | 3 | 17981229 | 0 | 0 | 0 |
| 56800 | MOR | 17928997 | 1 | 4418507 | 3 | 18280000 | 18290000 | 3 | 17981229 | 0 | 0 | 0 |
| 56800 | MOR | 17928997 | 1 | 4418193 | 3 | 18290000 | 18300000 | 1 | 17981229 | 0 | 0 | 0 |
| 56800 | MOR | 17928997 | 1 | 4462170 | 1 | 18310000 | 18330403 | 4 | 17981229 | 0 | 0 | 0 |
BOENDE- förväntat
Barnets boende ska följa mammans under barnets levnadstid.
| RELATION | DDBID | BOREGPREFIX | DDBID | BONR | BOBTYP | BOBDAT | BOSTYP | BOSDAT |
| BARN | 16681777 | LIN | 16681777 | 1 | 2 | 18241207 | 5 | 18330403 |
| MOR | 17928997 | LIN | 17928997 | 1 | 5 | 18150830 | 5 | 18330403 |
Kontroll!
| Detta villkor är uppfyllt |
om denna SQL-sats |
returnerar |
| Barnet ska ha en notering i BOENDE. |
select count(*)
from k137.boende
where ddbid in (16681777)
|
1 |
| För noteringen i BOENDE ska följande gälla: |
select count(*)
from k137.boende
where ddbid in (16681777)
and boregprefix = 'LIN'
and bonr = 1
and bobtyp = 2
and bobdat = 18241207
and bostyp = 5
and bosdat = 18501024
|
1 |
Barnet har dödsålder 5 år. Barnet har HL-noteringar med start 4 år efter födelse.
Mor har HL-notering vid barnets födelse.
Barnet bör följa mammans boende från födsel tills egen HL-notering börjar.
Personen har följande data:
Källdata
| NOFRS | RELATION | DDBID | MATERIALTYP | POSTNR | NOBTYP | NOBDAT | NOSDAT | NOSTYP | FODDAT_P | DOPDAT_P | DODDAT_P | BEGDAT_P |
| 82980 | BARN | 19018081 | 1 | 595188 | 0 | 18710000 | 18710000 | 3 | 18670830 | 18670000 | 18730610 | 18730615 |
| 82980 | BARN | 19018081 | 1 | 595189 | 3 | 18710000 | 18730610 | 2 | 18670830 | 18670000 | 18730610 | 18730615 |
| 82980 | BARN | 19018081 | 6 | 595190 | | | | | 18670830 | 18670000 | 18730610 | 18730615 |
| 82980 | BARN | 19018081 | 3 | 595187 | | | | | 18670830 | 18670000 | 18730610 | 18730615 |
| 82980 | MOR | 15164534 | 1 | 413109 | 2 | 18300420 | 18360000 | 1 | 18300420 | 18300420 | 0 | 0 |
| 82980 | MOR | 15164534 | 1 | 413110 | 1 | 18360000 | 18430000 | 1 | 18300420 | 18300420 | 0 | 0 |
| 82980 | MOR | 15164534 | 1 | 413111 | 1 | 18430000 | 18520000 | 1 | 18300420 | 18300420 | 0 | 0 |
| 82980 | MOR | 15164534 | 1 | 413112 | 1 | 18530000 | 18531001 | 4 | 18300420 | 18300420 | 0 | 0 |
| 83010 | MOR | 15164534 | 1 | 7004101 | 4 | 18530000 | 18540000 | 3 | 18300420 | 18300420 | 0 | 0 |
| 83010 | MOR | 15164534 | 1 | 7004105 | 3 | 18540000 | 18550000 | 3 | 18300420 | 18300420 | 0 | 0 |
| 83010 | MOR | 15164534 | 1 | 7004116 | 3 | 18550000 | 18560000 | 4 | 18300420 | 18300420 | 0 | 0 |
| 83010 | MOR | 15164534 | 1 | 7004133 | 4 | 18570000 | 18580000 | 3 | 18300420 | 18300420 | 0 | 0 |
| 83010 | MOR | 15164534 | 1 | 7004137 | 3 | 18580000 | 18610000 | 1 | 18300420 | 18300420 | 0 | 0 |
| 83010 | MOR | 15164534 | 1 | 7004139 | 1 | 18620000 | 18630329 | 4 | 18300420 | 18300420 | 0 | 0 |
| 82980 | MOR | 15164534 | 1 | 413115 | 4 | 18630529 | 18640000 | 3 | 18300420 | 18300420 | 0 | 0 |
| 82980 | MOR | 15164534 | 1 | 413116 | 3 | 18640000 | 18700000 | 1 | 18300420 | 18300420 | 0 | 0 |
| 82980 | MOR | 15164534 | 1 | 413117 | 1 | 18710000 | 18760000 | 3 | 18300420 | 18300420 | 0 | 0 |
| 82980 | MOR | 15164534 | 1 | 413118 | 3 | 18760000 | 18800000 | 1 | 18300420 | 18300420 | 0 | 0 |
| 82980 | MOR | 15164534 | 1 | 413120 | 1 | 18810000 | 18900000 | 1 | 18300420 | 18300420 | 0 | 0 |
| 82980 | MOR | 15164534 | 1 | 413121 | 1 | 18910000 | 18990000 | 1 | 18300420 | 18300420 | 0 | 0 |
| 82980 | MOR | 15164534 | 3 | 413108 | | | | | 18300420 | 18300420 | 0 | 0 |
BOENDE- förväntat
Barnets boende ska följa mammans under barnets levnadstid.
| RELATION | DDBID | BOREGPREFIX | DDBID | BONR | BOBTYP | BOBDAT | BOSTYP | BOSDAT |
| BARN | 19018081 | VBN | 19018081 | 1 | 2 | 18670830 | 2 | 18730610 |
| MOR | 15164534 | VBN | 15164534 | 1 | 2 | 18300420 | 5 | 18561026 |
| MOR | 15164534 | VBN | 15164534 | 2 | 5 | 18571203 | 1 | 18990000 |
Kontroll!
| Detta villkor är uppfyllt |
om denna SQL-sats |
returnerar |
| Barnet ska ha en notering i BOENDE. |
select count(*)
from k137.boende
where ddbid in (19018081)
|
1 |
| För noteringen i BOENDE ska följande gälla: |
select count(*)
from k137.boende
where ddbid in (19018081)
and boregprefix = 'VBN'
and bonr = 1
and bobtyp = 2
and bobdat = 18670830
and bostyp = 2
and bosdat = 18730610
|
1 |
Barnet har dödsålder 15 år. Barnet har HL-notering med start 5 år efter födelse.
Mor har HL-notering vid barnets födelse.
Barnet bör följa mammans boende från födsel tills egen HL-notering börjar.
Personen har följande data:
Källdata
| NOFRS | RELATION | DDBID | MATERIALTYP | POSTNR | NOBTYP | NOBDAT | NOSDAT | NOSTYP | FODDAT_P | DOPDAT_P | DODDAT_P | BEGDAT_P |
| 82980 | BARN | 18009861 | 1 | 237766 | 0 | 17710000 | 17820000 | 2 | 17661009 | 17661010 | 17820000 | 0 |
| 82980 | BARN | 18009861 | 3 | 237765 | | | | | 17661009 | 17661010 | 17820000 | 0 |
| 82980 | MOR | 18580678 | 1 | 218817 | 2 | 17320000 | 17700000 | 1 | 17320601 | 17320604 | 18140926 | 0 |
| 82980 | MOR | 18580678 | 1 | 218818 | 1 | 17710000 | 18010000 | 1 | 17320601 | 17320604 | 18140926 | 0 |
| 82980 | MOR | 18580678 | 1 | 218819 | 1 | 18020000 | 18090000 | 1 | 17320601 | 17320604 | 18140926 | 0 |
| 82980 | MOR | 18580678 | 1 | 218820 | 1 | 18100000 | 18140926 | 2 | 17320601 | 17320604 | 18140926 | 0 |
| 82980 | MOR | 18580678 | 3 | 218816 | | | | | 17320601 | 17320604 | 18140926 | 0 |
BOENDE- förväntat
Barnets boende ska följa mammans under barnets levnadstid.
| RELATION | DDBID | BOREGPREFIX | DDBID | BONR | BOBTYP | BOBDAT | BOSTYP | BOSDAT |
| BARN | 18009861 | VBN | 18009861 | 1 | 2 | 17661009 | 2 | 17820000 |
| MOR | 18580678 | VBN | 18580678 | 1 | 2 | 17320601 | 2 | 18140926 |
Kontroll!
| Detta villkor är uppfyllt |
om denna SQL-sats |
returnerar |
| Barnet ska ha en notering i BOENDE. |
select count(*)
from k137.boende
where ddbid in (18009861)
|
1 |
| För noteringen i BOENDE ska följande gälla: |
select count(*)
from k137.boende
where ddbid in (18009861)
and boregprefix = 'VBN'
and bonr = 1
and bobtyp = 2
and bobdat = 17661009
and bostyp = 2
and bosdat = 17820000
|
1 |
Barnet har okänd dödsålder. Barnet har HL-notering med start 10 år efter födelse.
Barnet saknar FD-notering.
Mor har HL-notering vid barnets födelse.
Barnet bör inte följa mammans boende från födsel utan endast få boende utifrån egen HL-notering.
Personen har följande data:
Källdata
| NOFRS | RELATION | DDBID | MATERIALTYP | POSTNR | NOBTYP | NOBDAT | NOSDAT | NOSTYP | FODDAT_P | DOPDAT_P | DODDAT_P | BEGDAT_P |
| 82910 | BARN | 18172331 | 1 | 40111585 | 1 | 18270000 | 18280000 | 0 | 18170000 | 0 | 0 | 0 |
| 82910 | MOR | 18825670 | 1 | 40101068 | 0 | 18170000 | 18260000 | 1 | 17900000 | 0 | 0 | 0 |
| 82910 | MOR | 18825670 | 1 | 40111621 | 1 | 18270000 | 18560000 | 0 | 17900000 | 0 | 0 | 0 |
| 82910 | MOR | 18825670 | 1 | 40099529 | 0 | 18560000 | 18560000 | 0 | 17900000 | 0 | 0 | 0 |
BOENDE- förväntat
Barnets boende ska följa mammans under barnets levnadstid.
| RELATION | DDBID | BOREGPREFIX | DDBID | BONR | BOBTYP | BOBDAT | BOSTYP | BOSDAT |
| BARN | 18172331 | VBN | 18172331 | 1 | 1 | 18270000 | 0 | 18280000 |
| MOR | 18825670 | VBN | 18825670 | 1 | 0 | 18170000 | 0 | 18560000 |
Kontroll!
| Detta villkor är uppfyllt |
om denna SQL-sats |
returnerar |
| Barnet ska ha en notering i BOENDE. |
select count(*)
from k137.boende
where ddbid in (18172331)
|
1 |
| För noteringen i BOENDE ska följande gälla: |
select count(*)
from k137.boende
where ddbid in (18172331)
and boregprefix = 'VBN'
and bonr = 1
and bobtyp = 1
and bobdat = 18270000
and bostyp = 0
and bosdat = 18280000
|
1 |
| För noteringen i BOENDE ska BOBTYP vara 1. |
select bobtyp
from k137.boende
where ddbid in (18172331)
and bonr = 1
|
1 |
| För noteringen i BOENDE ska BOBDAT vara 18270000. |
select bobdat
from k137.boende
where ddbid in (18172331)
and bonr = 1
|
18270000 |
| För noteringen i BOENDE ska BOSTYP vara 0. |
select bostyp
from k137.boende
where ddbid in (18172331)
and bonr = 1
|
0 |
| För noteringen i BOENDE ska BOSDAT vara 18280000. |
select bosdat
from k137.boende
where ddbid in (18172331)
and bonr = 1
|
18280000 |
Barnet har okänd dödsålder. Barnet har HL-notering med start 12 år efter födelse.
Barnet saknar FD-notering.
Mor har HL-notering vid barnets födelse.
Barnet får endast boende från egen HL-notering.
Personen har följande data:
Källdata
| NOFRS | RELATION | DDBID | MATERIALTYP | POSTNR | NOBTYP | NOBDAT | NOSDAT | NOSTYP | FODDAT_P | DOPDAT_P | DODDAT_P | BEGDAT_P |
| 82520 | BARN | 16664789 | 1 | 9302214 | 4 | 18360000 | 18380000 | 4 | 18240118 | 0 | 0 | 0 |
| 82520 | MOR | 15419593 | 1 | 9328281 | 0 | 18040000 | 18150000 | 10 | 17760000 | 0 | 18601206 | 18610112 |
| 82520 | MOR | 15419593 | 1 | 9328874 | 10 | 18150000 | 18200000 | 1 | 17760000 | 0 | 18601206 | 18610112 |
| 82520 | MOR | 15419593 | 1 | 9354058 | 1 | 18200000 | 18280000 | 0 | 17760000 | 0 | 18601206 | 18610112 |
| 82520 | MOR | 15419593 | 1 | 9302213 | 4 | 18360000 | 18390000 | 1 | 17760000 | 0 | 18601206 | 18610112 |
| 82520 | MOR | 15419593 | 1 | 9342169 | 1 | 18400000 | 18460000 | 1 | 17760000 | 0 | 18601206 | 18610112 |
| 82520 | MOR | 15419593 | 1 | 9358659 | 1 | 18470000 | 18560000 | 1 | 17760000 | 0 | 18601206 | 18610112 |
| 82520 | MOR | 15419593 | 1 | 9347143 | 1 | 18570000 | 18601206 | 2 | 17760000 | 0 | 18601206 | 18610112 |
| 82520 | MOR | 15419593 | 6 | 9396111 | | | | | 17760000 | 0 | 18601206 | 18610112 |
BOENDE- förväntat
Barnets boende ska följa mammans under barnets levnadstid.
| RELATION | DDBID | BOREGPREFIX | DDBID | BONR | BOBTYP | BOBDAT | BOSTYP | BOSDAT |
| BARN | 16664789 | VBN | 16664789 | 2 | 5 | 18360000 | 5 | 18380000 |
| MOR | 15419593 | VBN | 15419593 | 1 | 0 | 18040000 | 0 | 18280000 |
| MOR | 15419593 | VBN | 15419593 | 2 | 5 | 18360000 | 2 | 18601206 |
Kontroll!
| Detta villkor är uppfyllt |
om denna SQL-sats |
returnerar |
| Barnet ska ha en notering i BOENDE. |
select count(*)
from k137.boende
where ddbid in (16664789)
|
1 |
| För noteringen i BOENDE ska följande gälla: |
select count(*)
from k137.boende
where ddbid in (16664789)
and boregprefix = 'VBN'
and bonr = 1
and bobtyp = 5
and bobdat = 18360000
and bostyp = 5
and bosdat = 18380000
|
1 |
| För noteringen i BOENDE ska BOBTYP vara 5. |
select bobtyp
from k137.boende
where ddbid in (16664789)
and bonr = 1
|
5 |
| För noteringen i BOENDE ska BOBDAT vara 18360000. |
select bobdat
from k137.boende
where ddbid in (16664789)
and bonr = 1
|
18360000 |
| För noteringen i BOENDE ska BOSTYP vara 5. |
select bostyp
from k137.boende
where ddbid in (16664789)
and bonr = 1
|
5 |
| För noteringen i BOENDE ska BOSDAT vara 18380000. |
select bosdat
from k137.boende
where ddbid in (16664789)
and bonr = 1
|
18380000 |
Barnet har dödsålder 16 år. Barnet har HL-notering med start 12 år efter födelse.
Barnet saknar FD-notering.
Mor har HL-notering vid barnets födelse.
Barnet får boende från egen HL-notering.
Personen har följande data:
Källdata
| NOFRS | RELATION | DDBID | MATERIALTYP | POSTNR | NOBTYP | NOBDAT | NOSDAT | NOSTYP | FODDAT_P | DOPDAT_P | DODDAT_P | BEGDAT_P |
| 83220 | BARN | 9921570 | 1 | 9117685 | 0 | 18460000 | 18500000 | 2 | 18340000 | 0 | 18500211 | 18500224 |
| 83220 | BARN | 9921570 | 6 | 9185149 | | | | | 18340000 | 0 | 18500211 | 18500224 |
| 83220 | MOR | 3305325 | 1 | 9141724 | 2 | 18090000 | 18220000 | 1 | 18090308 | 18090324 | 18910429 | 18910517 |
| 83220 | MOR | 3305325 | 1 | 9119963 | 1 | 18230000 | 18290000 | 3 | 18090308 | 18090324 | 18910429 | 18910517 |
| 83220 | MOR | 3305325 | 1 | 9119983 | 3 | 18290000 | 18380000 | 0 | 18090308 | 18090324 | 18910429 | 18910517 |
| 83220 | MOR | 3305325 | 1 | 9117683 | 0 | 18460000 | 18540000 | 1 | 18090308 | 18090324 | 18910429 | 18910517 |
| 83220 | MOR | 3305325 | 1 | 9107466 | 1 | 18550000 | 18640000 | 1 | 18090308 | 18090324 | 18910429 | 18910517 |
| 83220 | MOR | 3305325 | 1 | 9100579 | 1 | 18640000 | 18860000 | 1 | 18090308 | 18090324 | 18910429 | 18910517 |
| 83220 | MOR | 3305325 | 1 | 9104397 | 1 | 18870000 | 18900000 | 1 | 18090308 | 18090324 | 18910429 | 18910517 |
| 83220 | MOR | 3305325 | 1 | 9101239 | 1 | 18910000 | 18910429 | 2 | 18090308 | 18090324 | 18910429 | 18910517 |
| 83220 | MOR | 3305325 | 3 | 9152515 | | | | | 18090308 | 18090324 | 18910429 | 18910517 |
| 83220 | MOR | 3305325 | 6 | 9190368 | | | | | 18090308 | 18090324 | 18910429 | 18910517 |
BOENDE- förväntat
Barnets boende ska följa mammans under barnets levnadstid.
| RELATION | DDBID | BOREGPREFIX | DDBID | BONR | BOBTYP | BOBDAT | BOSTYP | BOSDAT |
| BARN | 9921570 | NIL | 9921570 | 2 | 0 | 18460000 | 2 | 18500211 |
| MOR | 3305325 | NIL | 3305325 | 1 | 2 | 18090308 | 0 | 18380000 |
| MOR | 3305325 | NIL | 3305325 | 2 | 0 | 18460000 | 2 | 18910429 |
Kontroll!
| Detta villkor är uppfyllt |
om denna SQL-sats |
returnerar |
| Barnet ska ha en notering i BOENDE. |
select count(*)
from k137.boende
where ddbid in (9921570)
|
1 |
| För 2:a noteringen i BOENDE ska följande gälla: |
select count(*)
from k137.boende
where ddbid in (9921570)
and boregprefix = 'NIL'
and bonr = 1
and bobtyp = 0
and bobdat = 18460000
and bostyp = 2
and bosdat = 18500211
|
1 |
| För noteringen i BOENDE ska BOBTYP vara 0. |
select bobtyp
from k137.boende
where ddbid in (9921570)
and bonr = 1
|
0 |
| För noteringen i BOENDE ska BOBDAT vara 18460000. |
select bobdat
from k137.boende
where ddbid in (9921570)
and bonr = 1
|
18460000 |
| För noteringen i BOENDE ska BOSTYP vara 2. |
select bostyp
from k137.boende
where ddbid in (9921570)
and bonr = 1
|
2 |
| För noteringen i BOENDE ska BOSDAT vara 18500211. |
select bosdat
from k137.boende
where ddbid in (9921570)
and bonr = 1
|
18500211 |