ScriptUtil provides miscellaneous functions that allow you to simplify your scripts and support special use-cases. ScriptUtil is bound to all script session contexts, so you can use these functions in tablet rules or within eForms (show if, make note if, etc.).
Variable(s) | Description & Example Expression |
---|---|
sum, max, min |
Returns the sum/max/min of point values in the section
Copy Example |
countAnswersMatching, countAnswersWithPointsEqualTo |
The number of answers matching the value or point value in the specified section
Copy Example |
percentComplete |
Returns a number between 0 and 100 representing the number of completed items in a section (including nested sections)
Copy Example |
getKeyword |
Provides access to any keyword. Used for CPP access and a ‘catch-all’ for access to patient information.
Copy Example |
getResponse |
Provides access to an answer provided on a previous EForm in the same session.
Copy Example |
queueContains (supported on Ocean Tablet only) |
Returns true if the form queue (or completed forms) contains the ref passed in.
Copy Example |
queueSize (supported on Ocean Tablet only) |
Returns the number of forms in the queue plus any forms that have already been completed.
Copy Example |
parseDate |
Accepts a date string in "yyyy-mm-dd" format and returns a Javascript Date (tablet v127+)
Copy Example |
webQ |
Displays sections or items for web questionnaires only, not tablets.
Copy Example |
walkIn |
Returns true for walk-in patients (tablet v178+).
Copy Example |