...
Formal Expression Dev Tooling in ClinSpark
Note that this tooling was introduced in ClinSpark 1.5.2.
To support self-serve formal expression development and testing by customers, an embedded editor and test execution harness has been added to exists within ClinSpark. Here is where it can be accessed:
...
Info |
---|
This tooling applies to |
...
both Methods and Edit Checks. You will see that the same test harness is present in the editing UI for both of these features. |
Here is an overview of the editor and testing harness:
...
Define variables up top to support reusability across studies. See the examples in the Method Library section of this help site.
Errors/warnings in the Formal Expressions syntax checker
The syntax checker by default validates code as “strict mode” JavaScript. If the JavaScript code is not marked 'use strict'
at the start of the file, you may get an error saying:"Too many errors. (nn% Scanned)"
...
There are two ways to fix this.
1, Tell the syntax checker you are not using strict mode, paste this at the first line:/* jshint strict: false */
2, If you want to write JavaScript in strict mode, and get strict mode syntax checking, paste this in the first two lines:/* globals itemJson, formJson, findFormData, logger, customErrorMessage, findCompletedFormData, findFormData, getItemDataContext */
'use strict'
If you are using other implicit data/methods not included here and get “undefined variable” errors in those lines, add those variables/functions to the list of “globals”.
The list is needed because the editor would flag our implicit methods and implicit data as undefined variables.