Written by

Application Development Advisor – Clinical IT at Cigna
Question Cedric Daniels · Oct 16, 2023

creating a random token in Health Connect

How can we create a random token within HealthConnect?  any examples?

Product version: IRIS 2022.1
$ZV: IRIS for UNIX (Red Hat Enterprise Linux 7 for x86-64) 2022.1 (Build 209U) Tue May 31 2022 12:13:58 EDT [HealthConnect:3.5.0] [HealthConnect:3.5.0]

Comments

Shanshan Yu · Oct 16, 2023

HI,

Perhaps the following methods can be considered

w ##class(%SYSTEM.Util).CreateGUID()

w $system.Encryption.GenCryptToken()

w  $system.Encryption.GenCryptRand(20,0)

 w $system.Encryption.Base64Encode($system.Encryption.GenCryptRand(20,0),1)

0
Ilenia Centonze · Oct 17, 2023

I usually use this for FHIR resource id, it is a global unique uid and lower case: 

w $zconvert($system.Util.CreateGUID(),"l") 

0