IBOUTL ;ALB/AAS - INTEGRATED BILLING OUTPUT UTILITY ROUTINE ; 8-MAR-91
V ;;2.0;INTEGRATED BILLING;**93**;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
;
DAT3(X) ;Convert FM date to displayable (mm/dd/yyyy) format.
N DATE,YR
I $G(X) S YR=($E(X,1,3)+1700)
I $G(X) S DATE=$S(X:$E(X,4,5)_"/"_$E(X,6,7)_"/"_$G(YR),1:"")
Q $G(DATE)
;
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)
FY(DATE) ;Return FY for date, DT is default
NEW FY
S:$G(DATE)'?7N.E DATE=DT
S FY=$E(DATE,2,3) S:$E(DATE,4,5)>9 FY=FY+1 S:FY=100 FY="00"
S:$L(FY)<2 FY="0"_FY
Q FY
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HIBOUTL 2495 printed Oct 16, 2024@18:26:59 Page 2
IBOUTL ;ALB/AAS - INTEGRATED BILLING OUTPUT UTILITY ROUTINE ; 8-MAR-91
V ;;2.0;INTEGRATED BILLING;**93**;21-MAR-94
+1 ;
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 ;
DAT3(X) ;Convert FM date to displayable (mm/dd/yyyy) format.
+1 NEW DATE,YR
+2 IF $GET(X)
SET YR=($EXTRACT(X,1,3)+1700)
+3 IF $GET(X)
SET DATE=$SELECT(X:$EXTRACT(X,4,5)_"/"_$EXTRACT(X,6,7)_"/"_$GET(YR),1:"")
+4 QUIT $GET(DATE)
+5 ;
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)
FY(DATE) ;Return FY for date, DT is default
+1 NEW FY
+2 if $GET(DATE)'?7N.E
SET DATE=DT
+3 SET FY=$EXTRACT(DATE,2,3)
if $EXTRACT(DATE,4,5)>9
SET FY=FY+1
if FY=100
SET FY="00"
+4 if $LENGTH(FY)<2
SET FY="0"_FY
+5 QUIT FY