ENEQPMS3 ;(WASH ISC)/DH-Sort PMI Worklist ;5.15.97
;;7.0;ENGINEERING;**35,42**;Aug 17, 1993
SPL0 ; For all entries?
N ENX,ENDX,X1,X2
SPL1 W !,"For all ",$S(ENSRT="E":"ENTRY NUMBERS",ENSRT="I":"LOCAL ID's",ENSRT="L":"LOCATIONS",ENSRT="C":"EQUIPMENT CATEGORIES",ENSRT="S":"SERVICES",1:"??")
S %=1,X="" D YN^DICN S:%<0 X="^" Q:%<0 I %<1 W !,"Please enter 'Y'es or 'N'o.",*7 G SPL1
I %=1 D Q
. S ENSRT("ALL")=1
. I ENSRT="L" D
.. S ENSRT("LOC","ALL")=1
.. S ENSRT("BY")="BWR" F X1="BLDG","WING","ROOM" S ENSRT(X1,"ALL")=""
.. I $D(^ENG(6928.3,"D")) S ENSRT("BY")="DBWR",ENSRT("DIV","ALL")=""
D @ENSRT
I '$D(ENSRT) S X=U Q ;Aborted location select
I ENSRT'="L",'($D(ENSRT("FR"))&$D(ENSRT("TO"))) G SPL1
Q
;
E ; Entry numbers
S DIC="^ENG(6914,",DIC(0)="AEQ",DIC("A")="Start with EQUIPMENT ENTRY NUMBER: "
D ^DIC K DIC("A") Q:$D(DTOUT)!($D(DUOUT))!(Y'>0)
S ENSRT("FR")=+Y
S DIC("A")="Go to ENTRY NUMBER (must be larger than "_ENSRT("FR")_"): " S DIC("S")="I $P(^(0),U)>ENSRT(""FR"")"
D ^DIC K DIC Q:$D(DTOUT)!($D(DUOUT))!(Y'>0)
S ENSRT("TO")=+Y
Q
;
I ; Local identifier
S DIC="^ENG(6914,",ENDX="L"
I11 R !,"Start with: ",X:DTIME Q:X="^"!(X="") S:X=" " X="?" G:$E(X)="?" I15
S X2=$L(X) I $D(^ENG(6914,"L",X)) S ENSRT("FR")=X G I2
I $E($O(^ENG(6914,"L",X)),1,X2)=X D IX^ENLIB1 G:X="" I11 Q:X="^" S ENSRT("FR")=X W " ",ENSRT("FR") G I2
S ENX=X,ENIX=0 I X?.N D IX^ENLIB1 Q:X="^" I $E(X,1,X2)=ENX S ENSRT("FR")=X W " ",ENSRT("FR") G I2
I 'ENIX W !,"No LOCAL IDENTIFIERS begin with: ",ENX
K ENIX
I15 W !,"Would you like a list of all LOCAL IDENTIFIERS" S %=1 D YN^DICN S:%<0 X="^" Q:%<0 G:%'=1 I11
S X="" D IX^ENLIB1 G:X="" I11 Q:X="^" S ENSRT("FR")=X W " ",ENSRT("FR")
I2 R !,"Go to: ",X:DTIME Q:X="^" I $E(X)="?" W !,"Please enter a character string which follows or equals",!,ENSRT("FR")," This string will be the end point of our search." G I2
I ENSRT("FR")]X W !,"This entry precedes ",ENSRT("FR"),".",*7 G I2
S ENSRT("TO")=X W !,"OK. Including everything from ",ENSRT("FR")," to ",ENSRT("TO"),"."
Q
;
L ; Location
D GEN^ENSPSRT
Q
;
C ; Equipment category
S DIC="^ENG(6911,",DIC(0)="AEMQ" D ^DIC Q:Y'>0 S (ENSRT("FR"),ENSRT("TO"))=+Y
Q
;
S ; Owning service
S DIC="^DIC(49,",DIC(0)="AEMQ" D ^DIC Q:Y'>0 S (ENSRT("FR"),ENSRT("TO"))=+Y
Q
;
CONT S:$D(ENY) ENY=0 R !!,"<cr> to continue, '^' to abort...",X:DTIME
Q
;ENEQPMS3
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HENEQPMS3 2435 printed Oct 16, 2024@17:53:44 Page 2
ENEQPMS3 ;(WASH ISC)/DH-Sort PMI Worklist ;5.15.97
+1 ;;7.0;ENGINEERING;**35,42**;Aug 17, 1993
SPL0 ; For all entries?
+1 NEW ENX,ENDX,X1,X2
SPL1 WRITE !,"For all ",$SELECT(ENSRT="E":"ENTRY NUMBERS",ENSRT="I":"LOCAL ID's",ENSRT="L":"LOCATIONS",ENSRT="C":"EQUIPMENT CATEGORIES",ENSRT="S":"SERVICES",1:"??")
+1 SET %=1
SET X=""
DO YN^DICN
if %<0
SET X="^"
if %<0
QUIT
IF %<1
WRITE !,"Please enter 'Y'es or 'N'o.",*7
GOTO SPL1
+2 IF %=1
Begin DoDot:1
+3 SET ENSRT("ALL")=1
+4 IF ENSRT="L"
Begin DoDot:2
+5 SET ENSRT("LOC","ALL")=1
+6 SET ENSRT("BY")="BWR"
FOR X1="BLDG","WING","ROOM"
SET ENSRT(X1,"ALL")=""
+7 IF $DATA(^ENG(6928.3,"D"))
SET ENSRT("BY")="DBWR"
SET ENSRT("DIV","ALL")=""
End DoDot:2
End DoDot:1
QUIT
+8 DO @ENSRT
+9 ;Aborted location select
IF '$DATA(ENSRT)
SET X=U
QUIT
+10 IF ENSRT'="L"
IF '($DATA(ENSRT("FR"))&$DATA(ENSRT("TO")))
GOTO SPL1
+11 QUIT
+12 ;
E ; Entry numbers
+1 SET DIC="^ENG(6914,"
SET DIC(0)="AEQ"
SET DIC("A")="Start with EQUIPMENT ENTRY NUMBER: "
+2 DO ^DIC
KILL DIC("A")
if $DATA(DTOUT)!($DATA(DUOUT))!(Y'>0)
QUIT
+3 SET ENSRT("FR")=+Y
+4 SET DIC("A")="Go to ENTRY NUMBER (must be larger than "_ENSRT("FR")_"): "
SET DIC("S")="I $P(^(0),U)>ENSRT(""FR"")"
+5 DO ^DIC
KILL DIC
if $DATA(DTOUT)!($DATA(DUOUT))!(Y'>0)
QUIT
+6 SET ENSRT("TO")=+Y
+7 QUIT
+8 ;
I ; Local identifier
+1 SET DIC="^ENG(6914,"
SET ENDX="L"
I11 READ !,"Start with: ",X:DTIME
if X="^"!(X="")
QUIT
if X=" "
SET X="?"
if $EXTRACT(X)="?"
GOTO I15
+1 SET X2=$LENGTH(X)
IF $DATA(^ENG(6914,"L",X))
SET ENSRT("FR")=X
GOTO I2
+2 IF $EXTRACT($ORDER(^ENG(6914,"L",X)),1,X2)=X
DO IX^ENLIB1
if X=""
GOTO I11
if X="^"
QUIT
SET ENSRT("FR")=X
WRITE " ",ENSRT("FR")
GOTO I2
+3 SET ENX=X
SET ENIX=0
IF X?.N
DO IX^ENLIB1
if X="^"
QUIT
IF $EXTRACT(X,1,X2)=ENX
SET ENSRT("FR")=X
WRITE " ",ENSRT("FR")
GOTO I2
+4 IF 'ENIX
WRITE !,"No LOCAL IDENTIFIERS begin with: ",ENX
+5 KILL ENIX
I15 WRITE !,"Would you like a list of all LOCAL IDENTIFIERS"
SET %=1
DO YN^DICN
if %<0
SET X="^"
if %<0
QUIT
if %'=1
GOTO I11
+1 SET X=""
DO IX^ENLIB1
if X=""
GOTO I11
if X="^"
QUIT
SET ENSRT("FR")=X
WRITE " ",ENSRT("FR")
I2 READ !,"Go to: ",X:DTIME
if X="^"
QUIT
IF $EXTRACT(X)="?"
WRITE !,"Please enter a character string which follows or equals",!,ENSRT("FR")," This string will be the end point of our search."
GOTO I2
+1 IF ENSRT("FR")]X
WRITE !,"This entry precedes ",ENSRT("FR"),".",*7
GOTO I2
+2 SET ENSRT("TO")=X
WRITE !,"OK. Including everything from ",ENSRT("FR")," to ",ENSRT("TO"),"."
+3 QUIT
+4 ;
L ; Location
+1 DO GEN^ENSPSRT
+2 QUIT
+3 ;
C ; Equipment category
+1 SET DIC="^ENG(6911,"
SET DIC(0)="AEMQ"
DO ^DIC
if Y'>0
QUIT
SET (ENSRT("FR"),ENSRT("TO"))=+Y
+2 QUIT
+3 ;
S ; Owning service
+1 SET DIC="^DIC(49,"
SET DIC(0)="AEMQ"
DO ^DIC
if Y'>0
QUIT
SET (ENSRT("FR"),ENSRT("TO"))=+Y
+2 QUIT
+3 ;
CONT if $DATA(ENY)
SET ENY=0
READ !!,"<cr> to continue, '^' to abort...",X:DTIME
+1 QUIT
+2 ;ENEQPMS3