source: WorldVistAEHR/trunk/r/ENGINEERING-EN/ENLIB2.m@ 1270

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

initial load of WorldVistAEHR

File size: 3.8 KB
Line 
1ENLIB2 ;(WASH ISC)/DH-Package Utilities ;1/10/2001
2 ;;7.0;ENGINEERING;**21,35,68**;Aug 17, 1993
3PO ;Called when PO# entered into Equip File
4 ;X=PO# and DA is Equip IEN
5 S ENPO=X,ENPO(0)=0 I $D(^PRC(442,"B",ENPO)) S ENPO(0)=$O(^(ENPO,0))
6 E I $D(^PRC(442,"C",ENPO)) S ENPO(0)=$O(^(ENPO,0))
7 I ENPO(0)'>0!('$D(^PRC(442,ENPO(0),0))) K ENPO Q
8 S ENPO("FCP")=$P(^PRC(442,ENPO(0),0),U,3),ENPO("CC")=$P(^(0),U,5),ENPO("SUB")=$P(^(0),U,6)
9 S (ENPO("VEN"),ENPO("SRV"),ENPO("SRC"))=""
10 I $D(^PRC(442,ENPO(0),1)) S ENPO("VEN")=$P(^(1),U),ENPO("SRV")=$P(^(1),U,2),ENPO("SRC")=$P(^(1),U,7)
11 I '$D(^ENG(6914,DA,8)) S ^ENG(6914,DA,8)="^^"_ENPO("FCP")_"^"_ENPO("CC")_"^"_ENPO("SUB") G PO1
12 I $P(^ENG(6914,DA,8),U,3)="" S $P(^(8),U,3)=ENPO("FCP")
13 I $P(^ENG(6914,DA,8),U,4)="" S $P(^(8),U,4)=ENPO("CC")
14 I $P(^ENG(6914,DA,8),U,5)="" S $P(^(8),U,5)=ENPO("SUB")
15PO1 I ENPO("VEN")]"" S:'$D(^ENG(6914,DA,2)) ^ENG(6914,DA,2)=ENPO("VEN") I $P(^ENG(6914,DA,2),U)="" S $P(^(2),U)=ENPO("VEN")
16 I ENPO("SRV")]"" D SRV
17 I ENPO("SRC")]"" S:'$D(^ENG(6914,DA,2)) $P(^ENG(6914,DA,2),U,14)=ENPO("SRC") I $P(^ENG(6914,DA,2),U,14)="" S $P(^(2),U,14)=ENPO("SRC")
18EXIT K ENPO
19 Q
20 ;
21ACC ;Toggle WO STATUS on basis of 2237
22 ;Expects DA based on Work Order File
23 I $D(^ENG(6920,DA,5)),$P(^(5),U,2)]"" Q
24 S ENX="" I $D(^ENG(6920,DA,4)) S ENX=$P(^(4),U,2)
25 I ENX'>0 K ENX Q
26 I $D(^PRCS(410,ENX,9)),$P(^(9),U,3)]"" K ENX Q
27 S (ENX(0),ENX(1))="" I $D(^PRCS(410,ENX,"IT")) S ENX(0)=$O(^PRCS(410,ENX,"IT",0)) S:ENX(0)>0 ENX(1)=$E($P(^PRCS(410,ENX,"IT",ENX(0),0),U,4),1,2)
28 S $P(^ENG(6920,DA,4),U,3)=$S(ENX(1)=25:4,1:3)
29 K ENX
30 Q
31 ;
32ACCX ; IFCAP entry point from File 410
33 ; DA => IEN to File 6914
34 ; +X => IEN to Work Order File
35 Q:'$D(^ENG(6920,+X,0)) ; in case W.O. deleted and file 410 re-indexed
36 N ENDA S ENDA=DA
37 N DA S DA=+X,$P(^ENG(6920,DA,4),U,2)=ENDA
38 D ACC
39 Q
40 ;
41POWO ; IFCAP entry point from File 442
42 Q ;May be activated in conjunction with a future IFCAP patch
43 ;
44SRV ;Service pointer
45 I $D(^ENG(6914,DA,3)),$P(^(3),U,2)]"" Q ;Don't overwrite
46 S $P(^ENG(6914,DA,3),U,2)=ENPO("SRV"),^ENG(6914,"AC",ENPO("SRV"),DA)=""
47 Q
48 ;
49CMRNOM ;Subheader on CMR
50 Q:'$D(D0) I '$D(ENCMR) S ENCMR=$S($D(^ENG(6914,D0,2)):$P(^(2),U,9),1:0) S:ENCMR="" ENCMR=0 I $D(^ENG(6914.1,ENCMR,0)) S ENCMR(0)=$P(^(0),U,5) I ENCMR(0)]"",$D(^DIC(49,ENCMR(0),0)) W !,?13,$P(^(0),U)," SERVICE" D CMRRO W !!
51 I $D(^ENG(6914,D0,2)),$P(^(2),U,9)'=ENCMR S ENCMR=$P(^(2),U,9) S:ENCMR="" ENCMR=0 I $D(^ENG(6914.1,ENCMR,0)) S ENCMR(0)=$P(^(0),U,5) I ENCMR(0)]"",$D(^DIC(49,ENCMR(0),0)) W !,?13,$P(^(0),U)," SERVICE" D CMRRO W !!
52 I '$D(ENNOMEN) S ENNOMEN=$S($D(^ENG(6914,D0,2)):$P(^(2),U,8),1:0) S:ENNOMEN="" ENNOMEN=0 D:$D(^ENCSN(6917,ENNOMEN,0)) CMRPRNT Q
53 I $D(^ENG(6914,D0,2)),$P(^(2),U,8)=ENNOMEN Q
54 I '$D(^ENG(6914,D0,2)) K ENNOMEN Q
55 S ENNOMEN=$S($P(^ENG(6914,D0,2),U,8)]"":$P(^(2),U,8),1:0) D:$D(^ENCSN(6917,ENNOMEN,0)) CMRPRNT
56 Q
57CMRPRNT N X,DIWL,DIWR,DIWF K ^UTILITY($J,"W") S DIWL=1,DIWR=IOM,DIWF="W"
58 W !!,"CATEGORY STOCK NUMBER: ",$P(^ENCSN(6917,ENNOMEN,0),U) F ENNX=0:0 S ENNX=$O(^ENCSN(6917,ENNOMEN,1,ENNX)) Q:ENNX'>0 I $D(^(ENNX,0)) S X=^(0) D ^DIWP
59 D ^DIWW K ENNX
60 Q
61CMRRO ; CMR Responsible Official
62 N ENRO,DIERR
63 S ENRO=$$GET1^DIQ(6914.1,ENCMR,1)
64 I ENRO]"" W !,?13,"Responsible Official: ",ENRO
65 Q
66 ;
67WA ;Count the number of WORK ACTIONS
68 ;called by the input transform of File 6920 Subfile 6920.035 Field .01
69 N I,J,COUNT S COUNT=0
70 F I=0:0 S I=$O(^ENG(6920,DA,8,I)) Q:I'>0 S COUNT=COUNT+1,J=$P(^(I,0),U) Q:J=X
71 Q:COUNT<4 Q:J=X
72 D EN^DDIOL(" Can't have more than four WORK ACTIONS.")
73 K X
74 Q
75 ;
76ASN ;Count the number of ALTERNATE STATION NUMBERS
77 ;called by the input transform of File 6910 Subfile 6910.012 Field .01
78 N I,J,COUNT S (COUNT,I)=0
79 F S I=$O(^DIC(6910,DA,3,I)) Q:'I S COUNT=COUNT+1,J=$P(^(I,0),U) Q:J=X
80 Q:COUNT<30 Q:J=X
81 D EN^DDIOL(" Can't have more than thirty (30) ALTERNATE STATION NUMBERS.")
82 K X
83 Q
84 ;ENLIB2
Note: See TracBrowser for help on using the repository browser.