IBOUTL ;ALB/AAS - INTEGRATED BILLING OUTPUT UTILITY ROUTINE ; 8-MAR-91
;;Version 2.0 ; INTEGRATED BILLING ;; 21-MAR-94
;
DATE ;
; -get beginning and ending dates
; -output in ibbdt - beginning date
; ibedt - ending date
;
BDT ; -get beginning date
S (IBBDT,IBEDT)=""
S %DT="AEX",%DT("A")="Start with DATE: " D ^%DT K %DT G DATEQ:Y<0 S IBBDT=Y
;
EDT ; -get ending date
S %DT="EX" R !,"Go to DATE: ",X:DTIME S:X=" " X=IBBDT G DATEQ:(X="")!(X["^") D ^%DT G EDT:Y<0 S IBEDT=Y I Y<IBBDT W *7," ??",!,"ENDING DATE must follow BEGINNING DATE." G BDT
;
DATEQ K %DT
Q
;
PAUSE Q:$E(IOST,1,2)'["C-"
F IBJ=$Y:1:(IOSL-4) W !
S DIR(0)="E" D ^DIR K DIR I $D(DIRUT)!($D(DUOUT)) S IBQUIT=1 K DIRUT,DTOUT,DUOUT
Q
;
DAT1(X,Y) ; Convert FM date to displayable (mm/dd/yy) format.
; -- optional output of time, if $g(y)
N DATE,T
S DATE=$S(X:$E(X,4,5)_"/"_$E(X,6,7)_"/"_$E(X,2,3),1:"")
I $G(Y) S T="."_$E($P(X,".",2)_"000000",1,7) I T>0 S DATE=DATE_" "_$S($E(T,2,3)>12:$E(T,2,3)-12,$E(T,2,3)="00":"00",1:+$E(T,2,3))_":"_$E(T,4,5)_$S($E(T,2,5)>1200:" pm",1:" am")
Q DATE
;
DAT2(Y) ; Convert FM date to displayable (mmm dd yyyy) format
N %
Q:'$D(Y) "" D D^DIQ
Q Y
;
ACTNM(X) ; -input pointer to action type file (350.1)
; output printable name of action type
S Y=$P($G(^IBE(350.1,+X,0)),"^",9) ;new action type
Q $S($P($G(^IBE(350.1,+Y,0)),"^",8)]"":$P(^(0),"^",8),$P($G(^IBE(350.1,+X,0)),"^",8)]"":$P(^(0),"^",8),1:$P($G(^IBE(350.1,+X,0)),"^"))
;
STOP(JOBDESC) ; Has a tasked job been requested to stop by the user?
; Input: JOBDESC -- Description of job to be printed
; Output: 0 -- Job has not been stopped
; 1 -- Job has been stopped
;
; If the job HAS been requested to stop, the Taskman flag ZTSTOP is
; set to 1. The check 'I $G(ZTSTOP)' can also be used in application
; code after calling this function, in the event that the function
; call is deeply nested.
;
I $D(ZTQUEUED),$$S^%ZTLOAD S ZTSTOP=1 W !!?5,"'"_$S($D(JOBDESC):JOBDESC,1:"Unknown Task")_"' stopped at user's request..."
Q $G(ZTSTOP)
IBOUTL ;ALB/AAS - INTEGRATED BILLING OUTPUT UTILITY ROUTINE ; 8-MAR-91
+1 ;;Version 2.0 ; INTEGRATED BILLING ;; 21-MAR-94
+2 ;
DATE ;
+1 ; -get beginning and ending dates
+2 ; -output in ibbdt - beginning date
+3 ; ibedt - ending date
+4 ;
BDT ; -get beginning date
+1 SET (IBBDT,IBEDT)=""
+2 SET %DT="AEX"
SET %DT("A")="Start with DATE: "
DO ^%DT
KILL %DT
IF Y<0
GOTO DATEQ
SET IBBDT=Y
+3 ;
EDT ; -get ending date
+1 SET %DT="EX"
READ !,"Go to DATE: ",X:DTIME
IF X=" "
SET X=IBBDT
IF (X="")!(X["^")
GOTO DATEQ
DO ^%DT
IF Y<0
GOTO EDT
SET IBEDT=Y
IF Y<IBBDT
WRITE *7," ??",!,"ENDING DATE must follow BEGINNING DATE."
GOTO BDT
+2 ;
DATEQ KILL %DT
+1 QUIT
+2 ;
PAUSE IF $EXTRACT(IOST,1,2)'["C-"
QUIT
+1 FOR IBJ=$Y:1:(IOSL-4)
WRITE !
+2 SET DIR(0)="E"
DO ^DIR
KILL DIR
IF $DATA(DIRUT)!($DATA(DUOUT))
SET IBQUIT=1
KILL DIRUT,DTOUT,DUOUT
+3 QUIT
+4 ;
DAT1(X,Y) ; Convert FM date to displayable (mm/dd/yy) format.
+1 ; -- optional output of time, if $g(y)
+2 NEW DATE,T
+3 SET DATE=$SELECT(X:$EXTRACT(X,4,5)_"/"_$EXTRACT(X,6,7)_"/"_$EXTRACT(X,2,3),1:"")
+4 IF $GET(Y)
SET T="."_$EXTRACT($PIECE(X,".",2)_"000000",1,7)
IF T>0
SET DATE=DATE_" "_$SELECT($EXTRACT(T,2,3)>12:$EXTRACT(T,2,3)-12,$EXTRACT(T,2,3)="00":"00",1:+$EXTRACT(T,2,3))_":"_$EXTRACT(T,4,5)_$SELECT($EXTRACT(T,2,5)>1200:" pm",1:" am")
+5 QUIT DATE
+6 ;
DAT2(Y) ; Convert FM date to displayable (mmm dd yyyy) format
+1 NEW %
+2 IF '$DATA(Y)
QUIT ""
DO D^DIQ
+3 QUIT Y
+4 ;
ACTNM(X) ; -input pointer to action type file (350.1)
+1 ; output printable name of action type
+2 ;new action type
SET Y=$PIECE($GET(^IBE(350.1,+X,0)),"^",9)
+3 QUIT $SELECT($PIECE($GET(^IBE(350.1,+Y,0)),"^",8)]"":$PIECE(^(0),"^",8),$PIECE($GET(^IBE(350.1,+X,0)),"^",8)]"":$PIECE(^(0),"^",8),1:$PIECE($GET(^IBE(350.1,+X,0)),"^"))
+4 ;
STOP(JOBDESC) ; Has a tasked job been requested to stop by the user?
+1 ; Input: JOBDESC -- Description of job to be printed
+2 ; Output: 0 -- Job has not been stopped
+3 ; 1 -- Job has been stopped
+4 ;
+5 ; If the job HAS been requested to stop, the Taskman flag ZTSTOP is
+6 ; set to 1. The check 'I $G(ZTSTOP)' can also be used in application
+7 ; code after calling this function, in the event that the function
+8 ; call is deeply nested.
+9 ;
+10 IF $DATA(ZTQUEUED)
IF $$S^%ZTLOAD
SET ZTSTOP=1
WRITE !!?5,"'"_$SELECT($DATA(JOBDESC):JOBDESC,1:"Unknown Task")_"' stopped at user's request..."
+11 QUIT $GET(ZTSTOP)