source: WorldVistAEHR/trunk/r/ENGINEERING-EN/ENSA.m@ 1361

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

initial load of WorldVistAEHR

File size: 2.8 KB
Line 
1ENSA ;(WASH ISC)/DH-MedTester Interface ;1/11/2001
2 ;;7.0;ENGINEERING;**14,21,68**;Aug 17, 1993
3EN ;Upload test results from MedTester
4 S ENSTA=$P($G(^DIC(6910,1,0)),U,2),ENSTAL=$L(ENSTA)
5 I ENSTA="" W !!,"Can't seem to find your STATION NUMBER. Please check File 6910.",!,"Your IRM staff may need to assist you.",*7 G ERR^ENSA3
6 F I=1,2,3,4,5,6,7,8 S ENSTA(I)="",ENSTAL(I)=0
7 I $G(^DIC(6910,1,3,0))]"" D
8 . S (I,ENX)=0 F S ENX=$O(^DIC(6910,1,3,ENX)) Q:'ENX!(I>8) D
9 .. S I=I+1,ENSTA(I)=$P(^DIC(6910,1,3,ENX,0),U)
10 .. S ENSTAL(I)=$L(ENSTA(I))
11 D NOW^%DTC S ENTID=% S:'$D(DTIME) DTIME=600 D UPLD^ENSA1 G:POP EXIT
12 G:'$D(ENTID) EXIT I '$D(^ENG("TMP",ENTID)) G EXIT
13 S ENPMWO="",X="T",U="^",%DT="" D ^%DT S DT=+Y X ^DD("DD") S ENDATE=Y
14MSG W @IOF,"MedTester UPLOAD MODULE:",!!,"Should data from the MedTester be used to close out work orders on a",!,"PM worklist" S %=1 D YN^DICN G:%<0 ERR^ENSA3 G:%=2 EN3 I %=0 D MSGXTD G MSG
15 W !! S Y=$E(DT,1,5)_"00" X ^DD("DD") S %DT("A")="For which month do you wish to record PMI's: ",%DT("B")=Y,%DT="AEPMX" D ^%DT G:Y'>0 ERR^ENSA3 S ENPMDT=$E(Y,2,5),ENPM="M"
16MORW W !,"Are you recording a MONTHLY (as opposed to a WEEKLY) worklist" S %=1 D YN^DICN G:%<0 ERR^ENSA3 G:%=0 MORW I %=1 G EN1
17WEEK R !,"Week number (enter an integer from 1 to 5): ",X:DTIME G:X="^" ERR^ENSA3 I X?1N,X>0,X<6 S ENPM="W"_X G EN1
18 W "??",*7 G WEEK
19EN1 S DIC="^DIC(6922,",DIC(0)="AEMQ" D ^DIC G:Y'>0 ERR^ENSA3 S ENSHKEY=+Y,ENSHOP=$P(^DIC(6922,ENSHKEY,0),U,1),ENSHABR=$P(^(0),U,2)
20 S ENPMWO="PM-"_ENSHABR_ENPMDT_ENPM
21EN2 S ENDEL="" I $D(^DIC(6910,1,0)) S ENDEL=$P(^(0),U,5)
22 I ENDEL="" R !,"Should existing PM work orders be deleted after close out? YES// ",X:DTIME G:X="^" ERR^ENSA3 S:X=""!("Yy"[$E(X)) ENDEL="Y"
23 I ENDEL="","Nn"'[$E(X) D COBH1^ENEQPMR4 G EN2
24EN3 D MSG^ENSA6
25 ;Physical processing of uploaded data
26 I '$D(^ENG("TMP",ENTID)) W !!,*7,"No data to process." D HOLD G EXIT
27PAPER W !,"Do you want a paper copy of test results (will be printed on same",!,"device as Exception Messages)" S %=2 D YN^DICN G:%<0 ERR^ENSA3 G:%<1 PAPER S ENPAPER=$S(%=1:1,1:0)
28 K IO("Q") W ! S %ZIS="MQ",%ZIS("A")="Select Device for EXCEPTION MESSAGES: " D ^%ZIS G:POP ERR^ENSA3
29 I $D(IO("Q")) K IO("Q") S ZTIO=ION,ZTRTN="CONT^ENSA",ZTDESC="Upload from MedTester",ZTSAVE("EN*")="",ZTSAVE("DT")="" D ^%ZTLOAD K ZTSK D HOME^%ZIS G EXIT1^ENSA3
30CONT D PROCS^ENSA1
31 G EXIT
32HOLD W !,"Press <RETURN> to continue..." R X:DTIME
33 Q
34MSGXTD ;Extended help text
35 W !!,"If MedTester is being used in conjunction with a specific Preventive",!,"Maintenance worklist, you should answer 'YES' to this question. You will then"
36 W !,"be asked to identify the worklist."
37 W !!,"If you say 'NO' at this point, safety tests stored in the MedTester will be",!,"posted to the Equipment Histories without affecting a PM worklist in any",!,"way.",! D HOLD
38 Q
39EXIT ;
40 G EXIT^ENSA3
41 ;ENSA
Note: See TracBrowser for help on using the repository browser.