Step 3: Define optional events for the DCR widget

The DCR widget is completely functional for business users to view records when the two provided code blocks from Network have been added to your internal application. However, events can be defined to customize the behavior of the widget to meet your business needs. Web developers can define events which return a JSON response so you can use the data in your downstream systems.

Events are triggered when users perform an action in the DCR widget.

Data change request events

To support change requests, optional events can be defined so the task information is returned so it can be stored in your downstream system. Additionally, if users add or edit addresses in the change request, those updates can be immediately available to action from your internal application.

The events are triggered when users click the Submit button to send the changes.

By default, when users click the button, change requests are routed to data stewards to validate. After the change request is processed, the record is updated in your Network instance.

Event: dcr-presubmit

The dcr-presubmit event provides the data from the change request. This includes the creator (user that submitted the add request), the comments from the Notes section, and all of the new field values that the user provided for the record and the associated sub-objects (addresses, licenses, parent HCO affiliations). When users click Submit, a JSON response can return this data so it can be stored in your downstream system.

Event: dcr-submitted

The dcr-submitted event provides the task ID in a JSON response for the submitted change request.

Event: select

Define the select event so users can immediately action any updates that they made to addresses in the change requests. When users click Submit, the event triggers and a JSON returns the entire record including the updated addresses. Web developers can use the JSON from the event so the updates can be immediately added to your internal application. This enables users to immediately take action on new addresses created for the instance. Any new addresses created from the DCR widget will have a record state of under review until data stewards validate the changes.

 

< Step 2: Embed the DCR widget Developers: Configure your web application >