This article is part of the assessment builder guide. You will require administration access to view the pages mentioned in this article.
Although Trigger Scripting (Workflow Engine) is not covered here, below is some sample to code which creates an assessment on approval of the assessment that references this script.
Example: Upon approval of Assessment Assessment001, you want to create Assessment Assessment002.
Step 1: Create the Trigger Script
Trigger Class Details
Type: Assessment
Name: Create Assessment002 on Approval
Version: 1.0
Trigger Script
Trigger: After Approval
State: User Initiated
Name: Create Assessment
Version: 1.0
Order: 10
Code:
=====================================================
CODE
=====================================================
assessment.current_assessment.patient.add_assessment('[Assessment_Title]', undefined, {performed_by_user: current_user});
=====================================================
END OF CODE
=====================================================
Some example code is also below:
=====================================================
EXAMPLE CODE
=====================================================
assessment.current_assessment.patient.add_assessment('Assessment002', undefined, {performed_by_user: current_user});
=====================================================
END OF EXAMPLE CODE
=====================================================
Step 2: Reference the Trigger Script in the Assessment
When creating an assessment that requires another assessment to be created after it is approved, make sure under
Which trigger-able classes does this assessment support?
The trigger script you just created is ticked (e.g., Assessment001 will have trigger-able class Create Assessment002 on Approval ticked under its Assessment Details).
See New Assessment for details on creating a new assessment.