Generic Functions for data exchange - Implementation Guide
26.0.0 - trial-use
Generic Functions for data exchange - Implementation Guide - Local Development build (v26.0.0) built by the FHIR (HL7® FHIR® Standard) Build Tools. See the Directory of published versions
GF Localization enables healthcare professionals to find care providers (custodians) that hold relevant data for a patient. The Nationale Verwijs Index (NVI) stores one Patient resource per patient, custodian and registering client. A data user searches by the patient's NVI pseudonym and optional custodian properties, and receives only custodians that return an allow Authorization Decision.
Note: This page is based on version 0.9.0 of the Functional and Technical Design Documents of the Generic Function Localization (Generieke Functie Lokalisatie). The current and previous versions of this document are available at www.generiekefuncties.nl/lokalisatie.
This page specifies:
This page does not specify:
| Term | Meaning |
|---|---|
| GF Localization | The generic function specified on this page. |
| NVI | Nationale Verwijs Index, the Data Localization Index. The central service that stores registrations and answers searches. |
| Custodian | A care provider that holds data for a patient and registers that patient at the NVI. |
| Data user | A care provider and practitioner who search for custodians that hold relevant data for a patient. |
| Localization Registration Client | The software, such as an EHR or PACS, that registers and maintains patients at the NVI for a custodian. |
| Localization Search Client | The software, such as an EHR, that searches the NVI for a data user. |
| Registration | A Patient resource at the NVI that states that one custodian holds data for one patient, registered by one Localization Registration Client. |
| NVI pseudonym | The patient identifier at the NVI. The Pseudonym Registration Service (PRS) derives it from the BSN for the NVI only. |
| Custodian-assigned identifier | The custodian's own patient identifier. The NVI uses it to request Authorization Decisions from that custodian. |
| Search context | The custodian properties that a data user searches on, such as care provider type or healthcare-service type. See Search context. |
| Authorization Decision | A custodian's allow or deny answer to the question whether the data user may access its data for the patient. See GF-LOC-5. |
When this page says that a custodian or data user sends a request, its Localization Registration Client or Localization Search Client sends it.
Custodians first register patients whose data they manage:
Patient resource for that patient and custodian at the NVI.
A data user can then discover relevant custodians:
Patient resources that match the patient's pseudonym and belong to one of the selected custodians.
| Actor | Role | Transactions | Requirements |
|---|---|---|---|
| NVI | Stores registrations, answers searches, and requests Authorization Decisions | Server for GF-LOC-1 to GF-LOC-4; client for GF-LOC-5 | CapabilityStatement, Patient profile |
| Localization Registration Client | Registers and maintains patients for a custodian | Client for GF-LOC-1 to GF-LOC-3 | Patient profile, Registration lifecycle |
| Localization Search Client | Searches for custodians for a data user | Client for GF-LOC-4 | Search context |
| Custodian Server | The custodian's FHIR API; answers Authorization Decisions | Server for GF-LOC-5 | This page; no CapabilityStatement yet (see Open issues) |
| Pseudonym Registration Service | Evaluates the OPRF for NVI pseudonyms | See GF Pseudonymization | GF Pseudonymization |
The NVI SHALL implement these FHIR capabilities. It is the server for GF-LOC-1 to GF-LOC-4, and the client for GF-LOC-5.
The Localization Registration Client acts for a custodian. It SHALL support GF-LOC-1 to GF-LOC-3, and SHALL follow the Registration lifecycle.
The Localization Search Client acts for a data user. It SHALL support GF-LOC-4.
One system, such as an EHR, MAY implement both client actors.
The Custodian Server is the custodian's FHIR API, registered in the Care Service Directory. It serves the custodian's data, and is the server for GF-LOC-5.
The Pseudonym Registration Service (PRS) provides OPRF evaluations used by clients to derive recipient-scoped pseudonyms from patient identifiers using HKDF and OPRF protocols. See GF Pseudonymization for the full specification and the reference implementation.
| ID | Transaction | Client | Server |
|---|---|---|---|
| GF-LOC-1 | Register Patient | Localization Registration Client | NVI |
| GF-LOC-2 | Delete Patient | Localization Registration Client | NVI |
| GF-LOC-3 | Retrieve Registrations | Localization Registration Client | NVI |
| GF-LOC-4 | Search Localization | Localization Search Client | NVI |
| GF-LOC-5 | Authorization Decision | NVI | Custodian Server |
The Localization Registration Client registers that a custodian holds data for a patient.
Artifacts. CapabilityStatement (create interaction), Patient profile, Patient example.
Request. The client SHALL register with a conditional create, so a retry never creates a second registration:
POST [base]/Patient
If-None-Exist: identifier=[custodian-assigned identifier]&_source=urn:generiekefuncties:nvi:client-id:{client_id}
Each registered Patient SHALL contain:
identifier with system http://generiekefuncties.nl/nvi/identifier;Identifier.assigner;managingOrganization.identifier;client_id represented as a URI in meta.source, using the form urn:generiekefuncties:nvi:client-id:{client_id}.The custodian-assigned identifier SHALL be accepted as the patient search value at the custodian's FHIR Endpoint.
NVI pseudonym. Before registering, the client SHALL obtain the NVI pseudonym from the Pseudonym Registration Service (PRS). The client packages the JWE and blind_factor together as a JSON object:
{
"evaluated_output": "<JWE compact serialization>",
"blind_factor": "<base64url-encoded blind_factor>"
}
The client places this object, base64url-encoded, in the NVI Patient.identifier value. The NVI decrypts and unblinds it before storing the resulting pseudonym. See the Patient example.
Response.
| Status | Meaning |
|---|---|
201 Created |
The NVI created the registration. |
200 OK |
A matching registration exists. The NVI returns it and does not create a new one. |
412 Precondition Failed |
More than one registration matches the condition. The client SHALL delete the duplicates (see Reconciliation). |
For other errors, see Error handling.
The Localization Registration Client deletes a registration.
Artifacts. CapabilityStatement (delete interaction).
Request.
DELETE [base]/Patient/[id]
Response.
| Status | Meaning |
|---|---|
200 OK or 204 No Content |
The NVI deleted the registration. |
404 Not Found |
The registration does not exist. The client SHALL treat this as success. |
The NVI does not support updates. To change a registration, for example after a new custodian-assigned identifier or a patient merge, the client SHALL delete the registration and register a new one.
The Localization Registration Client retrieves the registrations it made, for record maintenance.
Artifacts. CapabilityStatement (search-type interaction, _source search parameter), Patient profile.
Request.
GET [base]/Patient?_source=urn:generiekefuncties:nvi:client-id:{client_id}
Response. 200 OK with a searchset Bundle of the complete Patient resources registered by this client, including the custodian-assigned identifier. The client SHALL follow every next link until there is none.
This response is separate from the GF-LOC-4 response, which SHALL NOT include the custodian-assigned identifier.
The Localization Search Client searches for custodians that hold relevant data for a patient, for a data user.
Artifacts. CapabilityStatement (search-type interaction, identifier and organization search parameters), Search context.
Request. The client SHALL search using POST [base]/Patient/_search with Content-Type: application/x-www-form-urlencoded, so the patient pseudonym and search context are not exposed in URLs or access logs. The identifier parameter SHALL identify the NVI pseudonym. It MAY be combined with these standard FHIR searches:
organization:identifier: custodian Organization identifier(s) (URA);organization.type: custodian Organization type;organization.endpoint.payload-type: payload type of an Endpoint belonging to the custodian;organization._has:HealthcareService:organization:service-type: type of a HealthcareService provided by the custodian.organization:identifier uses the standard reference :identifier modifier to match the identifier carried by Patient.managingOrganization. This is different from organization.identifier, which chains to the identifier of a referenced Organization resource. The NL GF Data Localization Patient profile carries the URA on managingOrganization.identifier and prohibits managingOrganization.reference, so these forms are not interchangeable for profile-conformant registrations.
The filters use standard chained or reverse-chained parameters. Organization.endpoint can only refer to an Endpoint, so the Endpoint chain needs no type qualifier. The NVI SHALL also accept the equivalent type-qualified form organization.endpoint:Endpoint.payload-type. The NVI SHALL resolve the managingOrganization URA against its Care Service Directory replica when evaluating these filters. Implementations SHALL support organization:identifier for the profile's identifier-only reference, including when the underlying FHIR server does not support that standard modifier natively.
Search parameters are combined with AND; comma-separated values within a parameter are combined with OR. The data user is identified from the access token's authorization_details object, never from search parameters.
Example: a patient held by any of custodian ids 123, 456, 789, or 012, where the care provider is type 8610, has an Endpoint supporting medicationRequest, and provides cardiology services:
POST [base]/Patient/_search HTTP/1.1
Authorization: [localization client access token]
Content-Type: application/x-www-form-urlencoded
identifier=http://generiekefuncties.nl/nvi/identifier|{NVI-patient-identifier}
&organization:identifier=urn:oid:2.16.528.1.1007.3.3|123,urn:oid:2.16.528.1.1007.3.3|456,urn:oid:2.16.528.1.1007.3.3|789,urn:oid:2.16.528.1.1007.3.3|012
&organization.type=https://www.cbs.nl/standaard-bedrijfsindeling|8610
&organization.endpoint.payload-type=http://fhir.generiekefuncties.nl/CodeSystem/nl-gf-data-categories-cs|medicationRequest
&organization._has:HealthcareService:organization:service-type=http://fhir.generiekefuncties.nl/CodeSystem/nl-gf-zorgvragen-cs|msz.cardiologie
{NVI-patient-identifier} is the base64url-encoded PRS object described under GF-LOC-1. The NVI decrypts and unblinds it to find matching Patient resources.
Processing. The NVI SHALL:
Patient resources that match the NVI pseudonym and belong to one of the selected custodians;Patient search results for which the decision is allow, omitting all Patient.identifier values and meta.source.Response. 200 OK with a searchset Bundle containing Patient projections for custodians that match the search context and received an allow decision. These projections are marked with the SUBSETTED tag. For privacy, the NVI omits all Patient.identifier values and meta.source; the projections are not complete instances of the registration profile and SHALL NOT be used to update registrations.
The response SHALL NOT reveal whether a custodian was omitted because it had no matching record, did not match the search context, received a deny decision, or could not be reached.
Example response:
{
"resourceType": "Bundle",
"type": "searchset",
"total": 1,
"entry": [
{
"fullUrl": "https://nvi.example.org/fhir/Patient/9b6e3c1a-2f4d-4c8e-9a71-5d0f3b2e7c44",
"resource": {
"resourceType": "Patient",
"id": "9b6e3c1a-2f4d-4c8e-9a71-5d0f3b2e7c44",
"meta": {
"tag": [
{
"system": "http://terminology.hl7.org/CodeSystem/v3-ObservationValue",
"code": "SUBSETTED"
}
]
},
"managingOrganization": {
"identifier": {
"system": "urn:oid:2.16.528.1.1007.3.3",
"value": "123"
}
}
},
"search": {
"mode": "match"
}
}
]
}
For each matching custodian, the NVI asks whether the data user may access the custodian's data for the patient.
Artifacts. NL GF Data Categories CodeSystem. There is no Custodian Server CapabilityStatement yet (see Open issues).
Request. The NVI sends a HEAD request to the custodian's existing FHIR API. The requested data categories are the values of organization.endpoint.payload-type in the search. When the search specifies data categories, the NVI sends one request for each resource type of those categories. When it does not, the NVI sends one request on Patient:
HEAD [fhir-base-url]/[fhir-resourcetype]?patient.identifier=[custodian-assigned identifier]
[fhir-base-url]: the address of an active, in-period hl7-fhir-rest Endpoint in the Care Service Directory replica. When the search specifies custodian Endpoint payload types, the Endpoint's payloadType SHALL match at least one of these types.[fhir-resourcetype]: the FHIR resource type and search parameters mapped to the requested category by the path-query-param property of the NL GF Data Categories CodeSystem, such as MedicationDispense, MedicationAdministration, MedicationStatement, and Immunization for code MedicationUse. If no data category is specified, the resource type Patient is used.[custodian-assigned identifier]: the custodian-assigned patient identifier in the Patient.For a resource type of Patient, use HEAD [fhir-base-url]/Patient?identifier=[custodian-assigned identifier] instead of patient.identifier.
The request carries an access token whose authorization_details identifies the care provider and practitioner acting as the data user. The NVI is the acting party (the OAuth client). See Security.
Example:
HEAD https://fhir.datahouder-123.example/fhir/ImagingStudy?patient.identifier=https://fhir.datahouder-123.example/identifier/patient|9fd244dc-6b35-4a7d-843d-ac77591cb14d HTTP/1.1
Authorization: [access token]
Custodian Server requirements. For an Authorization Decision, the Custodian Server SHALL:
HEAD requests on the relevant FHIR search interactions for each data category;200 OK for allow or 204 No Content for deny;NVI processing. The NVI treats 200 OK as allow. It treats any other status, and any response that arrives after 1 second, as deny. In addition:
An allow decision does not replace authorization of the actual data request. The custodian authorizes every subsequent request because access policies can change.
The registration key is the combination of the custodian's ID (managingOrganization.identifier), the custodian-assigned identifier (system|value) and the registering client (meta.source). After unblinding, the NVI also treats the combination of custodian ID, NVI pseudonym and registering client as unique.
A custodian MAY use more than one Localization Registration Client, for example an EHR and a PACS, or an old and a new system during a migration. Each client then maintains only its own registrations, so one client never deletes a registration that another client made. A custodian with one client needs nothing extra. The registering client is never returned to data users and does not affect search results.
Register. The Localization Registration Client SHALL register a patient (GF-LOC-1) when both conditions hold:
One registration covers all data categories of that custodian. The client SHALL register immediately after both conditions hold, as part of the event that causes them. A client that cannot register on events SHALL register within 24 hours.
Delete. The client SHALL delete the registration (GF-LOC-2) when either condition no longer holds. For example, the retention period has ended, or the record has moved to another care provider.
Registration on events can miss changes, for example after an outage or a failed request. The client SHALL therefore reconcile its registrations with the custodian's records at least once a week.
A missing registration is the harmful case: data users cannot find the custodian's data. A stale registration only costs an extra Authorization Decision, because the custodian answers deny.
The client SHALL perform these steps in this order:
id and its registration key. This is list N.404 Not Found on a delete as success. Do not stop the run on a failed request; the next run retries it.Step 1 SHALL complete before step 2 starts. A patient registered on an event during the run is then in L, and step 3 does nothing for it because of the conditional create. In the opposite order, that patient could be in N but not in L, and step 4 would delete it by mistake.
sequenceDiagram
participant client as Localization Registration Client
participant records as Custodian records
participant prs as Pseudonym Registration Service
participant nvi as NVI
client->>nvi: GF-LOC-3: GET /Patient?_source=[client URI]
nvi-->>client: searchset Bundle (follow next links)
client->>client: Build list N (id, registration key)
client->>records: Select patients that meet both registration conditions
records-->>client: Build list L (registration key)
loop for each key in L, not in N
client->>prs: OPRF exchange with random blinding factor
prs-->>client: Encrypted, NVI-scoped pseudonym
client->>nvi: GF-LOC-1: POST /Patient<br/>If-None-Exist
nvi-->>client: 201 Created, or 200 OK if it exists
end
loop for each key in N, not in L, and each duplicate
client->>nvi: GF-LOC-2: DELETE /Patient/[id]
nvi-->>client: 200 OK, 204 No Content or 404 Not Found
end
The NVI SHOULD return an OperationOutcome that describes the error for every 4xx and 5xx response in GF-LOC-1 to GF-LOC-4.
| Status | Cause | Client action |
|---|---|---|
400 Bad Request |
The request is malformed, for example a search without identifier or with an unsupported parameter. |
Correct the request. Do not retry unchanged. |
401 Unauthorized |
The access token is missing, expired, or invalid. | Obtain a new token and retry. |
403 Forbidden |
The client is not authorized for this request, for example to maintain another client's registrations. | Do not retry. |
422 Unprocessable Entity |
The Patient does not conform to the profile, or the NVI cannot decrypt or unblind the NVI pseudonym. | Correct the registration or obtain a new pseudonym. |
5xx |
The NVI cannot process the request. | Retry later. A retry of GF-LOC-1 is safe because of the conditional create. |
The NVI SHALL NOT answer a failed search with an empty Bundle. When the NVI itself cannot process a search, it returns a 5xx status.
An unreachable custodian is not an NVI failure. The NVI treats it as deny, does not retry the Authorization Decision within the same search, and returns the search result without that custodian. As a result, a data user cannot tell an empty result from a result in which custodians were unreachable or denied access. This is by design: a timeout only occurs for a custodian that holds a registration for the patient, so reporting it would reveal that the registration exists.
The NL GF Data Localization Patient profile uses one Patient resource per patient, custodian and registering client:
Patient.identifier contains the NVI pseudonym and a custodian-assigned patient identifier;Patient.managingOrganization identifies the custodian by URA (OID 2.16.528.1.1007.3.3);Patient.meta.source identifies the registering OAuth client.The custodian-assigned identifier SHALL be unique within the custodian's identifier namespace and accepted by its FHIR Endpoint as the patient search value. It SHALL NOT be the BSN and SHALL NOT be derivable from the BSN. The NVI stores it to request Authorization Decisions from that custodian. It SHALL NOT return it in data-user search responses, but MAY return it to the authorized Localization Registration Client for record maintenance. The combination of the NVI pseudonym, the custodian URA and the OAuth client id SHALL be unique.
The search context (zoekcontext) consists of properties of custodians that are relevant to the data user. The following properties are supported:
| Search context | FHIR search parameter | Evaluated against |
|---|---|---|
| Patient | identifier |
NVI identifier system and PRS pseudonym |
| Custodian organization | organization:identifier |
Care Service Directory Organization.identifier |
| Organization type | organization.type |
Care Service Directory Organization.type |
| Endpoint data category | organization.endpoint.payload-type |
Care Service Directory Endpoint payloadType |
| Healthcare-service type | organization._has:HealthcareService:organization:service-type |
Care Service Directory HealthcareService type and providedBy |
FHIR R4 defines these standard search parameters and chained paths. The NVI SHALL support the listed paths and resolve managingOrganization identifiers against the Care Service Directory replica.
| Transaction | OAuth client | Access token identifies | Never sent |
|---|---|---|---|
| PRS evaluation | Localization Registration Client or Localization Search Client | See GF Pseudonymization | The BSN or the derived pseudonym, to the PRS |
| GF-LOC-1 to GF-LOC-3 | Localization Registration Client | The registering client (client_id, stored in meta.source) |
The BSN, to the NVI |
| GF-LOC-4 | Localization Search Client | The data user: care provider and practitioner, in authorization_details |
The BSN, to the NVI; the custodian-assigned identifier and meta.source, to the data user |
| GF-LOC-5 | NVI (acting party) | The data user: care provider and practitioner, in authorization_details |
The BSN, the NVI pseudonym, and the broader search context, to the custodian |
See GF Pseudonymization for PRS authentication requirements.
The Localization Search Client's access token SHALL include care provider and practitioner details in the authorization_details object (as required for EU-cross-border exchange by EHDS Implementing Act 2026/2099, Annex 1).
For an Authorization Decision, the care provider and practitioner details are, again, in the authorization_details object, but now the NVI is the acting party (the OAuth client).
For other authentication, transport-layer and access-token details, see GF Authentication.
200 OK, including timeouts, is deny.A custodian registers a Patient resource for each patient it holds. The NVI identifier carries the PRS result envelope; the resource also contains the custodian-assigned identifier, the custodian ID, and the registering OAuth client URI.
sequenceDiagram
actor doctor as Practitioner
participant ehr as EHR / PACS<br/>Localization Registration Client
participant prs as Pseudonym Registration Service
participant NVI as NVI
doctor->>ehr: Register patient data
ehr->>ehr: Derive pseudonym from BSN<br/>and blind it with a random blinding factor
ehr->>prs: OPRF exchange with blinded input
prs-->>ehr: Encrypted, NVI-scoped pseudonym (JWE)
ehr->>ehr: Create Patient with JWE and blinding factor,<br/>custodian-assigned identifier,<br/>managingOrganization and meta.source
ehr->>NVI: GF-LOC-1: POST /Patient<br/>If-None-Exist
NVI->>NVI: Decrypt and unblind NVI pseudonym
NVI-->>ehr: 201 Created, or 200 OK if it exists
Dr. Smith's EHR searches for a patient's imaging data at organizations offering cardiology services. The NVI uses the patient pseudonym and search context to select candidates, then returns only custodians with an allow decision.
sequenceDiagram
actor doctor as Practitioner<br/>Data user
participant ehr as EHR<br/>Localization Search Client
participant prs as Pseudonym Registration Service
participant nvi as NVI
participant holder as Custodian Server
doctor->>ehr: Request patient imaging data
ehr->>ehr: Derive pseudonym from BSN<br/>and blind it with a random blinding factor
ehr->>prs: OPRF exchange with blinded input
prs-->>ehr: Encrypted, NVI-scoped pseudonym (JWE)
ehr->>nvi: GF-LOC-4: POST /Patient/_search<br/>identifier + organization chains
nvi->>nvi: Select custodians in<br/>Care Service Directory replica
nvi->>nvi: Match patient registrations<br/>of selected custodians
loop for each matching custodian and resource type
nvi->>holder: GF-LOC-5: HEAD mapped data search<br/>using custodian-assigned identifier
holder->>holder: Evaluate Authorization Decision
holder-->>nvi: 200 OK allow, or 204 No Content deny
end
nvi-->>ehr: searchset Bundle with allowed Patient projections
ehr->>holder: Request data from returned custodians
holder-->>ehr: Authorized clinical data
ehr-->>doctor: Display available data
GET [base]/Patient?_source=urn:generiekefuncties:nvi:client-id:ehr-client-org2
The NVI returns a searchset Bundle of matching Patient resources to the authorized Localization Registration Client for record maintenance (GF-LOC-3). This maintenance interaction is separate from data-user search responses, which SHALL NOT include the custodian-assigned identifier.
HEAD support and Authorization Decision responses.