Written by

Technical Consultant at Traverse Health
Question Muhammad Waseem · Jun 22, 2021

Generation of FHIR bundle id (GUID) from object script

Hi,

Is there any functionality available to generate FHIR bundle id (GUID)?

Thanks
 

Product version: IRIS 2020.1

Comments

Tani Frankel · Jun 23, 2021

If you are creating a FHIR Bundle manually (programmatically; as opposed for example of just getting a Bundle back as a search result response from our built-in FHIR Resource Repository) I think you should be using HS.FHIRServer.Util.Bundle:CreateBundle().

Indeed behind the scenes you can see it calls the CreateGUID() method @Marc Mundt pointed to populate the id -

Set bundle.id = $ZConvert($SYSTEM.Util.CreateGUID(),"L")

[The $ZConvert changes it to lower-case, e.g.:

USER>set guid = $SYSTEM.Util.CreateGUID()
 
USER>write guid
B990B74D-C008-4F4D-BA3B-4247A740250A
USER>write $ZConvert(guid,"L")
b990b74d-c008-4f4d-ba3b-4247a740250a

]

0