Uitwisselprofiel Zorgkantoren Inkoopondersteuning en beleidsontwikkeling

Over Uitwisselprofiel Zorgkantoren Inkoopondersteuning en beleidsontwikkeling


Publicatiedatum:
01-05-2026

Inwerkingtreding:
01-05-2026

14.2 Wat is het aantal cliënten per leveringsvorm met zorgprofiel VV?

Concepten

Relaties

Eigenschappen

Instanties

SPARQL query

Code gekopieerd

...

Kopieer naar klembord

1# Indicator: Zorgkantoren 14.2
2# Parameters: ?peildatum, ?zorgkantoor
3# Ontologie: versie 3.0 of nieuwer
4PREFIX onz-g:    <http://purl.org/ozo/onz-g#>
5PREFIX onz-zorg: <http://purl.org/ozo/onz-zorg#>
6PREFIX onz-org:  <http://purl.org/ozo/onz-org#>
7PREFIX rdf:      <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
8PREFIX rdfs:     <http://www.w3.org/2000/01/rdf-schema#>
9PREFIX xsd:      <http://www.w3.org/2001/XMLSchema#>
10
11# Toelichting structuur: 
12# In de basisquery worden alle zorgprocessen geteld. 
13# In de optional blocks wordt een extra kolom namelijk deeltijd verblijf berekend voor de vestiging en organisatie rijen.
14# In de meest bovenste select wordt alles samengevoegd en wordt nog de verhouding vpt berekend
15SELECT
16  ?Indeling
17  ?Verblijf
18  ?VPT
19  ?MPT
20  ?PGB
21  (?Verblijf + ?VPT + ?MPT + ?PGB AS ?Totaal)
22  (IF(?Verblijf = 0,
23      "Ongedefinieerd",
24      STR(ROUND((xsd:decimal(?VPT) / xsd:decimal(?Verblijf)) * 1000) / 1000)
25   ) AS ?Verhouding_VPT_Verblijf)
26  (COALESCE(?DTV_vest, ?DTV_org, 0) AS ?DTV)
27
28WHERE {
29  # Basisquery : Aantallen Verblijf VPT  MPT  PGB bij vestiging en totaal organisatie. 
30  {
31    SELECT
32      ?Organisatieonderdeel
33      (SUM(?verblijf) AS ?Verblijf)
34      (SUM(?vpt)      AS ?VPT)
35      (SUM(?mpt)      AS ?MPT)
36      (SUM(?pgb)      AS ?PGB)
37    WHERE {
38      #BIND("2024-12-31"^^xsd:date AS ?peildatum)
39
40      ?zorgproces a onz-g:CureAndCareProcess ;
41        onz-g:definedBy ?indicatie ;
42        onz-g:startDatum ?start_zorgproces .
43      OPTIONAL { ?zorgproces onz-g:eindDatum ?eind_zorgproces }
44      FILTER(
45        ?start_zorgproces <= ?peildatum &&
46        ((?eind_zorgproces >= ?peildatum) || !BOUND(?eind_zorgproces))
47      )
48
49      ?indicatie a onz-zorg:WlzIndicatie ;
50        onz-g:hasPart/onz-g:isAbout ?sector ;
51        onz-g:hasPart ?lv ;            
52        onz-g:startDatum ?ind_start ;
53        onz-g:isAbout ?client .
54      OPTIONAL { ?indicatie onz-g:eindDatum ?ind_eind }
55      FILTER (?ind_start <= ?peildatum && ((?ind_eind >= ?peildatum) || (!BOUND(?ind_eind))))
56
57      ?sector a onz-zorg:LangdurigeZorgSector .
58      FILTER(?sector = onz-zorg:VV)
59
60      ?client a onz-g:Human .
61      ?lv a onz-zorg:Leveringsvorm .
62
63      {
64        # Per vestiging: Alle zorgprocessen met locatie
65        ?zorgproces onz-g:hasPerdurantLocation ?locatie .
66        ?locatie a onz-g:StationaryArtifact ;
67          onz-g:partOf* ?vestiging_uri .
68
69        ?vestiging_uri a onz-org:Vestiging ;
70          onz-g:hasLocalizableArea/onz-g:identifiedBy/onz-g:hasPart/onz-g:hasPart ?postcode_6 ;
71          onz-g:identifiedBy ?vest_nr .
72
73        BIND(IRI(SUBSTR(STR(?postcode_6), 1, STRLEN(STR(?postcode_6)) - 2)) AS ?postcode)
74
75        ?pc_gebied onz-g:identifiedBy ?postcode ;
76          onz-g:partOf+ ?zk_regio .
77        ?zk_regio a onz-org:ZorgkantoorRegio .
78        ?zorgkantoor onz-g:hasOperatingRange ?zk_regio .
79
80        ?vest_nr a onz-org:Vestigingsnummer ;
81          onz-g:hasDataValue ?vestiging .
82
83        BIND(?vestiging AS ?Organisatieonderdeel)
84      }
85      UNION
86      {
87        # Totaal organisatie: Inclusief zorgprocessen zonder locatie
88        BIND("Organisatie (gecontracteerd + algemeen)" AS ?Organisatieonderdeel)
89      }
90
91      BIND(IF(?lv = onz-zorg:instelling, 1, 0) AS ?verblijf)
92      BIND(IF(?lv = onz-zorg:vpt,        1, 0) AS ?vpt)
93      BIND(IF(?lv = onz-zorg:mpt,        1, 0) AS ?mpt)
94      BIND(IF(?lv = onz-zorg:pgb,        1, 0) AS ?pgb)
95    }
96    GROUP BY ?Organisatieonderdeel
97  }
98
99  # Optional 1: DTV per vestiging. Dus hier wordt geteld per vestiging, welke unieke clienten Verblijf + iets anders hebben (VPT MPT PGB) 
100  # Er bestaan geen zorgprocessen in de testdata die lv anders dan Instelling hebben én aan een vestiging gekoppeld zijn. In de realistische data zal dit meestal ook niet het geval zijn maar het kan wel voorkomen. Vandaar deze code! Zie ook FO toelichting
101  OPTIONAL {
102    SELECT
103      ?Organisatieonderdeel                              
104      (COUNT(DISTINCT ?clientVestKey) AS ?DTV_vest)
105    WHERE {
106      {
107        SELECT
108          ?client
109          ?vestiging_uri
110          ?Organisatieonderdeel                          
111          (MAX(?isVerblijf) AS ?hasVerblijf)
112          (MAX(?isMPT)      AS ?hasMPT)
113          (MAX(?isPGB)      AS ?hasPGB)
114        WHERE {
115          #BIND("2024-12-31"^^xsd:date AS ?peildatum)
116
117          ?zorgproces a onz-g:CureAndCareProcess ;
118            onz-g:definedBy ?indicatie ;
119            onz-g:hasPerdurantLocation/onz-g:partOf* ?locatie ;
120            onz-g:startDatum ?start_zorgproces .
121          OPTIONAL { ?zorgproces onz-g:eindDatum ?eind_zorgproces }
122          FILTER(
123            ?start_zorgproces <= ?peildatum &&
124            ((?eind_zorgproces >= ?peildatum) || !BOUND(?eind_zorgproces))
125          )
126
127          ?locatie a onz-g:StationaryArtifact ;
128            onz-g:partOf* ?vestiging_uri .
129
130          ?vestiging_uri a onz-org:Vestiging ;
131            onz-g:hasLocalizableArea/onz-g:identifiedBy/onz-g:hasPart/onz-g:hasPart ?postcode_6 ;
132            onz-org:vestigingVan ?organisatie_uri;
133            onz-g:identifiedBy ?vest_nr .
134                        
135          BIND(IRI(SUBSTR(STR(?postcode_6), 1, STRLEN(STR(?postcode_6)) - 2)) AS ?postcode)
136
137          ?pc_gebied onz-g:identifiedBy ?postcode ;
138            onz-g:partOf+ ?zk_regio .
139          ?zk_regio a onz-org:ZorgkantoorRegio .
140          ?zorgkantoor onz-g:hasOperatingRange ?zk_regio .
141
142          ?vest_nr a onz-org:Vestigingsnummer ;
143            onz-g:hasDataValue ?Organisatieonderdeel .   # ← was: ?VestigingLabel
144
145          ?indicatie a onz-zorg:WlzIndicatie ;
146            onz-g:hasPart/onz-g:isAbout ?sector ;
147            onz-g:hasPart ?lv ;            
148            onz-g:startDatum ?ind_start ;
149            onz-g:isAbout ?client .
150          OPTIONAL { ?indicatie onz-g:eindDatum ?ind_eind }
151          FILTER (?ind_start <= ?peildatum && ((?ind_eind >= ?peildatum) || (!BOUND(?ind_eind))))
152
153          ?sector a onz-zorg:LangdurigeZorgSector .
154          FILTER(?sector = onz-zorg:VV)
155
156          ?client a onz-g:Human .
157          ?lv a onz-zorg:Leveringsvorm .
158
159          BIND(IF(?lv = onz-zorg:instelling, 1, 0) AS ?isVerblijf)
160          BIND(IF(?lv = onz-zorg:mpt,        1, 0) AS ?isMPT)
161          BIND(IF(?lv = onz-zorg:pgb,        1, 0) AS ?isPGB)
162        }
163        GROUP BY ?client ?vestiging_uri ?Organisatieonderdeel  
164      }
165
166      FILTER(?hasVerblijf = 1 && (?hasMPT = 1 || ?hasPGB = 1))
167      # Unieke sleutel om clienten te kunnen bepalen per vestiging
168      BIND(IRI(CONCAT(STR(?client), "_", STR(?vestiging_uri))) AS ?clientVestKey)
169    }
170    GROUP BY ?Organisatieonderdeel                      
171  }
172
173  # Optional 2: DTV op organisatieniveau 
174  OPTIONAL {
175    SELECT
176      ("Totaal organisatie" AS ?Organisatieonderdeel)    
177      (COUNT(DISTINCT ?client) AS ?DTV_org)
178    WHERE {
179      {
180        SELECT
181          ?client
182          (MAX(?isVerblijf) AS ?hasVerblijf_org)
183          (MAX(?isMPT)      AS ?hasMPT_org)
184          (MAX(?isPGB)      AS ?hasPGB_org)
185        WHERE {
186          #BIND("2024-12-31"^^xsd:date AS ?peildatum)
187
188          ?zorgproces a onz-g:CureAndCareProcess ;
189            onz-g:definedBy ?indicatie ;
190            onz-g:startDatum ?start_zorgproces .
191          OPTIONAL { ?zorgproces onz-g:eindDatum ?eind_zorgproces }
192
193          FILTER(
194            ?start_zorgproces <= ?peildatum &&
195            ((?eind_zorgproces >= ?peildatum) || !BOUND(?eind_zorgproces))
196          )
197
198          ?indicatie a onz-zorg:WlzIndicatie ;
199                  onz-g:hasPart/onz-g:isAbout ?sector ;
200                  onz-g:hasPart ?lv ;            
201                  onz-g:startDatum ?ind_start ;
202                  onz-g:isAbout ?client .
203                OPTIONAL { ?indicatie onz-g:eindDatum ?ind_eind }
204                FILTER (?ind_start <= ?peildatum && ((?ind_eind >= ?peildatum) || (!BOUND(?ind_eind))))
205
206          ?sector a onz-zorg:LangdurigeZorgSector .
207          FILTER(?sector = onz-zorg:VV)
208
209          ?client a onz-g:Human .
210          ?lv a onz-zorg:Leveringsvorm .
211
212          BIND(IF(?lv = onz-zorg:instelling, 1, 0) AS ?isVerblijf)
213          BIND(IF(?lv = onz-zorg:mpt,        1, 0) AS ?isMPT)
214          BIND(IF(?lv = onz-zorg:pgb,        1, 0) AS ?isPGB)
215        }
216        GROUP BY ?client
217      }
218
219      FILTER(?hasVerblijf_org = 1 && (?hasMPT_org = 1 || ?hasPGB_org = 1))
220    }
221  }
222
223  BIND(?Organisatieonderdeel AS ?Indeling)
224}
225ORDER BY ?Indeling