Get concrete class from id

Primary tabs

I have one abstract class and several subclasses. All share one data/id global.

How can I get concrete class name from id (without opening the object)?

What I have so far:

write $p($lg(^DATAGLOBAL(<id>),1),"~",*-1)

It does the job, but is there a more official way?

  • 0
  • 0
  • 145
  • 1
  • 2


I just realized that this method doesn't check the existence of the ID.


write:##class(Abstract.Class).%ExistsId(id) $li(##class(Abstract.Class).%ComposeOid(id),2)

or any equivalent construct.

OID contains the class name. So this should do it.

write $li(##class(Abstract.Class).%ComposeOid(id),2)