AMEROUT5 ; IHS/ANMC/GIS - HOURLY WORKLOAD DISPLAY DRIVER ;
;;3.0;ER VISIT SYSTEM;;FEB 23, 2009
;
CRT ; DISPLAY THE REPORT ON A CRT
N T,OCXI,X
W @IOF,!?20,"***** HOURLY WORKLOAD REPORT *****",!!
S (OCXI,T)=0 F S OCXI=$O(^TMP("AMER PRINT",$J,OCXI)) Q:'OCXI S X=^(OCXI) D I T Q
. I X="<>" S T=$$READ(X) W ! Q
. W X,!
. Q
S T=$$READ("<>")
Q
;
READ(X) ; END OF PAGE
N %
S DIR(0)="E",DIR("A")=X
D ^DIR I $D(DUOUT)!$D(DTOUT) K DIR,Y,DUOUT Q 1
W *13,?79,*13
Q 0
;
ZIS ;ENTRY POINT FROM AMEROUT4
; ASK USER FOR DEVICE
N POP,%ZIS,ZTRTN,ZTIO,ZTDESC,ZTSAVE,ZTSK
S %ZIS="Q",%ZIS("A")="Print HOURLY WORKLOAD TOTALS on which device: "
D ^%ZIS I POP S AMERQUIT=1 Q
I '$D(IO("Q")),IOST["C-" D CRT Q
I $D(IO("Q")) S ZTRTN="OUTPUT^AMEROUT5",ZTIO=ION,ZTDESC="Print patient instructions for ER system",ZTSAVE("^TMP(""AMER PRINT"",$J,")="" D ^%ZTLOAD I 1
I W !!,$S($D(ZTSK):"Request queued!",1:"Unable to queue job. Request cancelled!") D ^%ZISC Q
U IO
D OUTPUT
Q
;
OUTPUT ; PRINT INSTRUCTIONS
N OCXI,X,T
W !?20,"***** HOURLY WORKLOAD REPORT *****",!!
S (OCXI,T)=0 F S OCXI=$O(^TMP("AMER PRINT",$J,OCXI)) Q:'OCXI S X=^(OCXI) D
. I X="<>" W !! W:T @IOF S T='T Q
. W X,!
. Q
I 'T W @IOF
D EXIT^AMEROUT4
I $D(ZTQUEUED) S ZTREQ="@" Q
D ^%ZISC
Q
;
FILTER ;ENTRY POINT FROM AMEROUT4
; FILTER OUT INVALID TIME VALUES
N %
W !!!,"Some of the times recorded in the database may be invalid; i.e., negative or",!,"excessively long intervals.",!,"Want to FILTER out data which is likely to be invalid"
S %=2 D YN^DICN
I %=-1 Q
I %=1 S AMERFLTR=1
W !!
Q
AMEROUT5 ; IHS/ANMC/GIS - HOURLY WORKLOAD DISPLAY DRIVER ;
+1 ;;3.0;ER VISIT SYSTEM;;FEB 23, 2009
+2 ;
CRT ; DISPLAY THE REPORT ON A CRT
+1 NEW T,OCXI,X
+2 WRITE @IOF,!?20,"***** HOURLY WORKLOAD REPORT *****",!!
+3 SET (OCXI,T)=0
FOR
SET OCXI=$ORDER(^TMP("AMER PRINT",$JOB,OCXI))
IF 'OCXI
QUIT
SET X=^(OCXI)
Begin DoDot:1
+4 IF X="<>"
SET T=$$READ(X)
WRITE !
QUIT
+5 WRITE X,!
+6 QUIT
End DoDot:1
IF T
QUIT
+7 SET T=$$READ("<>")
+8 QUIT
+9 ;
READ(X) ; END OF PAGE
+1 NEW %
+2 SET DIR(0)="E"
SET DIR("A")=X
+3 DO ^DIR
IF $DATA(DUOUT)!$DATA(DTOUT)
KILL DIR,Y,DUOUT
QUIT 1
+4 WRITE *13,?79,*13
+5 QUIT 0
+6 ;
ZIS ;ENTRY POINT FROM AMEROUT4
+1 ; ASK USER FOR DEVICE
+2 NEW POP,%ZIS,ZTRTN,ZTIO,ZTDESC,ZTSAVE,ZTSK
+3 SET %ZIS="Q"
SET %ZIS("A")="Print HOURLY WORKLOAD TOTALS on which device: "
+4 DO ^%ZIS
IF POP
SET AMERQUIT=1
QUIT
+5 IF '$DATA(IO("Q"))
IF IOST["C-"
DO CRT
QUIT
+6 IF $DATA(IO("Q"))
SET ZTRTN="OUTPUT^AMEROUT5"
SET ZTIO=ION
SET ZTDESC="Print patient instructions for ER system"
SET ZTSAVE("^TMP(""AMER PRINT"",$J,")=""
DO ^%ZTLOAD
IF 1
+7 IF $TEST
WRITE !!,$SELECT($DATA(ZTSK):"Request queued!",1:"Unable to queue job. Request cancelled!")
DO ^%ZISC
QUIT
+8 USE IO
+9 DO OUTPUT
+10 QUIT
+11 ;
OUTPUT ; PRINT INSTRUCTIONS
+1 NEW OCXI,X,T
+2 WRITE !?20,"***** HOURLY WORKLOAD REPORT *****",!!
+3 SET (OCXI,T)=0
FOR
SET OCXI=$ORDER(^TMP("AMER PRINT",$JOB,OCXI))
IF 'OCXI
QUIT
SET X=^(OCXI)
Begin DoDot:1
+4 IF X="<>"
WRITE !!
IF T
WRITE @IOF
SET T='T
QUIT
+5 WRITE X,!
+6 QUIT
End DoDot:1
+7 IF 'T
WRITE @IOF
+8 DO EXIT^AMEROUT4
+9 IF $DATA(ZTQUEUED)
SET ZTREQ="@"
QUIT
+10 DO ^%ZISC
+11 QUIT
+12 ;
FILTER ;ENTRY POINT FROM AMEROUT4
+1 ; FILTER OUT INVALID TIME VALUES
+2 NEW %
+3 WRITE !!!,"Some of the times recorded in the database may be invalid; i.e., negative or",!,"excessively long intervals.",!,"Want to FILTER out data which is likely to be invalid"
+4 SET %=2
DO YN^DICN
+5 IF %=-1
QUIT
+6 IF %=1
SET AMERFLTR=1
+7 WRITE !!
+8 QUIT