Uitwisselprofiel RIVM Infectieziektenbestrijding

Over Uitwisselprofiel RIVM Infectieziektenbestrijding


Publicatiedatum:
15-06-2026

Inwerkingtreding:
15-06-2026

9.1. Wat is het totaal aantal overleden cliënten per Wlz indicatie?

Concepten

Relaties

Eigenschappen

SPARQL query

Code gekopieerd

...

Kopieer naar klembord

1# Indicator: RIVM 9.1
2# Parameters: ?jaar, ?week
3# Ontologie: versie 3.0.0 of nieuwer
4
5PREFIX onz-g: <http://purl.org/ozo/onz-g#>
6PREFIX onz-org: <http://purl.org/ozo/onz-org#>
7PREFIX onz-zorg: <http://purl.org/ozo/onz-zorg#>
8PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
9PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
10PREFIX owl: <http://www.w3.org/2002/07/owl#>
11
12SELECT
13    ?Indeling
14    (COUNT(DISTINCT ?client) AS ?Aantal_overleden_cliënten)
15    (COUNT(DISTINCT ?wlzClient) AS ?Aantal_overleden_Wlz)
16    (COUNT(DISTINCT ?zvwClient) AS ?Aantal_overleden_Zvw)
17    (COUNT(DISTINCT ?overigClient) AS ?Aantal_overleden_overig)
18WHERE {
19    # Meetperiode berekenen: maandag t/m zondag van de opgegeven ISO-week
20    #  BIND(2009 AS ?jaar)
21    #  BIND(18 AS ?week)
22
23    # 4 januari ligt altijd in ISO-week 1
24    BIND(STRDT(CONCAT(STR(?jaar), "-01-04"), xsd:date) AS ?jan4)
25
26    # Weekdag van 4 januari berekenen (0=ma, 6=zo)
27    # Sakamoto's weekdagalgoritme
28    # Voor januari: aangepast jaar = jaar-1, maandindex = 0
29    BIND(?jaar - 1 AS ?y)
30    # Correctie schrikkeljaren (elke 4 jaar wel, elke 100 jaar niet, elke 400 jaar wel)
31    BIND((?y + FLOOR(?y/4) - FLOOR(?y/100) + FLOOR(?y/400) + 10) AS ?h)
32    BIND(?h - FLOOR(?h / 7) * 7 AS ?jan4DagIndex)
33
34    # Maandag van ISO-week 1: 4 januari minus weekdagoffset
35    BIND(?jan4 - STRDT(CONCAT("P", STR(?jan4DagIndex), "D"), xsd:dayTimeDuration) AS ?maandagWeek1)
36
37    # Maandag van de gewenste week (startperiode)
38    BIND(?maandagWeek1 + STRDT(CONCAT("P", STR((?week - 1) * 7), "D"), xsd:dayTimeDuration) AS ?startperiode)
39
40    # Zondag van de gewenste week (eindperiode)
41    BIND(?startperiode + "P6D"^^xsd:dayTimeDuration AS ?eindperiode)
42
43    # Stap 1: Selecteer clienten met sterfdatum binnen de meetperiode
44    ?client a onz-g:Human ;
45            onz-g:hasDateOfDeath ?sterfdatum .
46
47    FILTER(?sterfdatum >= ?startperiode && ?sterfdatum <= ?eindperiode)
48
49    # Stap 2: Bepaal vestiging via het zorg- en verpleegproces
50    ?zorgproces a onz-g:CureAndCareProcess ;
51        onz-g:hasParticipant ?client ;
52        onz-g:definedBy ?indicatie ;
53        onz-g:hasPerdurantLocation ?locatie .
54
55    ?indicatie a ?soortIndicatie ;
56               onz-g:startDatum ?indicatieStart .
57    OPTIONAL { ?indicatie onz-g:eindDatum ?indicatieEind . }
58
59    # Indicatie moet geldig zijn op sterfdatum
60    FILTER(?indicatieStart <= ?sterfdatum && (!BOUND(?indicatieEind) || ?indicatieEind >= ?sterfdatum))
61
62    # Filter op de 4 toegestane indicatietypen
63    VALUES ?soortIndicatie {
64        onz-zorg:WlzIndicatie
65        onz-zorg:ZvwIndicatie
66        onz-zorg:ForensischeIndicatieStelling
67        onz-zorg:WmoIndicatie
68    }
69
70    # Stap 4: Selecteer de wetten
71    BIND(IF(?soortIndicatie = onz-zorg:WlzIndicatie, ?client, 1/0) AS ?wlzClient)
72    BIND(IF(?soortIndicatie = onz-zorg:ZvwIndicatie, ?client, 1/0) AS ?zvwClient)
73    BIND(IF(?soortIndicatie IN (onz-zorg:ForensischeIndicatieStelling, onz-zorg:WmoIndicatie), ?client, 1/0) AS ?overigClient)
74
75    {
76        # Per vestiging
77        ?locatie onz-g:partOf* ?vestiging_uri .
78        ?vestiging_uri a onz-org:Vestiging ;
79        		 onz-g:identifiedBy ?vest_nr .
80        ?vest_nr a onz-org:Vestigingsnummer ;
81                 onz-g:hasDataValue ?Indeling .
82    }
83    UNION
84    {
85        # Totaal organisatieniveau
86        BIND("Totaal organisatie" AS ?Indeling)
87    }
88}
89GROUP BY ?Indeling
90ORDER BY ?Indeling