RTCX ; GENERATED FROM 'RT PENDING REQUESTS' PRINT TEMPLATE (#478) ; 07/15/96 ; (FILE 190.1, MARGIN=132)
G BEGIN
D I Y=DITTO(C) S Y="" Q
S DITTO(C)=Y
Q
N W !
T W:$X ! I '$D(DIOT(2)),DN,$D(IOSL),$S('$D(DIWF):1,$P(DIWF,"B",2):$P(DIWF,"B",2),1:1)+$Y'<IOSL,$D(^UTILITY($J,1))#2,^(1)?1U1P1E.E X ^(1)
S DISTP=DISTP+1,DILCT=DILCT+1 D:'(DISTP#100) CSTP^DIO2
Q
DT I $G(DUZ("LANG"))>1,Y W $$OUT^DIALOGU(Y,"DD") Q
I Y W $P("JAN^FEB^MAR^APR^MAY^JUN^JUL^AUG^SEP^OCT^NOV^DEC",U,$E(Y,4,5))_" " W:Y#100 $J(Y#100\1,2)_"," W Y\10000+1700 W:Y#1 " "_$E(Y_0,9,10)_":"_$E(Y_"000",11,12) Q
W Y Q
M D @DIXX
Q
BEGIN ;
S:'$D(DN) DN=1 S DISTP=$G(DISTP),DILCT=$G(DILCT)
S X=$G(^RTV(190.1,D0,0)) D N:$X>0 Q:'DN W ?0 S Y=$P(X,U,1),C=1 D D S C=$P(^DD(190.1,.01,0),U,2) D Y^DIQ:Y S C="," W $E(Y,1,15)
S I(100)="^RT(",J(100)=190 S I(0,0)=D0 S DIP(1)=$S($D(^RTV(190.1,D0,0)):^(0),1:"") S X=$P(DIP(1),U,1),X=X S D(0)=+X S D0=D(0) I D0>0 D A1
G A1R
A1 ;
S I(200)="^DPT(",J(200)=2 S I(100,0)=D0 S DIP(101)=$S($D(^RT(D0,0)):^(0),1:"") S X=$P(DIP(101),U,9),X=X S D(0)=+X S D0=D(0) I D0>0 D A2
G A2R
A2 ;
D N:$X>16 Q:'DN W ?16 S DIP(201)=$S($D(^DPT(D0,0)):^(0),1:"") S X=$P(DIP(201),U,9),DIP(202)=X S X=6,DIP(203)=X S X=10,X=$E(DIP(202),DIP(203),X) K DIP K:DN Y S Y=X,C=2 D D S X=Y W X
Q
A2R ;
K J(200),I(200) S:$D(I(100,0)) D0=I(100,0)
S I(200)="^DIC(195.2,",J(200)=195.2 S I(100,0)=D0 S DIP(101)=$S($D(^RT(D0,0)):^(0),1:"") S X=$P(DIP(101),U,3),X=X S D(0)=+X S D0=D(0) I D0>0 D B2
G B2R
B2 ;
S X=$G(^DIC(195.2,D0,0)) D N:$X>22 Q:'DN W ?22,$E($P(X,U,2),1,3)
Q
B2R ;
K J(200),I(200) S:$D(I(100,0)) D0=I(100,0)
S DIP(101)=$S($D(^RT(D0,0)):^(0),1:"") S X=""_$P(DIP(101),U,7) K DIP K:DN Y W X
D N:$X>29 Q:'DN W ?29 S Y=D0 W:Y]"" $J(Y,10,0)
S X=$G(^RT(D0,"CL")) D N:$X>41 Q:'DN W ?41 S Y=$P(X,U,5) S C=$P(^DD(190,105,0),U,2) D Y^DIQ:Y S C="," W $E(Y,1,15)
S I(200)="^RTV(195.9,",J(200)=195.9 S I(100,0)=D0 S DIP(101)=$S($D(^RT(D0,"CL")):^("CL"),1:"") S X=$P(DIP(101),U,5),X=X S D(0)=+X S D0=D(0) I D0>0 D C2
G C2R
C2 ;
S X=$G(^RTV(195.9,D0,0)) D N:$X>59 Q:'DN W ?59,$E($P(X,U,7),1,15)
Q
C2R ;
K J(200),I(200) S:$D(I(100,0)) D0=I(100,0)
Q
A1R ;
K J(100),I(100) S:$D(I(0,0)) D0=I(0,0)
D N:$X>84 Q:'DN W ?84,$E(D0,1,9)
S X=$G(^RTV(190.1,D0,0)) D N:$X>95 Q:'DN W ?95 S Y=$P(X,U,5) S C=$P(^DD(190.1,5,0),U,2) D Y^DIQ:Y S C="," W $E(Y,1,15)
D N:$X>112 Q:'DN W ?112 S Y=$P(X,U,4) D DT
S:$D(RTCOUNT) RTCOUNT=RTCOUNT+1 K DIP K:DN Y
K Y
Q
HEAD ;
W !,?41,"CURRENT",?112,"DATE/TIME RECORD"
W !,?0,"NAME",?22,"TYPE",?35,"REC#",?41,"LOCATION",?59,"Phone/Room",?84,"REQ#",?95,"REQUESTOR",?112,"NEEDED"
W !,"------------------------------------------------------------------------------------------------------------------------------------",!!
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HRTCX 2792 printed Dec 13, 2024@02:33:48 Page 2
RTCX ; GENERATED FROM 'RT PENDING REQUESTS' PRINT TEMPLATE (#478) ; 07/15/96 ; (FILE 190.1, MARGIN=132)
+1 GOTO BEGIN
D IF Y=DITTO(C)
SET Y=""
QUIT
+1 SET DITTO(C)=Y
+2 QUIT
N WRITE !
T if $X
WRITE !
IF '$DATA(DIOT(2))
IF DN
IF $DATA(IOSL)
IF $SELECT('$DATA(DIWF):1,$PIECE(DIWF,"B",2):$PIECE(DIWF,"B",2),1:1)+$Y'<IOSL
IF $DATA(^UTILITY($JOB,1))#2
IF ^(1)?1U1P1E.E
XECUTE ^(1)
+1 SET DISTP=DISTP+1
SET DILCT=DILCT+1
if '(DISTP#100)
DO CSTP^DIO2
+2 QUIT
DT IF $GET(DUZ("LANG"))>1
IF Y
WRITE $$OUT^DIALOGU(Y,"DD")
QUIT
+1 IF Y
WRITE $PIECE("JAN^FEB^MAR^APR^MAY^JUN^JUL^AUG^SEP^OCT^NOV^DEC",U,$EXTRACT(Y,4,5))_" "
if Y#100
WRITE $JUSTIFY(Y#100\1,2)_","
WRITE Y\10000+1700
if Y#1
WRITE " "_$EXTRACT(Y_0,9,10)_":"_$EXTRACT(Y_"000",11,12)
QUIT
+2 WRITE Y
QUIT
M DO @DIXX
+1 QUIT
BEGIN ;
+1 if '$DATA(DN)
SET DN=1
SET DISTP=$GET(DISTP)
SET DILCT=$GET(DILCT)
+2 SET X=$GET(^RTV(190.1,D0,0))
if $X>0
DO N
if 'DN
QUIT
WRITE ?0
SET Y=$PIECE(X,U,1)
SET C=1
DO D
SET C=$PIECE(^DD(190.1,.01,0),U,2)
if Y
DO Y^DIQ
SET C=","
WRITE $EXTRACT(Y,1,15)
+3 SET I(100)="^RT("
SET J(100)=190
SET I(0,0)=D0
SET DIP(1)=$SELECT($DATA(^RTV(190.1,D0,0)):^(0),1:"")
SET X=$PIECE(DIP(1),U,1)
SET X=X
SET D(0)=+X
SET D0=D(0)
IF D0>0
DO A1
+4 GOTO A1R
A1 ;
+1 SET I(200)="^DPT("
SET J(200)=2
SET I(100,0)=D0
SET DIP(101)=$SELECT($DATA(^RT(D0,0)):^(0),1:"")
SET X=$PIECE(DIP(101),U,9)
SET X=X
SET D(0)=+X
SET D0=D(0)
IF D0>0
DO A2
+2 GOTO A2R
A2 ;
+1 if $X>16
DO N
if 'DN
QUIT
WRITE ?16
SET DIP(201)=$SELECT($DATA(^DPT(D0,0)):^(0),1:"")
SET X=$PIECE(DIP(201),U,9)
SET DIP(202)=X
SET X=6
SET DIP(203)=X
SET X=10
SET X=$EXTRACT(DIP(202),DIP(203),X)
KILL DIP
if DN
KILL Y
SET Y=X
SET C=2
DO D
SET X=Y
WRITE X
+2 QUIT
A2R ;
+1 KILL J(200),I(200)
if $DATA(I(100,0))
SET D0=I(100,0)
+2 SET I(200)="^DIC(195.2,"
SET J(200)=195.2
SET I(100,0)=D0
SET DIP(101)=$SELECT($DATA(^RT(D0,0)):^(0),1:"")
SET X=$PIECE(DIP(101),U,3)
SET X=X
SET D(0)=+X
SET D0=D(0)
IF D0>0
DO B2
+3 GOTO B2R
B2 ;
+1 SET X=$GET(^DIC(195.2,D0,0))
if $X>22
DO N
if 'DN
QUIT
WRITE ?22,$EXTRACT($PIECE(X,U,2),1,3)
+2 QUIT
B2R ;
+1 KILL J(200),I(200)
if $DATA(I(100,0))
SET D0=I(100,0)
+2 SET DIP(101)=$SELECT($DATA(^RT(D0,0)):^(0),1:"")
SET X=""_$PIECE(DIP(101),U,7)
KILL DIP
if DN
KILL Y
WRITE X
+3 if $X>29
DO N
if 'DN
QUIT
WRITE ?29
SET Y=D0
if Y]""
WRITE $JUSTIFY(Y,10,0)
+4 SET X=$GET(^RT(D0,"CL"))
if $X>41
DO N
if 'DN
QUIT
WRITE ?41
SET Y=$PIECE(X,U,5)
SET C=$PIECE(^DD(190,105,0),U,2)
if Y
DO Y^DIQ
SET C=","
WRITE $EXTRACT(Y,1,15)
+5 SET I(200)="^RTV(195.9,"
SET J(200)=195.9
SET I(100,0)=D0
SET DIP(101)=$SELECT($DATA(^RT(D0,"CL")):^("CL"),1:"")
SET X=$PIECE(DIP(101),U,5)
SET X=X
SET D(0)=+X
SET D0=D(0)
IF D0>0
DO C2
+6 GOTO C2R
C2 ;
+1 SET X=$GET(^RTV(195.9,D0,0))
if $X>59
DO N
if 'DN
QUIT
WRITE ?59,$EXTRACT($PIECE(X,U,7),1,15)
+2 QUIT
C2R ;
+1 KILL J(200),I(200)
if $DATA(I(100,0))
SET D0=I(100,0)
+2 QUIT
A1R ;
+1 KILL J(100),I(100)
if $DATA(I(0,0))
SET D0=I(0,0)
+2 if $X>84
DO N
if 'DN
QUIT
WRITE ?84,$EXTRACT(D0,1,9)
+3 SET X=$GET(^RTV(190.1,D0,0))
if $X>95
DO N
if 'DN
QUIT
WRITE ?95
SET Y=$PIECE(X,U,5)
SET C=$PIECE(^DD(190.1,5,0),U,2)
if Y
DO Y^DIQ
SET C=","
WRITE $EXTRACT(Y,1,15)
+4 if $X>112
DO N
if 'DN
QUIT
WRITE ?112
SET Y=$PIECE(X,U,4)
DO DT
+5 if $DATA(RTCOUNT)
SET RTCOUNT=RTCOUNT+1
KILL DIP
if DN
KILL Y
+6 KILL Y
+7 QUIT
HEAD ;
+1 WRITE !,?41,"CURRENT",?112,"DATE/TIME RECORD"
+2 WRITE !,?0,"NAME",?22,"TYPE",?35,"REC#",?41,"LOCATION",?59,"Phone/Room",?84,"REQ#",?95,"REQUESTOR",?112,"NEEDED"
+3 WRITE !,"------------------------------------------------------------------------------------------------------------------------------------",!!