source: FOIAVistA/trunk/r/ENGINEERING-EN/ENEQ4.m@ 1327

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

initial load of FOIAVistA 6/30/08 version

File size: 2.4 KB
Line 
1ENEQ4 ;WIRMFO/SAB-PURGE EQUIPMENT INV FILE ;12/28/07 13:54
2 ;;7.0;ENGINEERING;**40,87**;Aug 17, 1993;Build 16
3 ;
4DEL ;Delete Equipment Record entry
5 S ENEDNX=$D(^XUSEC("ENEDNX",DUZ))
6 W !!,"This option completely deletes a specific equipment record. If"
7 W !,"you would rather move equipment records to an archive media, then"
8 W !,"exit this option and use the Engineering Archive Module instead."
9DELSEQ ; select equipment record for deletion
10 W !
11 D GETEQ^ENUTL G:Y'>0 DELX
12 S ENDA=+Y
13 F ENI=0,1,2,3 S ENY(ENI)=$G(^ENG(6914,ENDA,ENI))
14 ;
15 ; display equipment data
16 W @IOF
17 W !,"ENTRY #: ",ENDA
18 W !!,?2,"MFGR EQUIP NAME: ",$P(ENY(0),U,2)
19 W !,?2,"EQUIP CATEGORY: ",$$GET1^DIQ(6914,ENDA,6)
20 W !,?2,"CSN: ",$$GET1^DIQ(6914,ENDA,18)
21 S ENX=$$GET1^DIQ(6914,ENDA,"18:2") I ENX]"" W " (",ENX,")"
22 W !!,?2,"MANUFACTURER: ",$$GET1^DIQ(6914,ENDA,1)
23 W !,?2,"MODEL: ",$P(ENY(1),U,2),?42,"SERIAL #: ",$P(ENY(1),U,3)
24 W !!,?2,"CMR: ",$$GET1^DIQ(6914,ENDA,19)
25 W ?42,"USE STATUS: ",$$GET1^DIQ(6914,ENDA,20)
26 W !,?2,"ACQUISITION DATE: ",$$FMTE^XLFDT($P(ENY(2),U,4))
27 W ?34,"LE: ",$P(ENY(2),U,6)
28 W ?42,"DISPOSITION DATE: ",$$FMTE^XLFDT($P(ENY(3),U,11)),!
29 ;
30 ; validate selection
31 K ENV
32 S ENX=$$CHKFA^ENFAUTL(ENDA)
33 I +ENX S ENV(1)="It is currently reported to Fixed Assets in Austin."
34 E I $P(ENX,U,2)]"" S ENV(2)="It was previously reported to Fixed Assets in Austin."
35 I $P(ENY(0),U,4)="NX",'ENEDNX S ENV(3)="Security key ENEDNX is required to delete NX equipment."
36 I $P(ENY(3),U,1)=1 S ENV(4)="USE STATUS is IN USE."
37 I $P(ENY(3),U,11)="" S ENV(5)="DISPOSITION DATE is blank."
38 I $D(^ENG(6916.3,"B",ENDA)) S ENV(6)="It is linked to an IT Assignment record."
39 I $D(ENV) D G DELSEQ
40 . W $C(7),!,"This equipment entry can not be deleted because:"
41 . S ENI=0 F S ENI=$O(ENV(ENI)) Q:'ENI W !,?2,ENV(ENI)
42 ;
43 ; confirm deletion
44 S DIR(0)="Y",DIR("A")="Delete this entry"
45 D ^DIR K DIR G:$D(DIRUT) DELX I 'Y G DELSEQ
46 ;
47 ; first close any open work orders
48 S ENTXT(1)="Automatically closed when equipment record was deleted."
49 S DA=0 F S DA=$O(^ENG(6920,"G",ENDA,DA)) Q:'DA I $P($G(^ENG(6920,DA,5)),U,2)="" D
50 . D WP^DIE(6920,DA_",",40,"A","ENTXT")
51 . S DIE="^ENG(6920,",DR="36///T;32///^S X=""COMPLETED"""
52 . D ^DIE
53 K DIE,DR,ENTXT
54 ; then delete equipment
55 S DIK="^ENG(6914,",DA=ENDA D ^DIK K DIK
56 W !,"Equipment entry # ",ENDA," was deleted."
57 ;
58 G DELSEQ
59 ;
60DELX ; delete equipment record exit
61 K DA,DIC,DIE,DIK,DIROUT,DIRUT,DR,DTOUT,DUOUT,X,Y
62 K END,ENDA,ENEDNX,ENI,ENV,ENWO,ENX,ENY
63 Q
64 ;
65 ;ENEQ4
Note: See TracBrowser for help on using the repository browser.