· Oct 6, 2022

What is the Analog of $DATA for Embedded Python?

Hi folks!

I'm working with a global via Embedded Python as a class method. I init the handler for a global via:


What is the way to check the value at index ^Global("x","y")? E.g.:

In ObjectScript I'd do the following:

set result=$data(^Global("x","y"))

How do I do the same in Embedded Python?

I checked the documentation, but haven't found an answer.

Product version: IRIS 2022.1
Discussion (4)2
Log in or sign up to continue

There's a method on the iris.gref class called "data".

set ^zJES(1)="$data = 1"
set ^zJES(2,0)="$data = 10"
set ^zJES(4) = ""
set ^zJES(4,0) = ""

The result ends up matching $data:

>>> glb = iris.gref("^zJES") 
>>> print(
>>> print([1])) 
>>> print([2]))
>>> print([3]))
>>> print([4]))

I found running help(iris) at the Python shell helpful for working this kind of stuff out.

Edit: Unlike @Robert Cemper's solution this does not return the value of the node we're testing (like the 2 parameter usage $data)