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

SRORHRS.m

Go to the documentation of this file.
  1. SRORHRS ;B'HAM ISC/ADM - O.R. NORMAL WORKING HOURS ; [ 09/22/98 11:36 AM ]
  1. ;;3.0; Surgery ;**77,50**;24 Jun 93
  1. S SRSOUT=0 W @IOF,!,"Operating Room Normal Working Hours Report",!
  1. DATE W ! K %DT S %DT="AEPX",%DT("A")="Print normal working hours starting with which date ? " D ^%DT I Y<0 S SRSOUT=1 G END
  1. S SRSD=+Y
  1. W ! K %DT S %DT="AEPX",%DT("A")="Print normal working hours through which date ? " D ^%DT I Y<0 S SRSOUT=1 G END
  1. I Y<SRSD W !!,"The ending date must be more recent than the starting date." G DATE
  1. S SRED=+Y
  1. ROOMS ; all operating rooms ?
  1. S SROR="ALL" W @IOF,!,"Do you want to print the Operating Room Normal Working Hours Report for all",!,"operating rooms ? YES// " R SRYN:DTIME I SRYN["^" S SRSOUT=1 G END
  1. S SRYN=$E(SRYN) S:SRYN="" SRYN="Y"
  1. I "YyNn"'[SRYN W !!,"Enter RETURN if you want to print the normal working hours for every operating",!,"room, or 'NO' to print the report for one particular room.",!!,"Press RETURN to continue " R X:DTIME G ROOMS
  1. I "Yy"[SRYN G ZIS
  1. W ! K DIC S DIC("S")="I $$ORDIV^SROUTL0(+Y,$G(SRSITE(""DIV""))),('$P(^SRS(+Y,0),U,6))",DIC="^SRS(",DIC(0)="QEAMZ",DIC("A")="Print the report for which Operating Room ? " D ^DIC I Y<0 S SRSOUT=1 G END
  1. S SROR=+Y
  1. ZIS W ! K IOP,%ZIS,POP,IO("Q") S %ZIS("A")="Print the report on which Device: ",%ZIS="Q" D ^%ZIS G:POP END
  1. I $D(IO("Q")) K IO("Q") S ZTDESC="O.R. Normal Working Hours Report",ZTRTN="EN^SRORHRS",(ZTSAVE("SRSD"),ZTSAVE("SRED"),ZTSAVE("SROR"),ZTSAVE("SRSITE*"))="" D ^%ZTLOAD G END
  1. EN ; entry when queued
  1. N SRFRTO S Y=SRSD X ^DD("DD") S SRFRTO="FROM: "_Y_" TO: ",Y=SRED X ^DD("DD") S SRFRTO=SRFRTO_Y
  1. D ^SRORHRS0
  1. END I 'SRSOUT,$E(IOST)'="P" W !!,"Press RETURN to continue " R X:DTIME
  1. W:$E(IOST)="P" @IOF I $D(ZTQUEUED) K ^TMP("SR",$J) Q:$G(ZTSTOP) S ZTREQ="@" Q
  1. D ^%ZISC,^SRSKILL W @IOF
  1. Q
  1. HDR ; print heading
  1. I $D(ZTQUEUED) D ^SROSTOP I SRHALT S SRSOUT=1 Q
  1. I SRHDR,$E(IOST)'="P" W !!,"Press RETURN to continue " R X:DTIME I '$T!(X["^") S SRSOUT=1 Q
  1. W:$Y @IOF W ! W:$E(IOST)="P" ?(80-$L(SRINST)\2),SRINST,?76,"PAGE",!,?31,"SURGICAL SERVICE",?78,SRPAGE,! W ?22,"OPERATING ROOM NORMAL WORKING HOURS"
  1. W !,?(80-$L(SRFRTO)\2),SRFRTO
  1. W !!,$S(SROR="ALL":"OPERATING ROOM",1:"DATE"),?20,"START TIME",?35,"END TIME",?62,"TOTAL TIME",! F LINE=1:1:80 W "-"
  1. I SRHDR,SROR="ALL" W !,?31,"** "_SRDT_" **",!!
  1. I SROR'="ALL" W !,?(80-$L("** OPERATING ROOM: "_$P(^SC($P(^SRS(SROR,0),"^"),0),"^")_" **")\2),"** OPERATING ROOM: "_$P(^SC($P(^SRS(SROR,0),"^"),0),"^")_" **",!!
  1. S SRHDR=1,SRPAGE=SRPAGE+1
  1. Q