XQA366PO ;ISC-SF.SEA/JLI - POST INSTALL FOR SURROGATES FOR ALERTS ;9/6/05 14:35
;;8.0;KERNEL;**366**;Jul 10, 1995
;;
; go through alert file and convert any current surrogates to active entries in surrogate multiple
N XQAI,XQANOW,X0
S XQANOW=$$NOW^XLFDT()
F XQAI=0:0 S XQAI=$O(^XTV(8992,XQAI)) Q:XQAI'>0 S X0=$G(^(XQAI,0)) S:X0="" ^XTV(8992,XQAI,0)=XQAI D
. N XQALSURO,XQALSTRT,XQALEND
. S XQALSURO=$P(X0,U,2),XQALSTRT=$P(X0,U,3),XQALEND=$P(X0,U,4)
. I XQALSURO="" Q
. I $D(^XTV(8992,XQAI,2)) Q
. N XQAIENS,XQAFDA
. I XQALSTRT="" S XQALSTRT=XQANOW,XQAFDA(8992,XQAI_",",.03)=XQANOW D FILE^DIE("","XQAFDA") K XQAFDA
. S XQAIENS="+1,"_XQAI_",",XQAFDA(8992.02,XQAIENS,.01)=XQALSTRT
. S XQAFDA(8992.02,XQAIENS,.02)=XQALSURO
. I XQALEND'="" S XQAFDA(8992.02,XQAIENS,.03)=XQALEND
. I XQALSTRT'>XQANOW S XQAFDA(8992.02,XQAIENS,.04)=1
. D UPDATE^DIE("","XQAFDA")
. Q
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HXQA366PO 901 printed Nov 22, 2024@17:15:25 Page 2
XQA366PO ;ISC-SF.SEA/JLI - POST INSTALL FOR SURROGATES FOR ALERTS ;9/6/05 14:35
+1 ;;8.0;KERNEL;**366**;Jul 10, 1995
+2 ;;
+3 ; go through alert file and convert any current surrogates to active entries in surrogate multiple
+4 NEW XQAI,XQANOW,X0
+5 SET XQANOW=$$NOW^XLFDT()
+6 FOR XQAI=0:0
SET XQAI=$ORDER(^XTV(8992,XQAI))
if XQAI'>0
QUIT
SET X0=$GET(^(XQAI,0))
if X0=""
SET ^XTV(8992,XQAI,0)=XQAI
Begin DoDot:1
+7 NEW XQALSURO,XQALSTRT,XQALEND
+8 SET XQALSURO=$PIECE(X0,U,2)
SET XQALSTRT=$PIECE(X0,U,3)
SET XQALEND=$PIECE(X0,U,4)
+9 IF XQALSURO=""
QUIT
+10 IF $DATA(^XTV(8992,XQAI,2))
QUIT
+11 NEW XQAIENS,XQAFDA
+12 IF XQALSTRT=""
SET XQALSTRT=XQANOW
SET XQAFDA(8992,XQAI_",",.03)=XQANOW
DO FILE^DIE("","XQAFDA")
KILL XQAFDA
+13 SET XQAIENS="+1,"_XQAI_","
SET XQAFDA(8992.02,XQAIENS,.01)=XQALSTRT
+14 SET XQAFDA(8992.02,XQAIENS,.02)=XQALSURO
+15 IF XQALEND'=""
SET XQAFDA(8992.02,XQAIENS,.03)=XQALEND
+16 IF XQALSTRT'>XQANOW
SET XQAFDA(8992.02,XQAIENS,.04)=1
+17 DO UPDATE^DIE("","XQAFDA")
+18 QUIT
End DoDot:1
+19 QUIT