ENX5IP ;WCIOFO/SAB-INSTALL ROUTINE;5/8/1998
;;7.0;ENGINEERING;**53**;AUG 17, 1993
; This routine can be deleted after patch EN*7*53 has been installed
Q
;
PRE ;Pre-Install Steps
; delete PRIMARY TECH ASSIGNED field so "AD" x-ref can be removed.
S DIK="^DD(6920,",DA=16,DA(1)=6920 D ^DIK
Q
;
PST ;Post-Install Steps
; create KIDS checkpoints with call backs
N ENX
F ENX="AINC","WO" D
. S Y=$$NEWCP^XPDUTL(ENX,ENX_"^ENX5IP")
. I 'Y D BMES^XPDUTL("ERROR Creating "_ENX_" Checkpoint.")
Q
;
AINC ; post-install checkpoint
; check AINC x-ref entries and remove from x-ref as necessary
N ENC,ENDA,ENRDA,ENSHOP
D BMES^XPDUTL(" Examining the incomplete work order (AINC) x-ref")
D MES^XPDUTL(" and removing inappropriate entries as necessary...")
S (ENC("INC"),ENC("BAD"))=0
; loop thru shop in x-ref
S ENSHOP=0 F S ENSHOP=$O(^ENG(6920,"AINC",ENSHOP)) Q:'ENSHOP D
. ; loop thru 'reverse' iens under shop
. S ENRDA=0 F S ENRDA=$O(^ENG(6920,"AINC",ENSHOP,ENRDA)) Q:'ENRDA D
. . S ENC("INC")=ENC("INC")+1
. . S ENBAD=0 ; init flag, true if x-ref should be deleted
. . S ENDA=9999999999-ENRDA ; determine work order ien
. . I $P($G(^ENG(6920,ENDA,5)),U,2) S ENBAD=1 ; work order complete
. . I ENSHOP'=$P($G(^ENG(6920,ENDA,2)),U) S ENBAD=1 ; wrong shop
. . I ENBAD S ENC("BAD")=ENC("BAD")+1 K ^ENG(6920,"AINC",ENSHOP,ENRDA)
D MES^XPDUTL(" "_$FN(ENC("INC"),",")_" entries were processed.")
D MES^XPDUTL(" "_$S(ENC("BAD")=0:"None",1:$FN(ENC("BAD"),","))_" of the entries had to be removed from the AINC x-ref.")
Q
;
WO ; post-install checkpoint
; check work orders and add to AINC x-ref as necessary
N ENC,ENDA,ENRDA,ENSHOP
D BMES^XPDUTL(" Checking all work orders and adding incomplete work")
D MES^XPDUTL(" orders to the AINC x-ref as necessary...")
S XPDIDTOT=+$P($G(^ENG(6920,0)),U,4) ; set total for status bar
S (ENC("ADD"),ENC("INC"),ENC("WO"))=0
S ENDA=0 F S ENDA=$O(^ENG(6920,ENDA)) Q:'ENDA D
. I '$D(^ENG(6920,ENDA,0)) K ^ENG(6920,ENDA) Q ; invalid data
. S ENC("WO")=ENC("WO")+1
. I '(ENC("WO")#1000) D UPDATE^XPDID(ENC("WO")) ; update status bar
. Q:$P($G(^ENG(6920,ENDA,5)),U,2)]"" ; completed work order
. S ENC("INC")=ENC("INC")+1
. S ENSHOP=$P($G(^ENG(6920,ENDA,2)),U)
. Q:ENSHOP="" ; missing shop
. S ENRDA=9999999999-ENDA
. I '$D(^ENG(6920,"AINC",ENSHOP,ENRDA)) S ENC("ADD")=ENC("ADD")+1
. S ^ENG(6920,"AINC",ENSHOP,ENRDA)=""
;
; update count of w.o. in file header (if necessary)
I XPDIDTOT'=ENC("WO") S $P(^ENG(6920,0),U,4)=ENC("WO")
D MES^XPDUTL(" "_$FN(ENC("WO"),",")_" work orders were processed.")
D MES^XPDUTL(" "_$FN(ENC("INC"),",")_" incomplete work orders were found.")
D MES^XPDUTL(" "_$S(ENC("ADD")=0:"None",1:$FN(ENC("ADD"),","))_" of the work orders had to be added to the AINC x-ref.")
Q
;
;ENX5IP
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HENX5IP 2866 printed Oct 16, 2024@17:57:25 Page 2
ENX5IP ;WCIOFO/SAB-INSTALL ROUTINE;5/8/1998
+1 ;;7.0;ENGINEERING;**53**;AUG 17, 1993
+2 ; This routine can be deleted after patch EN*7*53 has been installed
+3 QUIT
+4 ;
PRE ;Pre-Install Steps
+1 ; delete PRIMARY TECH ASSIGNED field so "AD" x-ref can be removed.
+2 SET DIK="^DD(6920,"
SET DA=16
SET DA(1)=6920
DO ^DIK
+3 QUIT
+4 ;
PST ;Post-Install Steps
+1 ; create KIDS checkpoints with call backs
+2 NEW ENX
+3 FOR ENX="AINC","WO"
Begin DoDot:1
+4 SET Y=$$NEWCP^XPDUTL(ENX,ENX_"^ENX5IP")
+5 IF 'Y
DO BMES^XPDUTL("ERROR Creating "_ENX_" Checkpoint.")
End DoDot:1
+6 QUIT
+7 ;
AINC ; post-install checkpoint
+1 ; check AINC x-ref entries and remove from x-ref as necessary
+2 NEW ENC,ENDA,ENRDA,ENSHOP
+3 DO BMES^XPDUTL(" Examining the incomplete work order (AINC) x-ref")
+4 DO MES^XPDUTL(" and removing inappropriate entries as necessary...")
+5 SET (ENC("INC"),ENC("BAD"))=0
+6 ; loop thru shop in x-ref
+7 SET ENSHOP=0
FOR
SET ENSHOP=$ORDER(^ENG(6920,"AINC",ENSHOP))
if 'ENSHOP
QUIT
Begin DoDot:1
+8 ; loop thru 'reverse' iens under shop
+9 SET ENRDA=0
FOR
SET ENRDA=$ORDER(^ENG(6920,"AINC",ENSHOP,ENRDA))
if 'ENRDA
QUIT
Begin DoDot:2
+10 SET ENC("INC")=ENC("INC")+1
+11 ; init flag, true if x-ref should be deleted
SET ENBAD=0
+12 ; determine work order ien
SET ENDA=9999999999-ENRDA
+13 ; work order complete
IF $PIECE($GET(^ENG(6920,ENDA,5)),U,2)
SET ENBAD=1
+14 ; wrong shop
IF ENSHOP'=$PIECE($GET(^ENG(6920,ENDA,2)),U)
SET ENBAD=1
+15 IF ENBAD
SET ENC("BAD")=ENC("BAD")+1
KILL ^ENG(6920,"AINC",ENSHOP,ENRDA)
End DoDot:2
End DoDot:1
+16 DO MES^XPDUTL(" "_$FNUMBER(ENC("INC"),",")_" entries were processed.")
+17 DO MES^XPDUTL(" "_$SELECT(ENC("BAD")=0:"None",1:$FNUMBER(ENC("BAD"),","))_" of the entries had to be removed from the AINC x-ref.")
+18 QUIT
+19 ;
WO ; post-install checkpoint
+1 ; check work orders and add to AINC x-ref as necessary
+2 NEW ENC,ENDA,ENRDA,ENSHOP
+3 DO BMES^XPDUTL(" Checking all work orders and adding incomplete work")
+4 DO MES^XPDUTL(" orders to the AINC x-ref as necessary...")
+5 ; set total for status bar
SET XPDIDTOT=+$PIECE($GET(^ENG(6920,0)),U,4)
+6 SET (ENC("ADD"),ENC("INC"),ENC("WO"))=0
+7 SET ENDA=0
FOR
SET ENDA=$ORDER(^ENG(6920,ENDA))
if 'ENDA
QUIT
Begin DoDot:1
+8 ; invalid data
IF '$DATA(^ENG(6920,ENDA,0))
KILL ^ENG(6920,ENDA)
QUIT
+9 SET ENC("WO")=ENC("WO")+1
+10 ; update status bar
IF '(ENC("WO")#1000)
DO UPDATE^XPDID(ENC("WO"))
+11 ; completed work order
if $PIECE($GET(^ENG(6920,ENDA,5)),U,2)]""
QUIT
+12 SET ENC("INC")=ENC("INC")+1
+13 SET ENSHOP=$PIECE($GET(^ENG(6920,ENDA,2)),U)
+14 ; missing shop
if ENSHOP=""
QUIT
+15 SET ENRDA=9999999999-ENDA
+16 IF '$DATA(^ENG(6920,"AINC",ENSHOP,ENRDA))
SET ENC("ADD")=ENC("ADD")+1
+17 SET ^ENG(6920,"AINC",ENSHOP,ENRDA)=""
End DoDot:1
+18 ;
+19 ; update count of w.o. in file header (if necessary)
+20 IF XPDIDTOT'=ENC("WO")
SET $PIECE(^ENG(6920,0),U,4)=ENC("WO")
+21 DO MES^XPDUTL(" "_$FNUMBER(ENC("WO"),",")_" work orders were processed.")
+22 DO MES^XPDUTL(" "_$FNUMBER(ENC("INC"),",")_" incomplete work orders were found.")
+23 DO MES^XPDUTL(" "_$SELECT(ENC("ADD")=0:"None",1:$FNUMBER(ENC("ADD"),","))_" of the work orders had to be added to the AINC x-ref.")
+24 QUIT
+25 ;
+26 ;ENX5IP