GetOAuthToken Example

The GetOAuthToken process demonstrates how an OAuth token is generated and used in other activities to work with the data stored on the server.

For more information about the GetOAuthToken activity, see Get OAuth Token Activity.

GetOAuthToken Process

The GetOAuthToken process is illustrated here:

Prerequisite

You must have FHIR server with an OAuth client and server locally configured on it. If it is not installed, provide the external URL (token endpoint) of the server in the Token Endpoint field for the FHIR Authentication server and the respective details on that page. You must provide the server URL while configuring the FHIR server for GetOAuth operation.

Process Definition

The process generates an OAuth token which is then used to create a patient record and delete an existing patient record. To generate an OAuth token, a FHIR Authentication shared resource has been configured by providing Client ID, Client Secret, Scope, and Token Endpoint. A FHIR server has also been configured. The following operations are performed when you run the process:
  1. The Timer activity starts the process.
  2. The GetOAuthToken activity generates the token.
  3. The token generated by the GetOAuthToken activity is passed to the CreatePatientWithToken activity and a patient record is created. The activity outputs the ID of the patient record generated.
  4. The ID of the patient and the OAuth token are passed as input to the DeletePatient activity and the corresponding record is deleted from the server.
  5. After the process executes successfully, a Success message is written to the Console. Select Window > Show Console in TIBCO Business Studio to view the log messages.

Process Output

Select the desired activity and click the Output tab.

  1. The output of the GetOAuthToken activity is an OAuth token.
  2. The CreatePatientWithToken activity generates a patient record and returns the patient ID.
  3. The DeletePatient activity successfully deletes the patient record.