ENEQTD ;WIRMFO/SAB-TURN-IN/DISPOSITION EQUIPMENT RECORDS ;2.12.97
;;7.0;ENGINEERING;**35**;Aug 17, 1993
TD ; turn-in/disposition non-capitalized equipment record
K ENDL S $P(ENDL,"-",80)=""
;
TDEQ ; select equipment
W ! D GETEQ^ENUTL G:Y'>0 TDEXIT S ENDA=+Y
;
I +$$CHKFA^ENFAUTL(ENDA) D G TDEQ
. W $C(7),!,"Can't proceed. Item is currently reported to FAP."
. W !,"Use the Disposition an Asset (FD Document) option."
;
I $P($G(^ENG(6914,ENDA,0)),U,4)="NX",'$D(^XUSEC("ENEDNX",DUZ)) D G TDEQ
. W $C(7),!,"Security Key ENEDNX is required to edit NX equipment."
;
F ENI=0,1 S ENY(ENI)=$G(^ENG(6914,ENDA,ENI))
W !,ENDL
W !,"Entry #: ",ENDA,?21,"Mfg. Name: ",$E($P(ENY(0),U,2),1,40)
W !,"Mfg: ",$$GET1^DIQ(6914,ENDA,1)
W !,"Mod: ",$P(ENY(1),U,2),?40,"Ser #: ",$P(ENY(1),U,3)
W !,"Cat: ",$$GET1^DIQ(6914,ENDA,6)
W ?57,"Acq Date: ",$$GET1^DIQ(6914,ENDA,13)
W !,ENDL
;
S DIR(0)="SA^T:TURN-IN;D:FINAL DISPOSITION"
S DIR("A")="Select TURN-IN or FINAL DISPOSITION (enter '^' to quit): "
D ^DIR K DIR G:$D(DIRUT) TDEXIT
S ENTASK=Y
; check for unprocessed components, if any found give option to stop
I $O(^ENG(6914,"AE",ENDA,0)) D G:ENTASK="" TDEQ
. N ENCY,ENX
. W !!," This is the parent system for some equipment items."
. W !," Components without "_$S(ENTASK="T":"either a turn-in or ",1:"")_"disposition date are shown below:"
. S ENI=0,ENX="" F S ENI=$O(^ENG(6914,"AE",ENDA,ENI)) Q:'ENI D
. . S ENCY(3)=$G(^ENG(6914,ENI,3))
. . I ENTASK="D",$P(ENCY(3),U,11)]"" Q
. . I ENTASK="T",$P(ENCY(3),U,11)]""!($P(ENCY(3),U,3)]"") Q
. . I $L(ENX)+$L(ENI)>70 W !,?4,ENX_"," S ENX=ENI
. . E S ENX=ENX_$S(ENX]"":", ",1:"")_ENI
. I ENX']"" W !,?4,"None found" Q
. W !,?4,ENX,! D
. . S DIR("0")="Y",DIR("B")="NO"
. . S DIR("A")="Continue with "_$S(ENTASK="T":"Turn-In",1:"Final Disposition")_" of Parent System"
. . D ^DIR K DIR S:'Y ENTASK=""
;
TDEDIT ; edit equipment
W !!,"Note: Some data fields are automatically modified."
S ENCONTR=$P($G(^ENG(6914,ENDA,7)),U)
S DIE="^ENG(6914,",DA=ENDA
S:ENTASK="T" DR=$S($D(^DIE("B","ENZEQTURN")):"[ENZ",1:"[EN")_"EQTURN]"
S:ENTASK="D" DR=$S($D(^DIE("B","ENZEQDISP")):"[ENZ",1:"[EN")_"EQDISP]"
D ^DIE
;
W !!,"Checking for inconsistencies..."
S ENOK=1 F ENI=2,3 S ENY(ENI)=$G(^ENG(6914,ENDA,ENI))
I ENTASK="D","^10^23^70^"[(U_$E($$GET1^DIQ(6914,ENDA,18),1,2)_U),$P(ENY(3),U,11)="",$P(ENY(2),U,9)="" D
. W !," Accountable NX has both DISPOSITION DATE and CMR blank."
. S ENOK=0
I $P(ENY(3),U)>3,$P(ENY(3),U)<6,$P(ENY(3),U,3)="",$P(ENY(3),U,11)="" D
. W !," Either TURN-IN DATE or DISPOSITION DATE should be entered"
. W !," when USE STATUS = ",$$EXTERNAL^DILFD(6914,20,"",$P(ENY(3),U))
I 'ENOK D G:$D(DIRUT) TDEXIT G:Y TDEDIT
. S DIR(0)="Y",DIR("A")="Do you want to re-edit the equipment item"
. S DIR("B")="YES"
. W ! D ^DIR K DIR
I ENOK W "OK"
G TDEQ
TDEXIT ;
K DA,DIC,DIE,DIROUT,DIRUT,DR,DTOUT,DUOUT,X,Y
K ENCONTR,ENDA,ENDL,ENI,ENOK,ENTASK,ENY
Q
;ENEQTD
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HENEQTD 3027 printed Oct 16, 2024@17:53:57 Page 2
ENEQTD ;WIRMFO/SAB-TURN-IN/DISPOSITION EQUIPMENT RECORDS ;2.12.97
+1 ;;7.0;ENGINEERING;**35**;Aug 17, 1993
TD ; turn-in/disposition non-capitalized equipment record
+1 KILL ENDL
SET $PIECE(ENDL,"-",80)=""
+2 ;
TDEQ ; select equipment
+1 WRITE !
DO GETEQ^ENUTL
if Y'>0
GOTO TDEXIT
SET ENDA=+Y
+2 ;
+3 IF +$$CHKFA^ENFAUTL(ENDA)
Begin DoDot:1
+4 WRITE $CHAR(7),!,"Can't proceed. Item is currently reported to FAP."
+5 WRITE !,"Use the Disposition an Asset (FD Document) option."
End DoDot:1
GOTO TDEQ
+6 ;
+7 IF $PIECE($GET(^ENG(6914,ENDA,0)),U,4)="NX"
IF '$DATA(^XUSEC("ENEDNX",DUZ))
Begin DoDot:1
+8 WRITE $CHAR(7),!,"Security Key ENEDNX is required to edit NX equipment."
End DoDot:1
GOTO TDEQ
+9 ;
+10 FOR ENI=0,1
SET ENY(ENI)=$GET(^ENG(6914,ENDA,ENI))
+11 WRITE !,ENDL
+12 WRITE !,"Entry #: ",ENDA,?21,"Mfg. Name: ",$EXTRACT($PIECE(ENY(0),U,2),1,40)
+13 WRITE !,"Mfg: ",$$GET1^DIQ(6914,ENDA,1)
+14 WRITE !,"Mod: ",$PIECE(ENY(1),U,2),?40,"Ser #: ",$PIECE(ENY(1),U,3)
+15 WRITE !,"Cat: ",$$GET1^DIQ(6914,ENDA,6)
+16 WRITE ?57,"Acq Date: ",$$GET1^DIQ(6914,ENDA,13)
+17 WRITE !,ENDL
+18 ;
+19 SET DIR(0)="SA^T:TURN-IN;D:FINAL DISPOSITION"
+20 SET DIR("A")="Select TURN-IN or FINAL DISPOSITION (enter '^' to quit): "
+21 DO ^DIR
KILL DIR
if $DATA(DIRUT)
GOTO TDEXIT
+22 SET ENTASK=Y
+23 ; check for unprocessed components, if any found give option to stop
+24 IF $ORDER(^ENG(6914,"AE",ENDA,0))
Begin DoDot:1
+25 NEW ENCY,ENX
+26 WRITE !!," This is the parent system for some equipment items."
+27 WRITE !," Components without "_$SELECT(ENTASK="T":"either a turn-in or ",1:"")_"disposition date are shown below:"
+28 SET ENI=0
SET ENX=""
FOR
SET ENI=$ORDER(^ENG(6914,"AE",ENDA,ENI))
if 'ENI
QUIT
Begin DoDot:2
+29 SET ENCY(3)=$GET(^ENG(6914,ENI,3))
+30 IF ENTASK="D"
IF $PIECE(ENCY(3),U,11)]""
QUIT
+31 IF ENTASK="T"
IF $PIECE(ENCY(3),U,11)]""!($PIECE(ENCY(3),U,3)]"")
QUIT
+32 IF $LENGTH(ENX)+$LENGTH(ENI)>70
WRITE !,?4,ENX_","
SET ENX=ENI
+33 IF '$TEST
SET ENX=ENX_$SELECT(ENX]"":", ",1:"")_ENI
End DoDot:2
+34 IF ENX']""
WRITE !,?4,"None found"
QUIT
+35 WRITE !,?4,ENX,!
Begin DoDot:2
+36 SET DIR("0")="Y"
SET DIR("B")="NO"
+37 SET DIR("A")="Continue with "_$SELECT(ENTASK="T":"Turn-In",1:"Final Disposition")_" of Parent System"
+38 DO ^DIR
KILL DIR
if 'Y
SET ENTASK=""
End DoDot:2
End DoDot:1
if ENTASK=""
GOTO TDEQ
+39 ;
TDEDIT ; edit equipment
+1 WRITE !!,"Note: Some data fields are automatically modified."
+2 SET ENCONTR=$PIECE($GET(^ENG(6914,ENDA,7)),U)
+3 SET DIE="^ENG(6914,"
SET DA=ENDA
+4 if ENTASK="T"
SET DR=$SELECT($DATA(^DIE("B","ENZEQTURN")):"[ENZ",1:"[EN")_"EQTURN]"
+5 if ENTASK="D"
SET DR=$SELECT($DATA(^DIE("B","ENZEQDISP")):"[ENZ",1:"[EN")_"EQDISP]"
+6 DO ^DIE
+7 ;
+8 WRITE !!,"Checking for inconsistencies..."
+9 SET ENOK=1
FOR ENI=2,3
SET ENY(ENI)=$GET(^ENG(6914,ENDA,ENI))
+10 IF ENTASK="D"
IF "^10^23^70^"[(U_$EXTRACT($$GET1^DIQ(6914,ENDA,18),1,2)_U)
IF $PIECE(ENY(3),U,11)=""
IF $PIECE(ENY(2),U,9)=""
Begin DoDot:1
+11 WRITE !," Accountable NX has both DISPOSITION DATE and CMR blank."
+12 SET ENOK=0
End DoDot:1
+13 IF $PIECE(ENY(3),U)>3
IF $PIECE(ENY(3),U)<6
IF $PIECE(ENY(3),U,3)=""
IF $PIECE(ENY(3),U,11)=""
Begin DoDot:1
+14 WRITE !," Either TURN-IN DATE or DISPOSITION DATE should be entered"
+15 WRITE !," when USE STATUS = ",$$EXTERNAL^DILFD(6914,20,"",$PIECE(ENY(3),U))
End DoDot:1
+16 IF 'ENOK
Begin DoDot:1
+17 SET DIR(0)="Y"
SET DIR("A")="Do you want to re-edit the equipment item"
+18 SET DIR("B")="YES"
+19 WRITE !
DO ^DIR
KILL DIR
End DoDot:1
if $DATA(DIRUT)
GOTO TDEXIT
if Y
GOTO TDEDIT
+20 IF ENOK
WRITE "OK"
+21 GOTO TDEQ
TDEXIT ;
+1 KILL DA,DIC,DIE,DIROUT,DIRUT,DR,DTOUT,DUOUT,X,Y
+2 KILL ENCONTR,ENDA,ENDL,ENI,ENOK,ENTASK,ENY
+3 QUIT
+4 ;ENEQTD