Uitwisselprofiel Zorgkantoren Inkoopondersteuning en beleidsontwikkeling

Over Uitwisselprofiel Zorgkantoren Inkoopondersteuning en beleidsontwikkeling


Publicatiedatum:
03-10-2025

Inwerkingtreding:
03-10-2025

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

Concepten

Relaties

Eigenschappen

SPARQL query

Code gekopieerd

...

Kopieer naar klembord

1# Indicator: Zorgkantoren 14.2
2# Parameters: ?peildatum, ?zorgkantoor
3# Ontologie: versie 3.0 of nieuwer
4
5PREFIX onz-g:   <http://purl.org/ozo/onz-g#>
6PREFIX onz-zorg:<http://purl.org/ozo/onz-zorg#>
7PREFIX onz-org: <http://purl.org/ozo/onz-org#>
8PREFIX rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
9PREFIX rdfs:    <http://www.w3.org/2000/01/rdf-schema#>
10PREFIX xsd:     <http://www.w3.org/2001/XMLSchema#>
11
12SELECT
13  ?Indeling
14  ?Verblijf
15  ?VPT
16  ?MPT
17  ?PGB
18  (?Verblijf + ?VPT + ?MPT + ?PGB AS ?Totaal)
19  (IF(?Verblijf = 0,
20      "Ongedefinieerd",
21      STR(ROUND((xsd:decimal(?VPT) / xsd:decimal(?Verblijf)) * 1000) / 1000)) AS ?Verhouding_VPT_Verblijf)
22  (COALESCE(?DTV_vest, ?DTV_org, 0) AS ?DTV)
23
24WHERE {
25  {
26    SELECT
27      (?Organisatieonderdeel AS ?Indeling)
28      (SUM(?verblijf) AS ?Verblijf)
29      (SUM(?vpt)      AS ?VPT)
30      (SUM(?mpt)      AS ?MPT)
31      (SUM(?pgb)      AS ?PGB)
32    WHERE {
33      #BIND("2024-12-31"^^xsd:date AS ?peildatum)
34
35      ?zorgproces a onz-g:CureAndCareProcess ;
36                  onz-g:definedBy ?indicatie ;
37                  onz-g:hasPerdurantLocation/onz-g:partOf* ?locatie ;
38                  onz-g:startDatum ?start_zorgproces .
39      OPTIONAL { ?zorgproces onz-g:eindDatum ?eind_zorgproces }
40      FILTER (?start_zorgproces <= ?peildatum && ((?eind_zorgproces >= ?peildatum) || (!BOUND(?eind_zorgproces))))
41	
42      # Locatie structuur
43      ?locatie a onz-g:StationaryArtifact ;
44               onz-g:partOf* ?vestiging_uri .
45
46      ?vestiging_uri a onz-org:Vestiging ;
47        onz-g:hasLocalizableArea/onz-g:identifiedBy/onz-g:hasPart/onz-g:hasPart ?postcode_6 .
48
49      BIND(IRI(SUBSTR(STR(?postcode_6), 1, STRLEN(STR(?postcode_6)) - 2)) AS ?postcode)
50
51      ?pc_gebied onz-g:identifiedBy ?postcode ;
52                 onz-g:partOf+ ?zk_regio .
53      ?zk_regio a onz-org:ZorgkantoorRegio .
54      ?zorgkantoor onz-g:hasOperatingRange ?zk_regio .
55
56      {
57        # Vestigingsregel
58        ?vestiging_uri onz-g:identifiedBy ?vest_nr .
59        ?vest_nr a onz-org:Vestigingsnummer ;
60                 onz-g:hasDataValue ?vestiging .
61        BIND(?vestiging AS ?Organisatieonderdeel)
62      } UNION {
63        # Totaal organisatie-regel
64        ?vestiging_uri onz-org:vestigingVan ?organisatie_uri .
65        ?organisatie_uri a onz-g:Business ; rdfs:label ?Organisatie .
66        BIND("Totaal organisatie" AS ?Organisatieonderdeel)
67        BIND("n.v.t." AS ?zk_vestiging)
68      }
69
70      BIND(IF(!BOUND(?zk_vestiging), ?zorgkantoor, ?zk_vestiging) AS ?zorgkantoor_vestiging)
71		
72      # Indicaties
73      ?indicatie a onz-zorg:WlzIndicatie ;
74                 onz-g:hasPart/onz-g:isAbout ?sector ;
75                 onz-g:hasPart ?lv ;
76                 onz-g:isAbout ?client .
77      ?sector a onz-zorg:LangdurigeZorgSector .
78      FILTER(?sector = onz-zorg:VV)
79      ?client a onz-g:Human .
80      ?lv a onz-zorg:Leveringsvorm ; rdfs:label ?leveringsvorm_label .
81
82      BIND(IF(?lv = onz-zorg:instelling, 1, 0) AS ?verblijf)
83      BIND(IF(?lv = onz-zorg:vpt,        1, 0) AS ?vpt)
84      BIND(IF(?lv = onz-zorg:mpt,        1, 0) AS ?mpt)
85      BIND(IF(?lv = onz-zorg:pgb,        1, 0) AS ?pgb)
86    }
87    GROUP BY ?Organisatieonderdeel
88  }
89
90  ######## Subquery 1: DTV per vestiging (zelfde vestiging) ########
91  OPTIONAL {
92    SELECT
93      (?VestigingLabel AS ?Indeling)
94      (COUNT(DISTINCT ?clientVestKey) AS ?DTV_vest)
95    WHERE {
96      {
97        # Basis: flags per client × vestiging
98        SELECT
99          ?client
100          ?vestiging_uri
101          ?VestigingLabel
102          (MAX(?isVerblijf) AS ?hasVerblijf)
103          (MAX(?isMPT)      AS ?hasMPT)
104          (MAX(?isPGB)      AS ?hasPGB)
105        WHERE {
106          #BIND("2024-12-31"^^xsd:date AS ?peildatum)
107
108          ?zorgproces a onz-g:CureAndCareProcess ;
109                      onz-g:definedBy ?indicatie ;
110                      onz-g:hasPerdurantLocation/onz-g:partOf* ?locatie ;
111                      onz-g:startDatum ?start_zorgproces .
112          OPTIONAL { ?zorgproces onz-g:eindDatum ?eind_zorgproces }
113          FILTER (?start_zorgproces <= ?peildatum &&
114                  ((?eind_zorgproces >= ?peildatum) || (!BOUND(?eind_zorgproces))))
115		  
116          # Locatie structuur
117          ?locatie a onz-g:StationaryArtifact ;
118                   onz-g:partOf* ?vestiging_uri .
119
120          ?vestiging_uri a onz-org:Vestiging ;
121            onz-g:hasLocalizableArea/onz-g:identifiedBy/onz-g:hasPart/onz-g:hasPart ?postcode_6 ;
122            onz-org:vestigingVan ?organisatie_uri .
123
124          BIND(IRI(SUBSTR(STR(?postcode_6), 1, STRLEN(STR(?postcode_6)) - 2)) AS ?postcode)
125
126          ?pc_gebied onz-g:identifiedBy ?postcode ;
127                     onz-g:partOf+ ?zk_regio .
128          ?zk_regio a onz-org:ZorgkantoorRegio .
129          ?zorgkantoor onz-g:hasOperatingRange ?zk_regio .
130
131          # Pure vestigingslabel (geen union naar "Totaal organisatie")
132          ?vestiging_uri onz-g:identifiedBy ?vest_nr .
133          ?vest_nr a onz-org:Vestigingsnummer ;
134                   onz-g:hasDataValue ?VestigingLabel .
135                    
136		  # Indicaties
137          ?indicatie a onz-zorg:WlzIndicatie ;
138                     onz-g:hasPart/onz-g:isAbout ?sector ;
139                     onz-g:hasPart ?lv ;
140                     onz-g:isAbout ?client .
141          ?sector a onz-zorg:LangdurigeZorgSector .
142          FILTER(?sector = onz-zorg:VV)
143          ?client a onz-g:Human .
144          ?lv a onz-zorg:Leveringsvorm .
145
146          BIND(IF(?lv = onz-zorg:instelling, 1, 0) AS ?isVerblijf)
147          BIND(IF(?lv = onz-zorg:mpt,        1, 0) AS ?isMPT)
148          BIND(IF(?lv = onz-zorg:pgb,        1, 0) AS ?isPGB)
149        }
150        GROUP BY ?client ?vestiging_uri ?VestigingLabel
151      }
152      # DTV-criteria op dezelfde vestiging
153      FILTER(?hasVerblijf = 1 && (?hasMPT = 1 || ?hasPGB = 1))
154
155      # unieke sleutel per client × vestiging
156      BIND(IRI(CONCAT(STR(?client), "_", STR(?vestiging_uri))) AS ?clientVestKey)
157    }
158    GROUP BY ?VestigingLabel
159  }
160
161  ######## Subquery 2: DTV op organisatieniveau (over vestigingen) ########
162  OPTIONAL {
163    SELECT
164      ("Totaal organisatie" AS ?Indeling)
165      (COUNT(DISTINCT ?client) AS ?DTV_org)
166    WHERE {
167      {
168        # Zelfde basis als 1, maar aggregeren naar client × organisatie
169        SELECT
170          ?client
171          ?organisatie_uri
172          (MAX(?isVerblijf) AS ?hasVerblijf_org)
173          (MAX(?isMPT)      AS ?hasMPT_org)
174          (MAX(?isPGB)      AS ?hasPGB_org)
175        WHERE {
176          #BIND("2024-12-31"^^xsd:date AS ?peildatum)
177
178          ?zorgproces a onz-g:CureAndCareProcess ;
179                      onz-g:definedBy ?indicatie ;
180                      onz-g:hasPerdurantLocation/onz-g:partOf* ?locatie ;
181                      onz-g:startDatum ?start_zorgproces .
182          OPTIONAL { ?zorgproces onz-g:eindDatum ?eind_zorgproces }
183          FILTER (?start_zorgproces <= ?peildatum &&
184                  ((?eind_zorgproces >= ?peildatum) || (!BOUND(?eind_zorgproces))))
185
186          ?locatie a onz-g:StationaryArtifact ;
187                   onz-g:partOf* ?vestiging_uri .
188
189          ?vestiging_uri a onz-org:Vestiging ;
190                         onz-org:vestigingVan ?organisatie_uri ;
191                         onz-g:hasLocalizableArea/onz-g:identifiedBy/onz-g:hasPart/onz-g:hasPart ?postcode_6 .
192
193          BIND(IRI(SUBSTR(STR(?postcode_6), 1, STRLEN(STR(?postcode_6)) - 2)) AS ?postcode)
194
195          ?pc_gebied onz-g:identifiedBy ?postcode ;
196                     onz-g:partOf+ ?zk_regio .
197          ?zk_regio a onz-org:ZorgkantoorRegio .
198          ?zorgkantoor onz-g:hasOperatingRange ?zk_regio .
199
200          ?indicatie a onz-zorg:WlzIndicatie ;
201                     onz-g:hasPart/onz-g:isAbout ?sector ;
202                     onz-g:hasPart ?lv ;
203                     onz-g:isAbout ?client .
204          ?sector a onz-zorg:LangdurigeZorgSector .
205          FILTER(?sector = onz-zorg:VV)
206          ?client a onz-g:Human .
207          ?lv a onz-zorg:Leveringsvorm .
208
209          BIND(IF(?lv = onz-zorg:instelling, 1, 0) AS ?isVerblijf)
210          BIND(IF(?lv = onz-zorg:mpt,        1, 0) AS ?isMPT)
211          BIND(IF(?lv = onz-zorg:pgb,        1, 0) AS ?isPGB)
212        }
213        GROUP BY ?client ?organisatie_uri
214      }
215      # DTV-criteria over de organisatie (mag over verschillende vestigingen)
216      FILTER(?hasVerblijf_org = 1 && (?hasMPT_org = 1 || ?hasPGB_org = 1))
217    }
218  }
219}
220ORDER BY ?Indeling
221