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.
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:
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
|
||
Set default property values
To select the Default Value Set for the property, click
|
||
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:
-
Go to BusinessWorks Studio and expand Processes.
-
Right-click your process, and then click New > BusinessWorks REST Resource.
-
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.
-
As per the operation type, enter the Nickname, Summary, and Notes fields.
Note: It is not mandatory to change the Request and Respond fields. -
Go to Modular Descriptions > Components and then select Process.
-
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. -
Under the FHIR Client palette of all four operations, double-click FHIRService.bwp and add the Resource Operations API activity.
-
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. -
Map the input tab with all the operations.
Note:- Input mappings for
postOut
,getOut
,putOut
anddeleteOut
is same.
- Map to item object as shown in the image.
deleteOut
has message object.
- Input mappings for
-
Map the
statusCode
of each operation to thestatusCode
under status object. -
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
-
After the application starts, run the BusinessWorks Rest Resource process and enter the
lrestdoc
command in the console. -
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:
-
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.
-
Select the Use HTTP Header and Use Custom Status Line checkboxes on the Response tab and then select the
JSON
andXML
format checkboxes. -
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:
-
Add
resourceId
,versionId
,resourceType
to Query Parameters and add Operation as a Header Parameter. -
Select the Use HTTP Header and Use Custom Status Line checkboxes on the Response tab, and then select the
JSON
andXML
format checkboxes. -
On the Response Status tab, add the HTTP status codes as shown in the following image.
resourceType
is case-sensitive and must start with a capital letter.
Creating Update (PUT) Operation
To create a Update(PUT) operation, follow these steps:
-
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.
-
Select the Use HTTP Header and Use Custom Status Line checkboxes on the Response tab and then select the JSON and XML format checkboxes.
-
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:
-
Add
resourceId
,resourceType
to the Query Parameters and add Operation as a Header Parameter. -
Select the Use HTTP Header and Use Custom Status Line checkboxes on the Response tab, and then select the
JSON
andXML
format checkboxes. -
Now add the HTTP status codes to the Response Status tab.
resourceType
is case-sensitive and must start with a capital letter. resourceType
is case-sensitive and must start with a capital letter.