BEHOXQIN ;MSC/IND/DKM - Installation Support ;27-Jan-2011 22:35;PLS
;;1.1;BEH COMPONENTS;**002003,002005**;Mar 20, 2007
;=================================================================
PRE ;EP - Preinitialization
N IEN
S IEN=$$PRGID^CIAVMCFG("BEHNOTIFICATIONS.NOTIFICATIONS")
I IEN D
.K ^CIAVOBJ(19930.2,IEN,5)
Q
POST ;EP - Postinitialization
;D FIXALRTS
Q
; Fix bad ALERT file entries
FIXALRTS ; EP
N USR,ADT,CNT
D BMES^XPDUTL("Checking ALERT file for corrupted entries...")
S (CNT,USR)=0
F S USR=$O(^XTV(8992,USR)) Q:USR<.1 D
.I $D(^XTV(8992,USR,"XQA",0))#2,'$P(^(0),U,2) S $P(^(0),U,2)="8992.01DA" D
..D MES^XPDUTL(" Fixed bad subfile header for user #"_USR)
..S CNT=CNT+1
.S ADT=0
.F S ADT=$O(^XTV(8992,USR,"XQA",ADT)) Q:ADT<1 D:'$D(^(ADT,0))
..K ^XTV(8992,USR,"XQA",ADT)
..D MES^XPDUTL(" Removed bad subfile entry for user #"_USR)
..S CNT=CNT+1
D MES^XPDUTL(" Checking complete. Bad entries corrected: "_CNT)
Q
BEHOXQIN ;MSC/IND/DKM - Installation Support ;27-Jan-2011 22:35;PLS
+1 ;;1.1;BEH COMPONENTS;**002003,002005**;Mar 20, 2007
+2 ;=================================================================
PRE ;EP - Preinitialization
+1 NEW IEN
+2 SET IEN=$$PRGID^CIAVMCFG("BEHNOTIFICATIONS.NOTIFICATIONS")
+3 IF IEN
Begin DoDot:1
+4 KILL ^CIAVOBJ(19930.2,IEN,5)
End DoDot:1
+5 QUIT
POST ;EP - Postinitialization
+1 ;D FIXALRTS
+2 QUIT
+3 ; Fix bad ALERT file entries
FIXALRTS ; EP
+1 NEW USR,ADT,CNT
+2 DO BMES^XPDUTL("Checking ALERT file for corrupted entries...")
+3 SET (CNT,USR)=0
+4 FOR
SET USR=$ORDER(^XTV(8992,USR))
IF USR<.1
QUIT
Begin DoDot:1
+5 IF $DATA(^XTV(8992,USR,"XQA",0))#2
IF '$PIECE(^(0),U,2)
SET $PIECE(^(0),U,2)="8992.01DA"
Begin DoDot:2
+6 DO MES^XPDUTL(" Fixed bad subfile header for user #"_USR)
+7 SET CNT=CNT+1
End DoDot:2
+8 SET ADT=0
+9 FOR
SET ADT=$ORDER(^XTV(8992,USR,"XQA",ADT))
IF ADT<1
QUIT
IF '$DATA(^(ADT,0))
Begin DoDot:2
+10 KILL ^XTV(8992,USR,"XQA",ADT)
+11 DO MES^XPDUTL(" Removed bad subfile entry for user #"_USR)
+12 SET CNT=CNT+1
End DoDot:2
End DoDot:1
+13 DO MES^XPDUTL(" Checking complete. Bad entries corrected: "_CNT)
+14 QUIT