source: WorldVistAEHR/trunk/r/ENGINEERING-EN/ENBCPM6.m@ 1801

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

initial load of WorldVistAEHR

File size: 4.1 KB
RevLine 
[613]1ENBCPM6 ;(WASH ISC)/DH-Bar Coded PMI Utilities ;4.9.97
2 ;;7.0;ENGINEERING;**14,35**;Aug 17, 1993
3MSG ;Opening message to user
4 W !!,"The system is now ready to update the Equipment File on the basis of",!,"data acquired from the portable bar code reader."
5 W !!,"Data that cannot be processed normally will be reported as Exception Messages."
6 W !,"These messages will provide notification of such things as missing bar code",!,"labels and database inconsistencies."
7 W !!,"Exception Messages will also be printed for devices that FAIL their PM"
8 W !,"inspection. Regular work orders will be automatically generated. The PM work",!,"order will be closed with a reference to the regular work order."
9 W !!,"You must now select a hard copy device (printer) to receive PMI Exception",!,"Messages."
10 W !!,"You may enter the letter 'Q' and then select a device if you wish to",!,"schedule this data processing task for some later time. You may enter the"
11 W !,"caret key ('^') to abort this update with the intention of manually re-",!,"starting it at some later date.",!
12 Q
13 ;
14WOCHK ; Has PM already been posted?
15 ; Expects ENEQ as IEN to Equipment File
16 ;
17 F I=0:0 S I=$O(^ENG(6914,ENEQ,6,I)) Q:I'>0 I $P(^ENG(6914,ENEQ,6,I,0),U,2)[ENPMWO S ENWOX=1
18 I 'ENWOX Q ;Nothing recorded
19 S ENMSG="PM Work Order already posted for Equipment ID#: "_ENEQ D XCPTN^ENBCPM2
20 Q
21 ;
22POST ; Retain PM work order
23 N ENDA
24 S ENPMWO(0)=$O(^ENG(6920,"B",ENPMWO_"-9999"),-1) S:ENPMWO(0)'[ENPMWO ENPMWO(0)=ENPMWO_"-001"
25 L +^ENG(6920,"B"):30 I '$T K ENPMWO(0) Q
26POST1 I $D(^ENG(6920,"B",ENPMWO(0)))!($D(^ENG(6920,"H",ENPMWO(0)))) S J=+$P(ENPMWO(0),"-",3)+1 S:J?1.2N J=$S(J?1N:"00"_J,1:"0"_J) S ENPMWO(0)=ENPMWO_"-"_J G POST1
27 K DD,DO S DIC="^ENG(6920,",DIC(0)="LX",X=ENPMWO(0) D FILE^DICN S DA=+Y
28 L -^ENG(6920,"B")
29 I DA'>0 K ENPMWO(0) Q
30 S ENWP="UNSCHEDULED PMI (Bar Code Reader)"
31 S DIE="^ENG(6920,",DR=".05///^S X=ENPMWO(0);1///^S X=DT;3///^S X=ENLOC;6///^S X=""PM Inspection (Unscheduled)"";9///^S X=ENSHKEY;10///^S X=DT;18///^S X=ENEQ;35.2///^S X=""P"";39///^S X=ENWP"
32 D ^DIE
33 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=""PREVENTIVE MAINTENANCE""" D ^DIE K DA S DA=ENDA
34 I $G(EN)=21 D Q
35 . S ^ENG(6920,DA,7,0)="^6920.02PA^1^1",DIE="^ENG(6920,DA(1),7,",(ENDA,DA(1))=DA,DA=1,DR=".01///^S X=ENTEC;2///^S X=ENSHKEY" D ^DIE K DA S DA=ENDA
36 . K DR S DIE="^ENG(6920,",DR="36///^S X=DT;32///^S X=""COMPLETED""" D ^DIE
37 S ENTIME=+$E(ENLKAHD,6,30) I ENTIME]"" S X=ENTIME,X(0)=2 D ROUND^ENLIB S ENTIME=+Y S:ENTIME<0 ENTIME="" S:ENTIME>0 $P(^ENG(6920,DA,5),U,3)=ENTIME
38 S ENX=ENX1,^PRCT(446.4,ENCTID,2,ENCTTI,1,ENX,0)="*"_ENLKAHD,ENX1=$O(^PRCT(446.4,ENCTID,2,ENCTTI,1,ENX)) S ENLKAHD=$S(ENX1]"":^(ENX1,0),1:"")
39 S ENMATRL="" I $E(ENLKAHD,1,5)="MATRL" D
40 . S ENX=ENX1,^PRCT(446.4,ENCTID,2,ENCTTI,1,ENX,0)="*"_ENLKAHD,ENMATRL=+$E(ENLKAHD,7,30) S:ENMATRL<0 ENMATRL=""
41 . I ENMATRL=+ENMATRL S X=ENMATRL,X(0)=2 D ROUND^ENLIB S ENMATRL=+Y
42 . S ENX1=$O(^PRCT(446.4,ENCTID,2,ENCTTI,1,ENX)),ENLKAHD=$S(ENX1]"":^(ENX1,0),1:"")
43 . I $E(ENLKAHD,1,5)="CODE:" D
44 .. S ENX=ENX1,^PRCT(446.4,ENCTID,2,ENCTTI,1,ENX,0)="*"_ENLKAHD
45 .. I $P(ENLKAHD,":",2)?1N N DIE,DA D
46 ... S DA=ENEQ,DIE="^ENG(6914,",DR="53///"_$P(ENLKAHD,":",2) D ^DIE
47 ... Q
48 S X=ENX,ENWP=""
49 F S X=$O(^PRCT(446.4,ENCTID,2,ENCTTI,1,X)) Q:X="" S X1=^(X,0) Q:($E(X1)="*")!($E(X1,1,2)="SP")!($E(X1,1,4)="MOD:")!($E(X1,1,4)="PM:")!($E(X1,3,8)[" EE") D
50 . S ENX=X,ENWP=ENWP_X1
51 . S ^PRCT(446.4,ENCTID,2,ENCTTI,1,X,0)="*"_X1
52 I ENWP]"",$L(ENWP)<130 S ENWP=ENWP_" (Bar Code)"
53 I ENWP="" S ENWP="UNSCHEDULED PMI (Bar Code Reader)"
54 I ENTIME>0 S ENW=$P($G(^ENG("EMP",ENTEC,0)),U,3) D
55 . I ENW'>0 S ENW=$P($G(^DIC(6910,1,0)),U,4)
56 . I ENW>0 S $P(^ENG(6920,DA,5),U,6)=ENW*ENTIME
57 S ^ENG(6920,DA,7,0)="^6920.02PA^1^1",DIE="^ENG(6920,DA(1),7,",(ENDA,DA(1))=DA,DA=1,DR=".01///^S X=ENTEC;1///^S X=ENTIME;2///^S X=ENSHKEY" D ^DIE K DA S DA=ENDA
58 K DR S DIE="^ENG(6920,",DR="38///^S X=ENMATRL;39///^S X=ENWP;36///^S X=DT;32///^S X=""COMPLETED""" D ^DIE
59 I $G(ENTIME)>0 S PMTOT(ENSHKEY,ENTEC)=$G(PMTOT(ENSHKEY,ENTEC))+ENTIME
60 Q
61 ;ENBCPM6
Note: See TracBrowser for help on using the repository browser.