Smile CDR v2023.08.PRE
On this page:

36.0JavaScript Execution Environment

 

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

Callbacks

Here is the current list of JavaScript callbacks available in Smile CDR

ModuleConfigFunction(s)
Channel Importetl_script.texthandleChannelImportJsonPayload(...)
handleChannelImportStringPayload(...)
FHIR Endpointconsent_service.script.textconsentStartOperation(...)
consentCanSeeResource(...)
consentWillSeeResource(...)
completeOperationSuccess(...)
completeOperationFailure(...)
HL7 v2.x Listening Endpointlistener_script.textonPreConvertHl7V2ToFhir(...)
onPostConvertHl7V2ToFhir(...)
HL7 v2.x Sending Endpointmapper_script.textonPostConvertFhirToHl7V2(...)
FHIR Storagecallback_script.textfhirResourcePreCreate(...)
fhirResourceCreated(...)
fhirResourcePreUpdate(...)
fhirResourceUpdated(...)
fhirResourcePreDelete(...)
fhirResourceDeleted(...)
FHIR Storagejavascript_repository_validation.script.textrepositoryValidationProvideRules(...)
FHIR Storagelivebundle_service.script.textbuildLiveBundleRuleSet()
MDMsurvivorship_script.textmdmApplySurvivorshipRules(...)
MDMkey_interceptor_script.textmdmGenerateMessageKey(...)
Local Inbound Securitycallback_script.textonAuthenticateSuccess(...)
Local Inbound Securityuser_self_registration.create_script.textonUserSelfRegistrationRequest(...)
Scripted Inbound Securityscript.textauthenticate(...)
Smart Outbound Securitycodap.auth_script.textauthenticate(...)
Smart Outbound Securitypost_authorize_script.textonAuthenticateSuccess(...)
authenticate(...)
onSmartLoginPreContextSelection(...)
onTokenGenerating(...)
onPostAuthorize(...)
Cda Exchangecda_processing_script.textonPreImportCDA(...)
onPostImportCDA(...)
onPostExportCDA(...)

36.0.1Change Log

 

Smile CDR 2022.05

  • Javascript engine upgraded from ECMAScript 2020 (11th edition) to ECMAScript 2021 (12th edition).
  • Added support for JavaScript Remote Debugging

Smile CDR 2020.08

  • Javascript engine upgraded to ECMAScript 2020.
  • JavaScript engine upgraded from nashorn to 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 ===