Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: LRAC

LRAC.m

Go to the documentation of this file.
  1. LRAC ;SLC/DCM/MILW/JMC - CUMULATIVE REPORTS DRIVER ;2/20/91 08:33 ;
  1. ;;5.2;LAB SERVICE;**172**;Sep 27, 1994
  1. ;Routine has been change to handle separate file room scheduling.
  1. ;;Semi-automatic queuing of selected reports can occur by setting-up
  1. ;;an action type option: S LRX(x)="" D CLOCK^LRAC
  1. ;;Where 'x' is the internal number of the report desired.
  1. ;;Fields 200,201,202 of OPTION file should then be filled in.
  1. K DIC,LRX
  1. ;
  1. ;
  1. D ^LRPARAM ;---HOAK FOR PRINTER PROBLEMS
  1. ;
  1. R !,"Print ALL or SELECTED reports? ALL// ",X:DTIME S:X="" X="A" Q:".^"[X
  1. I "AaSs"'[$E(X) S X="?"
  1. I X["?" W !?5,"Enter 'S' for SELECTED reports ",!?18,"-or-",!?11,"'A' for ALL reports" G LRAC
  1. I "Ss"[$E(X,1) D Q:'$D(LRX)
  1. . W ! ; Allow user to select reports to print.
  1. . S DIC="^LAB(64.5,1,3,",DIC(0)="AEMQ",DIC("A")="Select REPORT NAME: "
  1. . ; Screen out file room reports if printing separate file room, use appropiate option.
  1. . I $P($G(^LAB(64.5,1,6)),U,2) S DIC("S")="I '$P($G(^LAB(64.5,1,3,Y,.1)),U,3)"
  1. . F D ^DIC Q:Y<1 S LRX(+Y)=""
  1. . K DIC W !
  1. S U="^" D DT^LRX
  1. S ZTRTN="CLOCK^LRAC",ZTIO="",ZTDESC="Laboratory cumulative report" S:$D(LRX) ZTSAVE("LRX*")="" D ^%ZTLOAD
  1. K LRX,X,ZTSK,ZTSAVE,ZTDESC,ZTIO,ZTRTN
  1. Q
  1. ;
  1. CLOCK S:$D(ZTQUEUED) ZTREQ="@" K ZTSK
  1. CL2 Q:'$D(^LAB(64.5,1,3))!($D(^LAC("LRAC","A")))
  1. S LRXLR="LRAC" S:'$D(LRPERM) LRPERM=0
  1. S LRFRSEP=$P($G(^LAB(64.5,1,6)),U,2) ; Set flag if printing separate file rooms.
  1. I $D(XRTL) S XRTN="LRAC" D T0^%ZOSV ; START RESPONSE TIMING LOG
  1. I '$D(LRDT) S %DT="",X="T-1" D ^%DT S LRDT=Y
  1. L +^LAB(64.5)
  1. ;---last date cime printed--\/
  1. S LRLDT=$P(^LAB(64.5,1,0),U,3)
  1. ;
  1. I $L(LRLDT) D:LRDT'=LRLDT ^LRACK
  1. S %DT="",X="T" D ^%DT S LRYDT=Y,U="^",LRBOT=$P(^LAB(64.5,1,0),U,2)
  1. I LRDT'=LRLDT D ENT^LRACKL S $P(^LAB(64.5,1,0),U,3)=LRDT,$P(^(0),U,7)=LRLDT
  1. L -^LAB(64.5) S LRRE=0
  1. I '$D(LRX) D CL3
  1. I $D(LRX) D CL4
  1. I $D(XRTL),$D(XTR0) S XRTN="LRAC" D T1^%ZOSV ;STOP RESPONSE TIME LOG
  1. K LRRE,LRX,LRXLR,X1,X2,Z
  1. Q
  1. CL3 ; Task "ALL" reports except file room if file room on separate schedule.
  1. S LRRPTN=0
  1. F S LRRPTN=$O(^LAB(64.5,1,3,LRRPTN)) Q:LRRPTN<1 D
  1. . S X=$G(^LAB(64.5,1,3,LRRPTN,.1)) Q:$P(X,U,2) ; Don't start "manual" reports.
  1. . I LRFRSEP,$P(X,U,3) Q ; Don't start "File Room" report if on separate schedule.
  1. . S IOP=$P(X,U,1) D:IOP'="" CL3A
  1. K LRBOT,LRDFN,LRDT,LRFRSEP,LRLDT,LRLLOC,LRNM,LRRPTN,LRYDT,X,Y,ZTSAVE,ZTSK
  1. Q
  1. ;
  1. CL3A ; Task the actual reports to run.
  1. N ZTIO ; Tasked jobs have ZTIO defined, want ZTLOAD to build from IO* variables.
  1. S %ZIS="N" D ^%ZIS I POP D ^%ZISC Q
  1. S ZTRTN="ENT^LRAC1",ZTDTH=$H,ZTDESC="Laboratory cumulative report" K ZTSK
  1. F I="LRPERM","LRXLR","LRDT","LRLDT","LRYDT","LRBOT","LRRE","LRRPTN" S ZTSAVE(I)=""
  1. D ^%ZTLOAD,^%ZISC
  1. Q
  1. ;
  1. CL4 ; Task selected reports.
  1. S LRRPTN=0
  1. F S LRRPTN=$O(^LAB(64.5,1,3,LRRPTN)) Q:LRRPTN<1 I $D(LRX(LRRPTN)) D
  1. . S X=$G(^LAB(64.5,1,3,LRRPTN,.1))
  1. . I LRFRSEP,$P(X,U,3) Q ; Don't start "File Room" report if on separate schedule.
  1. . S IOP=$P(X,U,1) D:IOP'="" CL3A
  1. K LRBOT,LRDFN,LRDT,LRFRSEP,LRLDT,LRLLOC,LRNM,LRRPTN,LRX,LRYDT,X,Y,ZTSAVE,ZTSK
  1. Q