source: WorldVistAEHR/trunk/r/ENGINEERING-EN/ENEQNX5.m@ 767

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

initial load of WorldVistAEHR

File size: 1.4 KB
Line 
1ENEQNX5 ;(WASH ISC)/DH-Manual Update of Equipment Inventory ;9.26.97
2 ;;7.0;ENGINEERING;**35,43**;Aug 17, 1993
3EN ;Update NX Inventory (Single record mode)
4DIC W @IOF,!! D GETEQ^ENUTL G:Y'>0 EXIT S DA=+Y
5 I '$D(^ENG(6914,DA)) S ENMSG="RECORD NOT FOUND.",ENMSG(0,1)="Suspect database degrade." D XCPTN^ENEQNX1 G DIC
6 S EN(2)=$S($D(^ENG(6914,DA,2)):^(2),1:""),EN(3)=$S($D(^(3)):^(3),1:"") S ENLOC=$P(EN(3),U,5),ENOLDLOC=$P(EN(3),U,8),ENINVDT=$P(EN(2),U,13) I ENINVDT]"" S Y=ENINVDT X ^DD("DD") S ENINVDT=Y
7 I ENLOC=+ENLOC,$D(^ENG("SP",ENLOC,0)) S ENLOC=$P(^(0),U)
8 W !!,"Entry Number: ",DA S ENPMN=$P(EN(3),U,6) I ENPMN]"" W ?30,"PM Number: ",ENPMN
9 W !,?5,"Location: ",ENLOC,?30,"Previous location: ",ENOLDLOC
10 W !,?5,"Last inventoried: ",ENINVDT
11CNFRM W !!,"Do you wish to update this record" S %=1 D YN^DICN G:%=0 CNFRM G:%'=1 DIC
12 S DIE="^ENG(6914,",DR="24;23///^S X=""T""" D ^DIE
13 G DIC
14 ;
15UPDT(DA,ENDT,ENLOC) ; Update PHYSICAL INVENTORY DATE
16 ;
17 ; DA => IEN to Equipment File (not returned)
18 ; ENDT => Date (internal format)
19 ; ENLOC => Location from Work Order (internal format)
20 ; Called by work order routines, mainly PM close-out
21 ;
22 Q:DA']"" Q:'$D(^ENG(6914,DA,0))
23 N CURNT,DIE,DR
24 S CURNT=$P($G(^ENG(6914,DA,2)),U,13)
25 S DIE="^ENG(6914,"
26 I ENDT>CURNT D
27 . S DR="23///^S X=ENDT" D ^DIE
28 . I ENLOC]"",$D(^ENG("SP",ENLOC,0)),ENLOC'=$P($G(^ENG(6914,DA,3)),U,5) S DR="24////^S X=ENLOC" D ^DIE
29 K DA
30 Q
31 ;
32EXIT K EN,ENLOC,ENOLDLOC,ENINVDT,DA,ENPMN
33 Q
34 ;ENEQNX5
Note: See TracBrowser for help on using the repository browser.