On this page:

30.0JavaScript Execution Environment

Smile CDR 2020.08 replaced the nashorn JavaScript engine with graal-js. The nashorn JavaScript engine is no longer supported. Oracle has deprecated nashorn and will remove it from a future release of the JDK. The graal-js JavaScript engine supports ECMAScript 2020. This means that many ECMAScript features that were not available in previous versions of Smile CDR are now supported. However, it also means that you may need to make some changes to your Smile CDR JavaScript code. Here are some known changes you need to make:
  • When working with resource elements that have cardinality, indexes are now required: replace patient.name.family with patient.name[0].family
  • replace string.contains('foo') with string.includes('foo')
  • replace string.replaceAll('foo', 'bar') with string.split('foo').join('bar')
  • replace string.regionMatches(true, 0, 'foo', 0, 3) with .substring(0, 3).toUpperCase() === 'foo'
  • when comparing strings, change == to ===

This section describes the standard objects available to JavaScript callbacks executing in the Smile CDR JavaScript execution environment.