This script computes the Performance Level for a Hazardous Event as a derived property in a HARA. It reads the severity, exposure, and controllability values and returns the corresponding Performance Level as a color-coded result from a (green, lowest) to e (red, highest).
To use this script, create a new derived property under Hazardous Event in your HARA, set the script language to JavaScript, and paste the script content into the derived property script editor. The Performance Level value will then be computed automatically for every Hazardous Event based on its S, E, and C values.
The logic is defined inside the getPLr function using nested switch statements, one level for severity, one for exposure, and one for controllability where needed. The script is designed to be customized easily, so you can change the combinations to match your case. The five color-coded levels (green, yellow, orange, lightRed, red) are defined as variables at the top of the script, so you can also adjust their RGB colors to match your own conventions. Any unrecognized S, E, or C value returns "-".