ENSA6 ;(WASH ISC)/DH-MedTester Utilities ;1/2/2001
;;7.0;ENGINEERING;**54,67**;Aug 17, 1993
MSG ;Opening message to user
W !!,"The system is now ready to update the Equipment File on the basis of",!,"data acquired from the MedTester."
W !!,"If the system encounters data that cannot be processed in the normal fashion",!,"it will give you written notice in the form of a MedTester Exception Message."
W !,"These messages will provide notification of such things as test failures",!,"and database inconsistencies."
W !!,"If a device fails a MedTester test sequence, the site is expected to",!,"evaluate the failure and issue a regular work order for corrective action."
W !,"If a PM work order exists for such a device and if you have elected to use",!,"MedTester data to close out that worklist, then the PM status will be set to"
W !,"'CORRECTIVE ACTION TAKEN/REQUESTED' but the PM work order will remain open",!,"and nothing will be posted to the Equipment History. Once corrective action"
W !,"has been taken, the PM work order should be closed out manually. The WORK",!,"PERFORMED field should contain a reference to the regular work order."
W !!,"You will soon select a hard copy device (printer) to receive MedTester",!,"Exception Messages, but first we need to know whether or not you want paper"
W !,"copies of the actual test results.",!
Q
WOCHK ;Has PM already been posted?
;Expects ENEQ, ENPMWO, ENREC
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=I,ENPMWO(0)=$P(^(0),U,2) S ^TMP($J,$S($P(^(0),U,3)="C":"FAIL",1:"PASS"),ENEQ)="" Q
Q:'ENWOX ; nothing presently recorded
Q:ENTEST="" ; need this to know if duplicate or additional
Q:$P(^ENG(6914,ENEQ,6,ENWOX,0),U,9)[ENTEST ; duplicate
I 'ENFAIL,$D(^TMP($J,"FAIL",ENEQ)) Q ; already have reg work order
S ENMSG=$S(ENFAIL:"FAILed MedTester, but PM Work Order has already been posted for ID#: ",1:"PM Work Order already posted for Equipment ID#: ")_ENEQ
I ENFAIL!($D(^TMP($J,"FAIL",ENEQ))) S ENMSG(0,1)="You should manually enter a work order for corrective action."
E S ENMSG(0,1)="MedTester time and labor will be added."
S ENMSG(0,2)="MedTester REC # "_ENREC S:$D(ENPMWO(0)) ENMSG(0,2)=ENMSG(0,2)_" Work Order Ref: "_ENPMWO(0)
D XCPTN^ENSA2
;
ADDMT ; add anything we have from MedTester to existing entry
; enwox is now the ien of the mult
; enemp, entec, entest & entime from ensa*
Q:ENFAIL ; nothing to add
L +^ENG(6914,ENEQ,6):5 Q:'$T ; bag it
S $P(^ENG(6914,ENEQ,6,ENWOX,0),U,9)=$E($P(^ENG(6914,ENEQ,6,ENWOX,0),U,9)_" "_ENTEST,1,140)
N LABOR,WAGE
S (LABOR,WAGE)=0
S $P(^ENG(6914,ENEQ,6,ENWOX,0),U,4)=$P(^(0),U,4)+ENTIME
I ENTEC>0 S PMTOT(ENSHKEY,ENTEC)=$G(PMTOT(ENSHKEY,ENTEC))+ENTIME
S WAGE=$S($G(ENTEC):$P($G(^ENG("EMP",ENTEC,0)),U,3),1:$P($G(^DIC(6910,1,0)),U,4)) S:WAGE="" WAGE=0 S X=WAGE*ENTIME,X(0)=2 D ROUND^ENLIB S LABOR=+Y
S $P(^ENG(6914,ENEQ,6,ENWOX,0),U,5)=$P(^ENG(6914,ENEQ,6,ENWOX,0),U,5)+LABOR
I $P(^ENG(6914,ENEQ,6,ENWOX,0),U,8)'=$E(ENEMP,1,15) S $P(^(0),U,8)="MULTIPLE"
L -^ENG(6914,ENEQ,6)
Q
;ENSA6
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HENSA6 3118 printed Nov 22, 2024@17:05:43 Page 2
ENSA6 ;(WASH ISC)/DH-MedTester Utilities ;1/2/2001
+1 ;;7.0;ENGINEERING;**54,67**;Aug 17, 1993
MSG ;Opening message to user
+1 WRITE !!,"The system is now ready to update the Equipment File on the basis of",!,"data acquired from the MedTester."
+2 WRITE !!,"If the system encounters data that cannot be processed in the normal fashion",!,"it will give you written notice in the form of a MedTester Exception Message."
+3 WRITE !,"These messages will provide notification of such things as test failures",!,"and database inconsistencies."
+4 WRITE !!,"If a device fails a MedTester test sequence, the site is expected to",!,"evaluate the failure and issue a regular work order for corrective action."
+5 WRITE !,"If a PM work order exists for such a device and if you have elected to use",!,"MedTester data to close out that worklist, then the PM status will be set to"
+6 WRITE !,"'CORRECTIVE ACTION TAKEN/REQUESTED' but the PM work order will remain open",!,"and nothing will be posted to the Equipment History. Once corrective action"
+7 WRITE !,"has been taken, the PM work order should be closed out manually. The WORK",!,"PERFORMED field should contain a reference to the regular work order."
+8 WRITE !!,"You will soon select a hard copy device (printer) to receive MedTester",!,"Exception Messages, but first we need to know whether or not you want paper"
+9 WRITE !,"copies of the actual test results.",!
+10 QUIT
WOCHK ;Has PM already been posted?
+1 ;Expects ENEQ, ENPMWO, ENREC
+2 FOR I=0:0
SET I=$ORDER(^ENG(6914,ENEQ,6,I))
if I'>0
QUIT
IF $PIECE(^ENG(6914,ENEQ,6,I,0),U,2)[ENPMWO
SET ENWOX=I
SET ENPMWO(0)=$PIECE(^(0),U,2)
SET ^TMP($JOB,$SELECT($PIECE(^(0),U,3)="C":"FAIL",1:"PASS"),ENEQ)=""
QUIT
+3 ; nothing presently recorded
if 'ENWOX
QUIT
+4 ; need this to know if duplicate or additional
if ENTEST=""
QUIT
+5 ; duplicate
if $PIECE(^ENG(6914,ENEQ,6,ENWOX,0),U,9)[ENTEST
QUIT
+6 ; already have reg work order
IF 'ENFAIL
IF $DATA(^TMP($JOB,"FAIL",ENEQ))
QUIT
+7 SET ENMSG=$SELECT(ENFAIL:"FAILed MedTester, but PM Work Order has already been posted for ID#: ",1:"PM Work Order already posted for Equipment ID#: ")_ENEQ
+8 IF ENFAIL!($DATA(^TMP($JOB,"FAIL",ENEQ)))
SET ENMSG(0,1)="You should manually enter a work order for corrective action."
+9 IF '$TEST
SET ENMSG(0,1)="MedTester time and labor will be added."
+10 SET ENMSG(0,2)="MedTester REC # "_ENREC
if $DATA(ENPMWO(0))
SET ENMSG(0,2)=ENMSG(0,2)_" Work Order Ref: "_ENPMWO(0)
+11 DO XCPTN^ENSA2
+12 ;
ADDMT ; add anything we have from MedTester to existing entry
+1 ; enwox is now the ien of the mult
+2 ; enemp, entec, entest & entime from ensa*
+3 ; nothing to add
if ENFAIL
QUIT
+4 ; bag it
LOCK +^ENG(6914,ENEQ,6):5
if '$TEST
QUIT
+5 SET $PIECE(^ENG(6914,ENEQ,6,ENWOX,0),U,9)=$EXTRACT($PIECE(^ENG(6914,ENEQ,6,ENWOX,0),U,9)_" "_ENTEST,1,140)
+6 NEW LABOR,WAGE
+7 SET (LABOR,WAGE)=0
+8 SET $PIECE(^ENG(6914,ENEQ,6,ENWOX,0),U,4)=$PIECE(^(0),U,4)+ENTIME
+9 IF ENTEC>0
SET PMTOT(ENSHKEY,ENTEC)=$GET(PMTOT(ENSHKEY,ENTEC))+ENTIME
+10 SET WAGE=$SELECT($GET(ENTEC):$PIECE($GET(^ENG("EMP",ENTEC,0)),U,3),1:$PIECE($GET(^DIC(6910,1,0)),U,4))
if WAGE=""
SET WAGE=0
SET X=WAGE*ENTIME
SET X(0)=2
DO ROUND^ENLIB
SET LABOR=+Y
+11 SET $PIECE(^ENG(6914,ENEQ,6,ENWOX,0),U,5)=$PIECE(^ENG(6914,ENEQ,6,ENWOX,0),U,5)+LABOR
+12 IF $PIECE(^ENG(6914,ENEQ,6,ENWOX,0),U,8)'=$EXTRACT(ENEMP,1,15)
SET $PIECE(^(0),U,8)="MULTIPLE"
+13 LOCK -^ENG(6914,ENEQ,6)
+14 QUIT
+15 ;ENSA6