Resource Operations API Activity

The Resource Operations API activity is used to create, read, update, delete an FHIR resource on the specified FHIR server via the BusinessWorks REST resource. You can also perform Batch and Transaction operations only specific to the bundle resource.

Note:

The Batch and Transaction operations are available only for the Bundle FHIR resource. You can use these operations to submit a set of actions such as HTTP POST, PUT, GET, and DELETE, to be performed on an FHIR server in a single HTTP request. The actions might be performed independently as a batch or as a single atomic transaction.

To enable authentication policy to FHIR services, see How to configure Users for authenticating REST services.

Example

Refer to the associated example:

Resource Operations API Example

General

The General tab contains the following fields:

Field Literal Value/Module Property/Process Property? Description
Name No Enter the name to be displayed as a label for the activity in the process.
FHIR Context No Points to the desired FHIR server
    Display existing FHIRContextPropertiesDisplays

If multiple properties are created, select one from the list.

    Create a new process property

After creation, the new property appears on the FHIRContextPropertiesDisplays menu.
    Set default property values

To select the Default Value Set for the property, click :

  • Literal Value
  • Module Property

    Edit Default Resource

To edit the default resource, click Edit Default Resource.

    Clear Value

To clear the current value from the existing FHIRContextProperties display, click Clear Value.

Description

The Description tab is used to provide a short description of the activity.

Input

The Input tab is auto populated. The values from the DataSource tab are required to map to the input fields based on the required operation type.

Field Datatype Description
Headers - Any additional information with an HTTP request or response can be passed through the headers. These are standard HTTP headers.
DynamicHeaders - Any customized header apart from the standard header can be passed through dynamic headers.

For more information about the supported resource types, see the FHIR R4 and FHIR STU3 documentation.

Output

The Output tab is auto populated and the output fields are to be mapped to the REST resource output.

Output Item Datatype Description
OperationOutcome element

Collection of success, error, warning, or information messages that result from a system action.

Status Code Element The HTTP response codes for the operation. This code is to the REST Client as a response status code.

For more information about the supported resource types, see the FHIR R4 and FHIR STU3 documentation.

Creating BusinessWorks CRUD API Operations

To create BusinessWorks CRUD API operations, perform the following steps:

  1. Go to BusinessWorks Studio and expand Processes.

  2. Right-click your process, and then click New > BusinessWorks REST Resource.

  3. In the Create Rest resource wizard, enter the name of the process and select the required CRUD operations and then click Next.

    Note:

    POST - Create/ Batch/ Transaction; GET - Read; PUT - Update; DELETE - Delete.

  4. As per the operation type, enter the Nickname, Summary, and Notes fields.

    Note: It is not mandatory to change the Request and Respond fields.
  5. Go to Modular Descriptions > Components and then select Process.

  6. Open the Properties tab and perform the following steps:

    Note: You can edit resource operations on the Operations tab. You can edit the operations on the Operation Details tab.
  7. Under the FHIR Client palette of all four operations, double-click FHIRService.bwp and add the Resource Operations API activity.

  8. Go to Properties > General, enter the name of each activity to the respective Operation and select R4 under FHIR Context.

    Note: This activity supports only FHIR R4 resource type.
  9. Map the input tab with all the operations.

    Note:
    • Input mappings for postOut, getOut, putOut and deleteOut is same.
    • Map to item object as shown in the image. deleteOut has message object.
  10. Map the statusCode of each operation to the statusCode under status object.

  11. Add the following values to the security headers added in the Response tab.

    Note:

    The above mentioned security headers will be applicable to all the service

  12. After the application starts, run the BusinessWorks Rest Resource process and enter the lrestdoc command in the console.

  13. To open the Swagger documentation in a browser, use the discovery URL.

You can use Swagger to make the resource operations API calls with any client.

When you open the Swagger website on a browser. The definition of each operation is present in the Swagger website under each section.

Creating Post (Create/Batch/Transaction) Operation

To create a POST (Create/Batch/Transaction) operation, perform the following steps:

  1. From the Request dropdown list, Select the Form Data - Multipart (application/form-data) option. Then, add ResourceData as a Form Parameter and operation to Query and Header Parameters.

  2. Select the Use HTTP Header and Use Custom Status Line checkboxes on the Response tab and then select the JSON and XML format checkboxes.

  3. On the Response Status tab, add the HTTP status codes as shown in the following image.

Creating Read (Get) Operation

To create a Read(GET) operation, follow these steps:

  1. Add resourceId, versionId, resourceType to Query Parameters and add Operation as a Header Parameter.

  2. Note: resourceType is case-sensitive and must start with a capital letter.

  3. Select the Use HTTP Header and Use Custom Status Line checkboxes on the Response tab, and then select the JSON and XML format checkboxes.

  4. On the Response Status tab, add the HTTP status codes as shown in the following image.

Creating Update (PUT) Operation

To create a Update(PUT) operation, follow these steps:

  1. Select form data - Multipart (application/form-data) from the Request drop-down list and add ResourceData as a Form Parameter and Operation to Query and Header Parameters.

  2. Select the Use HTTP Header and Use Custom Status Line checkboxes on the Response tab and then select the JSON and XML format checkboxes.

  3. Now add the following HTTP status codes to the Response Status tab.

Creating Delete (Delete) Operation

To create a Delete (Delete) operation, follow these steps:

  1. Add resourceId, resourceType to the Query Parameters and add Operation as a Header Parameter.

  2. Note: resourceType is case-sensitive and must start with a capital letter.
  3. Select the Use HTTP Header and Use Custom Status Line checkboxes on the Response tab, and then select the JSON and XML format checkboxes.

  4. Now add the HTTP status codes to the Response Status tab.

Note: The HTTP Status codes are same as given in the Read Operation.
Note: resourceType is case-sensitive and must start with a capital letter.
Note: To provide additional security, add the following response headers for each of the operations.