Question
· Jul 16

How to resync ^ROUTINE and ^rINDEX?

I have a few routines in ^rINDEX that are missing in ^ROUTINE. At least some of those routines lack a timestamp, probably Date and Time Modified in ^rINDEX. It causes D %RO crash when such a routine is referenced by a routine range, since "" is an illegal $ZDTH value.

Healthy entry (note the timestamp): ^rINDEX("ABC,"INT")    =    $lb("2021-06-15 15:08:38.846885",)   ;The second argument is sometimes present and sometimes not, likely the routine size.

Unhealthy entry (note an empty timestamp): ^rINDEX("DEF,"INT")    =    $lb("",21) 

Finally, a question, not only for this situation. Is there an official, or a recommended way to rebuild rINDEX, maybe ^ROUTINE too. rINDEX has quite a few various purpose nodes, so it's probably not as straightforward as creating or deleting its nodes above based on ^ROUTINE entries.

Product version: Caché 2017.1
Discussion (3)2
Log in or sign up to continue

I rebuild ^rINDEX using, as recommended, D ##class(%Library.RoutineIndex).RebuildIndex($NAMESPACE). That reduced the number of ^rINDEX entries with an empty Date Modified, the cause of the $RO error. However, this function is partially based on ^ROUTINE which in its turn had bogus entries, all of the type ^ROUTINE("ABC",0,"SIZE")=<some integer>. That’s all these routines contain. I killed these ^ROUTINE nodes and rebuilt ^rINDEX. No empty Date Modified.