BGUGUTL ; IHS/OIT/MJL - GENERAL UTILITIES FOR GUI LOGOFF ;
;;1.5;BGU;;MAY 26, 2005
LOG(DUZ,BGUIP,BGUSKT,BGUETH,BGUAPP,BGUPRM) ;EP Called by BGUTCPH
;Creates da for statistic tracking entry at logoff
N I,DA,DIK
S I=$$HTFM^XLFDT($H)
F I=I:.000001 L +^BGUSEC(I):1 Q:'$D(^BGUSEC(I)) L -^BGUSEC(I)
S ^BGUSEC(I,0)=DUZ_"^"_$I_"^"_$J_"^^"_BGUIP_"^"_BGUAPP_"^"_BGUSKT_"^"_BGUETH_"^^"_BGUPRM
L -^BGUSEC(I)
S $P(^BGUSEC(0),"^",3,4)=I_"^"_(1+$P(^BGUSEC(0),"^",4))
S DA=I,DIK="^BGUSEC(" D IX^DIK
Q I
BGUGUTL ; IHS/OIT/MJL - GENERAL UTILITIES FOR GUI LOGOFF ;
+1 ;;1.5;BGU;;MAY 26, 2005
LOG(DUZ,BGUIP,BGUSKT,BGUETH,BGUAPP,BGUPRM) ;EP Called by BGUTCPH
+1 ;Creates da for statistic tracking entry at logoff
+2 NEW I,DA,DIK
+3 SET I=$$HTFM^XLFDT($HOROLOG)
+4 FOR I=I:.000001
LOCK +^BGUSEC(I):1
IF '$DATA(^BGUSEC(I))
QUIT
LOCK -^BGUSEC(I)
+5 SET ^BGUSEC(I,0)=DUZ_"^"_$IO_"^"_$JOB_"^^"_BGUIP_"^"_BGUAPP_"^"_BGUSKT_"^"_BGUETH_"^^"_BGUPRM
+6 LOCK -^BGUSEC(I)
+7 SET $PIECE(^BGUSEC(0),"^",3,4)=I_"^"_(1+$PIECE(^BGUSEC(0),"^",4))
+8 SET DA=I
SET DIK="^BGUSEC("
DO IX^DIK
+9 QUIT I