source: FOIAVistA/tag/r/SURGERY-SR/SROPACT.m@ 1789

Last change on this file since 1789 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 1.9 KB
Line 
1SROPACT ;B'HAM ISC/MAM - DAILY ACTIVITY LOG ; [ 09/22/98 11:36 AM ]
2 ;;3.0; Surgery ;**77,50**;24 Jun 93
3 W @IOF,! S SRSOUT=0 K %DT
4 S %DT="AEPX",%DT("A")="Print the Report of Daily Activity for which Date ? " D ^%DT I Y<0 S SRSOUT=1 G END
5 S SRSD=+Y,SRINST=SRSITE("SITE")
6 D D^DIQ S SRDT1=Y S X1=SRSD,X2=1 D C^%DTC S SRET=X_".0559",Y=X,SRED=X_".9999" D D^DIQ S SRDT2=Y
7 W !!,"This report will include all cases started between "_SRDT1_" at 6:00 AM",!,"and "_SRDT2_" at 5:59 AM."
8 I $D(^XUSEC("SROCHIEF",+DUZ)) N SRINSTP S SRINST=$$INST^SROUTL0() G:SRINST="^" END S SRINSTP=$P(SRINST,U),SRINST=$S(SRINST["ALL DIVISIONS":SRINST,1:$P(SRINST,U,2))
9 K IOP,%ZIS,POP,IO("Q") S %ZIS("A")="Print the Report to which Device ? ",%ZIS="QM"
10 W !!,"It is designed to use a 132 column format.",! D ^%ZIS I POP S SRSOUT=1 G END
11 I $D(IO("Q")) K IO("Q") S ZTDESC="Report of Daily OR Activities",ZTRTN="EN^SROPACT",(ZTSAVE("SRET"),ZTSAVE("SRED"),ZTSAVE("SRSD"),ZTSAVE("SRINST"),ZTSAVE("SRSITE*"),ZTSAVE("SRINSTP"))="" D ^%ZTLOAD G END
12EN ; entry when queued
13 S Y=SRSD D D^DIQ S SRSDT=Y
14 U IO S SRSDATE=SRSD-.0001,SRST=SRSD_".06" K ^TMP("SRACT",$J)
15 F S SRSDATE=$O(^SRF("AC",SRSDATE)) Q:SRSDATE>SRED!('SRSDATE) S SRTN=0 F S SRTN=$O(^SRF("AC",SRSDATE,SRTN)) Q:'SRTN D:$D(^SRF(SRTN,0))
16 .I $D(^XUSEC("SROCHIEF",+DUZ)) I $$MANDIV^SROUTL0(SRINSTP,SRTN) D UTIL
17 .I '$D(^XUSEC("SROCHIEF",+DUZ)) I $$DIV^SROUTL0(SRTN) D UTIL
18 D ^SROPAC0
19END I $E(IOST)'="P",'SRSOUT W !!,"Press RETURN to continue " R X:DTIME
20 W:$E(IOST)="P" @IOF K ^TMP("SRACT",$J) I $D(ZTQUEUED) Q:$G(ZTSTOP) S ZTREQ="@" Q
21 K SRTN D ^SRSKILL D ^%ZISC W @IOF
22 Q
23UTIL ; set ^TMP("SRACT",$J)
24 I '$D(^SRF(SRTN,.2)) Q
25 I $P(^SRF(SRTN,.2),"^",10)="" Q
26 S SRTIMEIN=$P(^SRF(SRTN,.2),"^",10) Q:SRTIMEIN<SRST I SRTIMEIN>SRET Q
27 S SROR=$P(^SRF(SRTN,0),"^",2) S:'SROR SROR="OTHER"
28 I SROR S SROR=$P(^SRS(SROR,0),"^"),SROR=$P(^SC(SROR,0),"^")
29 S ^TMP("SRACT",$J,SROR,SRSDATE,SRTN)=""
30 Q
Note: See TracBrowser for help on using the repository browser.