VistA-FOIAVistA/r/ENGINEERING-EN/ENBCPM9.m

34 lines
1.6 KiB
Mathematica

ENBCPM9 ;(WASH ISC)/DH-Bar Coded PMI, Gen Regular WO ;1.16.97
;;7.0;ENGINEERING;**1,14,35**;Aug 17, 1993
NEWWO N SHOPKEY,CODE,NUMBER,DA,WARD,ENDA
S SHOPKEY=ENSHKEY
F EN1=0:0 S EN1=$O(^ENG(6920,"G",ENEQ,EN1)) Q:EN1'>0 I $D(^ENG(6920,EN1,2)),$P(^(2),U)=SHOPKEY,$E($P(^(0),U),1,3)'="PM-" Q:'$D(^(5)) Q:$P(^(5),U,2)=""
I EN1>0 D D XCPTN^ENBCPM2 Q
. S NUMBER=$P(^ENG(6920,EN1,0),U)
. S ENMSG(0,2)="Regular work order "_NUMBER_" is open."
. I $D(^ENG(6920,EN1,1)),$P(^(1),U)=.5 Q
. I ENTIME>0 S PMTOT(ENSHKEY,ENTEC)=$G(PMTOT(ENSHKEY,ENTEC))+ENTIME
D WONUM^ENWONEW
I NUMBER="" D XCPTN^ENBCPM2 Q
S ENMSG(0,2)="Regular work order "_NUMBER_" has been generated."
S DIE="^ENG(6920,",DR=".05///^S X=NUMBER;1///^S X=DT;2///^S X=""C"";6///^S X=PROBLEM;7.5////^S X=.5;9////^S X=ENSHKEY;16////^S X=ENTEC;17///^S X=""A"";18///^S X=ENEQ;32///^S X=""PENDING"""
D ^DIE
S ^ENG(6920,DA,8,0)="^6920.035PA^1^1",DIE="^ENG(6920,DA(1),8,",(ENDA,DA(1))=DA,DA=1,DR=".01///^S X=""GENERAL REPAIR (In-house)""" D ^DIE K DA,DIE S DA=ENDA,DIE="^ENG(6920,"
I ENLOC]"" D
. I $D(^ENG("SP","B",ENLOC)) S DR="3///^S X=ENLOC" D ^DIE Q
. I ENLOC["E" D
.. S ENLOC(0)=ENLOC F S ENLOC(0)=$P(ENLOC(0),"E")_"e"_$P(ENLOC(0),"E",2,99) I $D(^ENG("SP","B",ENLOC(0)))!(ENLOC(0)'["E") Q
.. I $D(^ENG("SP","B",ENLOC(0))) S DR="3///^S X=ENLOC(0)" D ^DIE
.. Q
I $D(^ENG(6910.2,1,0)) S ENAUTO=$P(^(0),U,2) D K ENAUTO
. I ENAUTO]"","LS"[ENAUTO D
.. S ENAUTO(0)=$P(^DIC(6922,SHOPKEY,0),U,3)
.. I ENAUTO(0)]"",$D(^%ZIS(1,ENAUTO(0),0)) S WARD=0 D WOPRNT^ENWONEW
. Q
I ENTIME>0 D
. I $D(^ENG(6920,DA,7,1,0)) S $P(^(0),U,2)=ENTIME
. S PMTOT(ENSHKEY,ENTEC)=$G(PMTOT(ENSHKEY,ENTEC))+ENTIME
D XCPTN^ENBCPM2
Q
;ENBCPM9