Register on the Discovery Service
Register the care organization on the use case's Discovery Service, so other parties can find it and its API endpoints. In the Nuts node this is called "activating" the Discovery Service for a subject.
Do this once per care organization, per use case. The node then keeps the registration up to date by itself.
Before you start
- The node has the use case's Discovery Service definition (see chapter "Configure the node for a use case").
- The care organization has a subject (see "Create a subject").
- The wallet has the credentials the Discovery Service definition requires. For 360-graden-clientbeeld that's only the X509Credential (see "Load the credential into the wallet").
- You know which registration parameters the use case requires, see below.
Registration parameters
Registration parameters are values you publish with the registration, typically API endpoints. The use case says which ones you need. The node puts them in a DiscoveryRegistrationCredential, so you don't need to issue that credential yourself.
For 360-graden-clientbeeld:
| Parameter | Required | Value |
|---|---|---|
fhirR4BaseURL |
At least one of the two | Base URL of your FHIR R4 API |
fhirStu3BaseURL |
At least one of the two | Base URL of your FHIR STU3 API |
authServerURL |
Added by the node | Your Nuts node's OAuth2 authorization server URL for this subject |
Using the API
POST <internal Nuts interface>/internal/discovery/v1/360-graden/careorg-a-acc
Content-Type: application/json
{
"registrationParameters": {
"fhirR4BaseURL": "https://fhir.example.com/r4"
}
}
360-gradenis the service ID: theidfield of the Discovery Service definition.careorg-a-accis the subject ID.
The node registers right away:
| Response | Meaning | What to do |
|---|---|---|
200 OK |
Registered. The node refreshes the registration by itself before it expires. | Nothing |
412 Precondition Failed |
Not registered. The response says why, e.g. missing credentials or the Discovery Server can't be reached. The node does not retry by itself. | Fix the cause and call the API again |
404 Not Found |
Unknown service ID or subject ID | Check both IDs |
Check that it worked
Get the registration status:
GET <internal Nuts interface>/internal/discovery/v1/360-graden/careorg-a-acc
activatedshould betrueandstatusshould beactive.- If
statusiserror,errorsays what went wrong, e.g. a refresh that failed.
Then check that others can find you, by searching for your own care organization, e.g. by name:
GET <internal Nuts interface>/internal/discovery/v1/360-graden?credentialSubject.subject.O=Zorgorganisatie%20A*
- The query parameter is a path in the credential (without
$.), not a field ID from the definition. - Matching is case-insensitive, and
*is a wildcard at the start or end. - Your care organization should be in the result, with your DID in
credential_subject_idand your registration parameters inregistrationParameters.
See "Discovery of organizations and endpoints" for more search options.
Changing or removing the registration
-
Change the registration parameters, e.g. a new FHIR URL: call the
POSTagain with the new values. -
Remove the registration:
DELETE <internal Nuts interface>/internal/discovery/v1/360-graden/careorg-a-acc200 OKmeans it was removed.202 Acceptedmeans the node stopped refreshing, but couldn't remove the registration from the Discovery Server; it disappears there when it expires.
API reference: Discovery Service