SDECF ;ALB/SAT - VISTA SCHEDULING RPCS ;JAN 15, 2016
;;5.3;Scheduling;**627**;Aug 13, 1993;Build 249
;
Q
;
MSG(DATA,PRE,POST) ;EP; -- writes line to device
NEW I,FORMAT
S FORMAT="" I $G(PRE)>0 F I=1:1:PRE S FORMAT=FORMAT_"!"
D EN^DDIOL(DATA,"",FORMAT)
I $G(POST)>0 F I=1:1:POST D EN^DDIOL("","","!")
Q
;
ZIS(X,BDGRTN,BDGDESC,BDGVAR,BDGDEV,BDGCOP) ;EP
; -- called to select device and send print
N ZTDESC,ZTDTH,ZTRTN,ZTSAVE
K %ZIS,IOP,POP,ZTIO
I X="F" D ;forced queuing; no user interaction
. S ZTIO=BDGDEV,ZTDTH=$H
I X'="F" D Q:'$D(IO("Q"))
. S %ZIS=X
. I $G(BDGDEV)]"" S %ZIS("B")=BDGDEV
. D ^%ZIS
. Q:POP
. Q:$D(IO("Q"))
. I $G(BDGCOP)>1 D Q
.. N J
.. F J=1:1:BDGCOP D @BDGRTN
. D @BDGRTN
I $G(BDGCOP)>1 D Q
. N K
. F K=1:1:BDGCOP D ;changed from k to j
.. K IO("Q") S ZTRTN=BDGRTN,ZTDESC=BDGDESC
.. I $G(BDGDTH)]"" S ZTDTH=BDGDTH ;if time is already put in then set to that
.. F I=1:1 S J=$P(BDGVAR,";",I) Q:J="" S ZTSAVE(J)=""
.. D ^%ZTLOAD
.. S BDGDTH=$G(ZTSK("D")) ;set time equal to what they put in the first time
.. K ZTSK
. D ^%ZISC
. K BDGDTH
K IO("Q") S ZTRTN=BDGRTN,ZTDESC=BDGDESC
F I=1:1 S J=$P(BDGVAR,";",I) Q:J="" S ZTSAVE(J)=""
D ^%ZTLOAD K ZTSK D ^%ZISC
Q
;
READ(TYPE,PROMPT,DEFAULT,HELP,SCREEN,DIRA) ;EP; calls reader, returns response
NEW DIR,Y,DIRUT,DLAYGO
S DIR(0)=TYPE
I $E(TYPE,1)="P",$P(TYPE,":",2)["L" S DLAYGO=+$P(TYPE,U,2)
I $D(SCREEN) S DIR("S")=SCREEN
I $G(PROMPT)]"" S DIR("A")=PROMPT
I $G(DEFAULT)]"" S DIR("B")=DEFAULT
I $D(HELP) S DIR("?")=HELP
I $D(DIRA(1)) S Y=0 F S Y=$O(DIRA(Y)) Q:Y="" S DIR("A",Y)=DIRA(Y)
D ^DIR
Q Y
;
TIME(DATE) ;EP returns time in 12:00 PM format for date send
Q $$UP^XLFSTR($E($$FMTE^XLFDT($E(DATE,1,12),"P"),14,21))
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HSDECF 1801 printed Oct 16, 2024@18:52:39 Page 2
SDECF ;ALB/SAT - VISTA SCHEDULING RPCS ;JAN 15, 2016
+1 ;;5.3;Scheduling;**627**;Aug 13, 1993;Build 249
+2 ;
+3 QUIT
+4 ;
MSG(DATA,PRE,POST) ;EP; -- writes line to device
+1 NEW I,FORMAT
+2 SET FORMAT=""
IF $GET(PRE)>0
FOR I=1:1:PRE
SET FORMAT=FORMAT_"!"
+3 DO EN^DDIOL(DATA,"",FORMAT)
+4 IF $GET(POST)>0
FOR I=1:1:POST
DO EN^DDIOL("","","!")
+5 QUIT
+6 ;
ZIS(X,BDGRTN,BDGDESC,BDGVAR,BDGDEV,BDGCOP) ;EP
+1 ; -- called to select device and send print
+2 NEW ZTDESC,ZTDTH,ZTRTN,ZTSAVE
+3 KILL %ZIS,IOP,POP,ZTIO
+4 ;forced queuing; no user interaction
IF X="F"
Begin DoDot:1
+5 SET ZTIO=BDGDEV
SET ZTDTH=$HOROLOG
End DoDot:1
+6 IF X'="F"
Begin DoDot:1
+7 SET %ZIS=X
+8 IF $GET(BDGDEV)]""
SET %ZIS("B")=BDGDEV
+9 DO ^%ZIS
+10 if POP
QUIT
+11 if $DATA(IO("Q"))
QUIT
+12 IF $GET(BDGCOP)>1
Begin DoDot:2
+13 NEW J
+14 FOR J=1:1:BDGCOP
DO @BDGRTN
End DoDot:2
QUIT
+15 DO @BDGRTN
End DoDot:1
if '$DATA(IO("Q"))
QUIT
+16 IF $GET(BDGCOP)>1
Begin DoDot:1
+17 NEW K
+18 ;changed from k to j
FOR K=1:1:BDGCOP
Begin DoDot:2
+19 KILL IO("Q")
SET ZTRTN=BDGRTN
SET ZTDESC=BDGDESC
+20 ;if time is already put in then set to that
IF $GET(BDGDTH)]""
SET ZTDTH=BDGDTH
+21 FOR I=1:1
SET J=$PIECE(BDGVAR,";",I)
if J=""
QUIT
SET ZTSAVE(J)=""
+22 DO ^%ZTLOAD
+23 ;set time equal to what they put in the first time
SET BDGDTH=$GET(ZTSK("D"))
+24 KILL ZTSK
End DoDot:2
+25 DO ^%ZISC
+26 KILL BDGDTH
End DoDot:1
QUIT
+27 KILL IO("Q")
SET ZTRTN=BDGRTN
SET ZTDESC=BDGDESC
+28 FOR I=1:1
SET J=$PIECE(BDGVAR,";",I)
if J=""
QUIT
SET ZTSAVE(J)=""
+29 DO ^%ZTLOAD
KILL ZTSK
DO ^%ZISC
+30 QUIT
+31 ;
READ(TYPE,PROMPT,DEFAULT,HELP,SCREEN,DIRA) ;EP; calls reader, returns response
+1 NEW DIR,Y,DIRUT,DLAYGO
+2 SET DIR(0)=TYPE
+3 IF $EXTRACT(TYPE,1)="P"
IF $PIECE(TYPE,":",2)["L"
SET DLAYGO=+$PIECE(TYPE,U,2)
+4 IF $DATA(SCREEN)
SET DIR("S")=SCREEN
+5 IF $GET(PROMPT)]""
SET DIR("A")=PROMPT
+6 IF $GET(DEFAULT)]""
SET DIR("B")=DEFAULT
+7 IF $DATA(HELP)
SET DIR("?")=HELP
+8 IF $DATA(DIRA(1))
SET Y=0
FOR
SET Y=$ORDER(DIRA(Y))
if Y=""
QUIT
SET DIR("A",Y)=DIRA(Y)
+9 DO ^DIR
+10 QUIT Y
+11 ;
TIME(DATE) ;EP returns time in 12:00 PM format for date send
+1 QUIT $$UP^XLFSTR($EXTRACT($$FMTE^XLFDT($EXTRACT(DATE,1,12),"P"),14,21))