6: Create a Task That Re-Executes N Times
In this chapter you’ll further develop the Chemotherapy plan, so that it would take a clinician through 3 cycles of chemotherapy administration.
To download the process-description created in the previous chapter select File > Load Process Description From Web Repository. If you are logged in, the Load Process Description dialog appears; otherwise, you have to log in (if you don’t have a personal account, use the guest account: User Name = Guest; Password = testpass). Navigate to World\Tutorials and select and load Chapter05_create_a_task_that_runs_only_if_certain_conditions_are_met.
1. Add a Cycling Plan
Double-click the Chemotherapy plan in the network view to display its contents. It currently holds one task – the Baseline action.
Add a new plan to the Chemotherapy plan, and enter the following information:
Instance Name: | Chemo_x3_plan |
Caption: | Chemo x3 |
Cycle Number: | 3 |
While by default tasks are only enacted once and are than completed, the cycle attributes of a task can be modified to allow a task to re-execute.
The Chemo x3 plan will re-execute 3 times; it will become in progress after it completes its first and second cycles, and will remain in the completed state only after the third cycle. You will populate this plan later in this chapter.
Note: In the example above, the Chemo x3 plan is set to re-execute a fixed number of times. In certain situation the number of cycles is not predetermined, but rather dependent on factors such as the patient’s state. The Cycle Until field allows you to re-execute a task until a certain condition is met.
2. Add a Follow Up Action
Add a new action to the Chemotherapy plan, and enter the following information:
Instance Name: | Follow_up_action |
Caption: | Follow up |
Procedure: | Follow up the patient for six months |
3. Add Scheduling Constraints
Add a scheduling constraint so that:
- The Chemo x3 plan runs after the Baseline action completes
- The Follow up action runs after the Chemo x3 plan completes
4. Populate the Cycling Plan
The Chemo x3 plan will model three cycles of medication, each followed by a blood count.
Double-click the Chemo x3 plan in the network view to display its contents.
Medication Action
Add an action to the Chemo x3 plan and enter the following information:
Instance Name: | Chemo_medication_action |
Caption: | Chemo medication |
Procedure: | Please administer cytotoxics |
White Blood Cell Count Enquiry
Add an enquiry to the Chemo x3 plan and enter the following information:
Instance Name: | WBC_enquiry |
Caption: | White blood cell count |
Add a source to the enquiry by entering the following information in the Enquiry Specific Attributes panel:
Name: | WBC |
Caption: | Please enter the white blood count |
Data Type: | Integer |
Selection Mode: | Single-value |
Status: | Mandatory |
Don’t forget to click Add!
Scheduling Constraint
Add a scheduling constraint so that the White blood cell count enquiry runs after the Chemo medication action is completed.
5. Save the Process-Description
For more information about saving see Step 6 of Chapter 1.
6. Run the Process-Description in the Tallis Tester
For more information about running see Step 7 of Chapter 1.
Test what happens when the chemotherapy treatment is selected.
- Run the process-description to the point where the Cancer treatment decision is in progress.
- Select the Chemotherapy candidate and click Commit.
- The Cancer treatment decision completes; the Chemotherapy decision and the Baseline action become in progress.
- Select the Baseline action and confirm it.
- The Baseline action completes; both the Chemo x3 plan and the Chemo medication action become in progress.
- In the tree view, double-click the Chemo x3 plan to view the Plan Properties. The cycle number value is 1 (out of 3), as this is the plan’s first run.
- Select the Chemo medication action and confirm it.
- The Chemo medication action completes and the White blood cell count enquiry becomes in progress.
- The WBC source is requested. Enter a value for this source.
- The White blood cell count enquiry and the Chemo x3 plan both complete; but as the Chemo x3 plan immediately re-executes, it becomes in progress, and the White blood cell count enquiry goes back to being dormant.
- Display the Chemo x3 plan properties again. The cycle number is now 2.
- Continue running the process-description to the point where the Chemo x3 plan completes its third cycle. This time, the plan and its components remain in the completed state, and the Follow up action becomes in progress.
- Confirm the Follow up action.
- The process-description completes.
Exit the Tester before going on to the next chapter.