source: WorldVistAEHR/trunk/r/ENGINEERING-EN/ENEQTD.m@ 1150

Last change on this file since 1150 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 2.9 KB
Line 
1ENEQTD ;WIRMFO/SAB-TURN-IN/DISPOSITION EQUIPMENT RECORDS ;2.12.97
2 ;;7.0;ENGINEERING;**35**;Aug 17, 1993
3TD ; turn-in/disposition non-capitalized equipment record
4 K ENDL S $P(ENDL,"-",80)=""
5 ;
6TDEQ ; select equipment
7 W ! D GETEQ^ENUTL G:Y'>0 TDEXIT S ENDA=+Y
8 ;
9 I +$$CHKFA^ENFAUTL(ENDA) D G TDEQ
10 . W $C(7),!,"Can't proceed. Item is currently reported to FAP."
11 . W !,"Use the Disposition an Asset (FD Document) option."
12 ;
13 I $P($G(^ENG(6914,ENDA,0)),U,4)="NX",'$D(^XUSEC("ENEDNX",DUZ)) D G TDEQ
14 . W $C(7),!,"Security Key ENEDNX is required to edit NX equipment."
15 ;
16 F ENI=0,1 S ENY(ENI)=$G(^ENG(6914,ENDA,ENI))
17 W !,ENDL
18 W !,"Entry #: ",ENDA,?21,"Mfg. Name: ",$E($P(ENY(0),U,2),1,40)
19 W !,"Mfg: ",$$GET1^DIQ(6914,ENDA,1)
20 W !,"Mod: ",$P(ENY(1),U,2),?40,"Ser #: ",$P(ENY(1),U,3)
21 W !,"Cat: ",$$GET1^DIQ(6914,ENDA,6)
22 W ?57,"Acq Date: ",$$GET1^DIQ(6914,ENDA,13)
23 W !,ENDL
24 ;
25 S DIR(0)="SA^T:TURN-IN;D:FINAL DISPOSITION"
26 S DIR("A")="Select TURN-IN or FINAL DISPOSITION (enter '^' to quit): "
27 D ^DIR K DIR G:$D(DIRUT) TDEXIT
28 S ENTASK=Y
29 ; check for unprocessed components, if any found give option to stop
30 I $O(^ENG(6914,"AE",ENDA,0)) D G:ENTASK="" TDEQ
31 . N ENCY,ENX
32 . W !!," This is the parent system for some equipment items."
33 . W !," Components without "_$S(ENTASK="T":"either a turn-in or ",1:"")_"disposition date are shown below:"
34 . S ENI=0,ENX="" F S ENI=$O(^ENG(6914,"AE",ENDA,ENI)) Q:'ENI D
35 . . S ENCY(3)=$G(^ENG(6914,ENI,3))
36 . . I ENTASK="D",$P(ENCY(3),U,11)]"" Q
37 . . I ENTASK="T",$P(ENCY(3),U,11)]""!($P(ENCY(3),U,3)]"") Q
38 . . I $L(ENX)+$L(ENI)>70 W !,?4,ENX_"," S ENX=ENI
39 . . E S ENX=ENX_$S(ENX]"":", ",1:"")_ENI
40 . I ENX']"" W !,?4,"None found" Q
41 . W !,?4,ENX,! D
42 . . S DIR("0")="Y",DIR("B")="NO"
43 . . S DIR("A")="Continue with "_$S(ENTASK="T":"Turn-In",1:"Final Disposition")_" of Parent System"
44 . . D ^DIR K DIR S:'Y ENTASK=""
45 ;
46TDEDIT ; edit equipment
47 W !!,"Note: Some data fields are automatically modified."
48 S ENCONTR=$P($G(^ENG(6914,ENDA,7)),U)
49 S DIE="^ENG(6914,",DA=ENDA
50 S:ENTASK="T" DR=$S($D(^DIE("B","ENZEQTURN")):"[ENZ",1:"[EN")_"EQTURN]"
51 S:ENTASK="D" DR=$S($D(^DIE("B","ENZEQDISP")):"[ENZ",1:"[EN")_"EQDISP]"
52 D ^DIE
53 ;
54 W !!,"Checking for inconsistencies..."
55 S ENOK=1 F ENI=2,3 S ENY(ENI)=$G(^ENG(6914,ENDA,ENI))
56 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
57 . W !," Accountable NX has both DISPOSITION DATE and CMR blank."
58 . S ENOK=0
59 I $P(ENY(3),U)>3,$P(ENY(3),U)<6,$P(ENY(3),U,3)="",$P(ENY(3),U,11)="" D
60 . W !," Either TURN-IN DATE or DISPOSITION DATE should be entered"
61 . W !," when USE STATUS = ",$$EXTERNAL^DILFD(6914,20,"",$P(ENY(3),U))
62 I 'ENOK D G:$D(DIRUT) TDEXIT G:Y TDEDIT
63 . S DIR(0)="Y",DIR("A")="Do you want to re-edit the equipment item"
64 . S DIR("B")="YES"
65 . W ! D ^DIR K DIR
66 I ENOK W "OK"
67 G TDEQ
68TDEXIT ;
69 K DA,DIC,DIE,DIROUT,DIRUT,DR,DTOUT,DUOUT,X,Y
70 K ENCONTR,ENDA,ENDL,ENI,ENOK,ENTASK,ENY
71 Q
72 ;ENEQTD
Note: See TracBrowser for help on using the repository browser.