Written by

Question Mark OReilly · Aug 24, 2022

Get Data from global node after using $Query

I am using $Query to loop through a global. 

When I use $GET to get the data all we get back is the global name. 

How do you get the value of the global after you have looped. 

Below is my example in terminal. 

Thank you in advance 

Set node = $Query(^FromExtraMed("")) 

w node
^FromExtraMed("A02",9220)

If i try w $GET(node) it returns 

^FromExtraMed("A02",9220)

If i had this hardcoded it would have got the value

w $GET(^FromExtraMed("A02",9220))
0,66340,2120

I have already read the documentation and it is not clear. Can someone advise? 

Product version: IRIS 2022.1

Comments

Mark OReilly  Aug 24, 2022 to Eduard Lebedyuk

Thanks didn't see that 

have changed to the below which works from your answer

Set node = $Query(^FromExtraMed(""),1,nodevalue)

 while (node '="")
 {
 write nodevalue,!

 Set node = $Query(@node,1,nodevalue)

}

0
Udo Leimberger · Aug 24, 2022

As Eduard mentioned — use the optional target parameter to get the value .. or use $O  

0
Robert Cemper · Aug 24, 2022

2 mistakes: 
#1^$get(node) delivers the content of variable node
but you would expect the result of $get(@node)  using node as global reference

#2) the better way is to use the implicit GET
Set node = $Query(^FromExtraMed(""),1,value)
write value  

0
Antoni Peña · Aug 25, 2022

Hi,

You can try:

write $get(@node)

0,66340,2120

Regards, Toni Peña

0