Skip to main content

Register on the Discovery Service

BeforeRegister anotherthe partycare organization on the use case's Discovery Service, so other parties can interact with you, they will first need to find yourit and its API endpoints. The discovery service inIn the Nuts node helpsthis you.is Youcalled do"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/<servicedefinition-id>/<subject-id>360-graden/careorg-a-acc
    Content-Type: application/json
    
    {
      "registrationParameters": {
        "abc"fhirR4BaseURL": "xyz",
        "someparameter": "somevalue"https://fhir.example.com/r4"
      }
    }
    

    Replace

      360-graden is the service ID: the id field of the Discovery Service definition. careorg-a-acc is 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 <servicedefinition-idinternal Nuts interface>/internal/discovery/v1/360-graden/careorg-a-acc
      
        activated should be true and status should be active. If status is error, error says 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_id and your registration parameters in registrationParameters.

          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 POST again with the servicedefinition-idnew andvalues.

            replace <subject-id> with

            Remove the subject-idregistration:

            of
            DELETE <internal Nuts interface>/internal/discovery/v1/360-graden/careorg-a-acc
            

            200 OK means it was removed. 202 Accepted means the organization.

            node
            stopped

            Forrefreshing, eachbut usecouldn't case a discovery service definition is specified that specifiesremove the servicedefinition-idregistration andfrom the registrationParameters.Discovery Server; it disappears there when it expires.

            Using Nuts Admin

            toAPI doreference: Discovery Service