Testing the interface

 

Enable test client

  1. Log in to the Keycloak administration console via server:port/auth/.
  2. In the realm trustcenter, go to Clients and open the client trustcenter-test.
  3. In Settings, enable the client and click Save.
  4. In Credentials, copy the client secret to the clipboard.

 


Perform test

  1. Start Postman.
  2. Create new POST request to server:port/v1/process.
  3. In Authorization, choose OAuth 2.0 and get new access token via the information described in the following table and use it (click at the bottom).

 

Name Value
Token Name Choose any
Grant Type Client Credentials
Access Token URL server:port/auth/realms/trustcenter/protocol/openid-connect/token
Client ID trustcenter-test
Client Secret Secret from clipboard
Scope -
Client Authentication Send as Basic Auth header

 

  1. In Body, choose raw and type JSON (application/json) and insert the following json:
{
    "resourceType": "Bundle",
    "entry": [
        {
            "resource": {
                "resourceType": "Encounter",
                "identifier": [
                    {
                        "use": "official",
                        "system": "Test",
                        "value": "identifier-value-123",
                        "period": {
                            "start": "2017-01-01T10:46:19+01:00",
                            "end": "2017-02-01T10:46:19+01:00"
                        }
                    }
                ]
            }
        },
        {
            "resource": {
                "resourceType": "Patient",
                "identifier": [
                    {
                        "use": "official",
                        "system": "Test",
                        "value": "ABC123"
                    }
                ],
                "name": [
                    {
                        "use": "official",
                        "family": "Müller"
                    }
                ]
            }
        },
        {
            "resource": {
                "resourceType": "Provenance",
                "id": "1",
                "target": [
                    {
                        "identifier": {
                        "value": "MS_PATIENT:4dab72f1494596d306d870ff9a3dc666d37e4062"
                        }
                    }
                ],
                "recorded": "2019-10-16T15:52:50.160+02:00",
                "activity": {
                    "coding": [
                        {
                            "system": "http://terminology.hl7.org/CodeSystem/v3-DataOperation",
                            "code": "CREATE",
                            "display": "create"
                        }
                    ]
                },
                "agent": [
                    {
                        "who": {
                            "identifier": {
                                "value": "instance-test-ms-v1:0.2.0-SNAPSHOT"
                            }
                        }
                    }
                ]
            }
        }
    ]
}

 

  1. Send the request.
  2. In your browser, go to server:port/entity-list/ and log in.
  3. Search for *ABC* (including the wildcard character *).
  4. You should get 'Müller', 'ABC123' and a Pseudonymn.