Generation of FHIR bundle id (GUID) from object script
Hi,
Is there any functionality available to generate FHIR bundle id (GUID)?
Thanks
Comments
ObjectScript includes utilities for generating GUIDs:
https://docs.intersystems.com/irisforhealthlatest/csp/docbook/DocBook.U…
In particular, have a look at $System.Util.CreateGUID():
https://docs.intersystems.com/irisforhealthlatest/csp/documatic/%25CSP…
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]
Thanks @Tani Frankel