SROQT ;BIR/ADM - QTRLY RPT MESSAGE TO SERVER ;07/18/07
;;3.0; Surgery ;**38,43,62,67,70,77,50,95,123,126,129,153,160,163**;24 Jun 93;Build 2
;** NOTICE: This routine is part of an implementation of a nationally
;** controlled procedure. Local modifications to this routine
;** are prohibited.
;
S SRD=^XMB("NETNAME"),ISC=0 I $E(SRD,1,3)="FO-"!(SRD["ISC-")!(SRD["ISC.")!(SRD["FORUM")!(SRD["TST")!(SRD[".FO-") S ISC=1
K ^TMP("SRQTR",$J),^TMP("SRATT",$J) N SRDIV S SRDIV=$P($$SITE^SROVAR,"^",3)_$S(SRIEN:"-"_SRIEN,1:"")
S SRSMO=$E(SRSTART,4,5),SRQTR=$S(SRSMO=10:1,SRSMO="01":2,SRSMO="04":3,1:4),SRFYR=$S(SRQTR=1:$E(SRSTART,1,3)+1,1:$E(SRSTART,1,3))+1700,SRFQ=SRFYR_SRQTR
S SRNODE=SRDIV_"^1^"_SRFQ_"^"_DT_"^"_SRCASES_"^"_SRMAJOR_"^"_SRMORT_"^"_SRCOMP_"^"_SRINPAT_"^"_SREMERG_"^"_SR60 F I=1:1:7 S SRNODE=SRNODE_"^"_SRASA(I)
S SRNODE=SRNODE_"^"_SROPD_"^"_SRINV("O")_"^"_SRINV("I")_"^"_SRADMT
I SRIEN S SRNODE=SRNODE_"^"_SRINST_"^"_SRSTATN
S ^TMP("SRQTR",$J,1)=SRNODE
SP S SRNODE=SRDIV_"^2" F SRSS=50:1:55 S SRNODE=SRNODE_"^"_^TMP("SRSS",$J,SRSS)
S ^TMP("SRQTR",$J,2)=SRNODE
S SRNODE=SRDIV_"^3" F SRSS=56:1:61 S SRNODE=SRNODE_"^"_^TMP("SRSS",$J,SRSS)
S ^TMP("SRQTR",$J,3)=SRNODE
S SRNODE=SRDIV_"^4" F SRSS=62,48,49,78,"ZZ" S SRNODE=SRNODE_"^"_^TMP("SRSS",$J,SRSS)
S ^TMP("SRQTR",$J,4)=SRNODE
IX S SRNODE=SRDIV_"^5" F J=1:1:6 D PROC
S SRNODE=SRNODE_"^^^" F J=9:1:12 D PROC
S ^TMP("SRQTR",$J,5)=SRNODE
COMP S SRNODE=SRDIV_"^6" F I=1:1:38 S SRNODE=SRNODE_"^"_SRC(I)
S ^TMP("SRQTR",$J,6)=SRNODE
RES S X="" F I=1:1:14,99 S X=X_$G(SRATT(I))_"^"
S ^TMP("SRATT",$J,"TOTAL")=X
F K="J","N" S X="" D
.F I=1:1:14,99 S X=X_$G(SRATT(K,I))_"^"
.S ^TMP("SRATT",$J,K)=X
S SRNODE=SRDIV_"^7^"_SRWC_"^"_$P(^TMP("SRATT",$J,"TOTAL"),"^",1,4)_"^"_$P(^TMP("SRATT",$J,"TOTAL"),"^",15)
S SRNODE=SRNODE_"^"_SRIN_"^"_$P(^TMP("SRATT",$J,"J"),"^",1,4)_"^"_$P(^TMP("SRATT",$J,"J"),"^",15)_"^"_$P(^TMP("SRATT",$J,"N"),"^",1,4)_"^"_$P(^TMP("SRATT",$J,"N"),"^",15)
S SRNODE=SRNODE_"^"_$P(^TMP("SRATT",$J,"TOTAL"),"^",5,8)_"^"_$P(^TMP("SRATT",$J,"J"),"^",5,8)_"^"_$P(^TMP("SRATT",$J,"N"),"^",5,8)
S ^TMP("SRQTR",$J,7)=SRNODE
HIP S SRNODE=SRDIV_"^8" F J=7,8 D PROC
S SRNODE=SRNODE_"^"_SRTOV_"^"_SRTONO_"^"_SRTONE_"^"_SRICY_"^"_SRICNO_"^"_SRICNR_"^"_SRICNE_"^"_SRSCY_"^"_SRSCNO_"^"_SRSCNR_"^"_SRSCNE
F I="C","D","N","P","S","U","O","ZZ" S SRNODE=SRNODE_"^"_SRHAIR(I)
S ^TMP("SRQTR",$J,8)=SRNODE
S SRNODE=SRDIV_"^9^"_$P(^TMP("SRATT",$J,"TOTAL"),"^",9,14)_"^"_$P(^TMP("SRATT",$J,"J"),"^",9,14)_"^"_$P(^TMP("SRATT",$J,"N"),"^",9,14)
S ^TMP("SRQTR",$J,9)=SRNODE
MSG ; create mail message to server
S X=$$ACTIVE^XUSER(DUZ) I '+X S XMDUZ=.5
S XMSUB="QUARTERLY REPORT - SURGICAL SERVICE"
K XMY I 'ISC S (XMY("S.SRCOSERV@FO-HINES.MED.VA.GOV"),XMY("G.SRCOSERV@FO-HINES.MED.VA.GOV"))=""
I ISC S XMY("G.SR-QUARTERLY@"_SRD)=""
S XMTEXT="^TMP(""SRQTR"",$J," N I D ^XMD K ^TMP("SRQTR",$J),XMY,XMTEXT
Q:SRIEN
MSG1 S XMY("G.SR-QUARTERLY@"_SRD)="",XMSUB="QUARTERLY REPORT TRANSMISSION"
S SRMSG(1)="The Quarterly Report for quarter #"_$E(SRFQ,5)_" of fiscal year "_$E(SRFQ,1,4)_" has been"
S SRMSG(2)="transmitted to the central database of Surgical Service, VHA Headquarters."
S XMTEXT="SRMSG(" N I D ^XMD K XMY,XMTEXT
D ^SROQM,SITE
Q
PROC S X=^TMP("SRPROC",$J,J),SRNODE=SRNODE_"^"_$P(X,"^")_"^"_$P(X,"^",3)_"^"_$P(X,"^",2)
Q
QUE ; queue creation of report to central database
W ! K %DT S %DT("A")="Queue report to run at what date/time ? ",%DT(0)="NOW",%DT("B")="NOW",%DT="AEFXT" D ^%DT I Y=-1 S SRSOUT=1 G END^SROQ
D TSK G END^SROQ
TSK S ZTDTH=Y,ZTIO="",ZTDESC="Surgery Quarterly Report",(ZTSAVE("SRSTART"),ZTSAVE("SREND"),ZTSAVE("SRFLG"),ZTSAVE("SRT"))="",ZTRTN="EN^SROQT" D ^%ZTLOAD
Q
EN ; entry point when queued to generate mail report only
K SRINSTP N SRDVSN,SRIEN,SRMULT S SRDVSN="",(SRCOUNT,SRIEN,SRMULT,X)=0 D
.F S X=$O(^SRO(133,X)) Q:'X I '$P($G(^SRO(133,X,0)),"^",21) S SRCOUNT=SRCOUNT+1,SRDVSN(X)=$P(^SRO(133,X,0),"^")
.I SRCOUNT>1 S SRMULT=1
D SET^SROQ2,SROQT I SRMULT D
.S SRIEN=0 F S SRIEN=$O(SRDVSN(SRIEN)) Q:'SRIEN D
..S SRINSTP=SRDVSN(SRIEN),SRINST=$$GET1^DIQ(4,SRINSTP,.01),SRSTATN=$$GET1^DIQ(4,SRINSTP,99)
..D SET^SROQ2,SROQT
F I="SRATT","SRDEATH","SRDPT","SRDREL","SRDTH","SREXP","SRINOUT","SRIOD","SRP","SRPROC","SRREL","SRSP","SRSS","SRTN" K ^TMP(I,$J)
S ZTREQ="@"
I SRQTR=2 D Q1 Q
I SRQTR=3 D Q2 Q
I SRQTR=4 D Q3
Q
SITE ; update site parameters file
S X=$E(SRSTART,4,7),Y=$S(X="1001":1,X="0101":2,X="0401":3,1:4),SRLATE=SRYR_Y
S SRE=0 F S SRE=$O(^SRO(133,SRE)) Q:'SRE I $P(^SRO(133,SRE,0),"^",18)<SRLATE S $P(^(0),"^",18)=SRLATE
DALERT ; delete alert
S XQAID="SRQTR-"_SRLATE,XQAKILL=0 D DELETEA^XQALERT
Q
NIGHT ; determine if current quarterly report has been transmitted
D CURRENT S SRYR=SRYR+1700,SRFQ=SRYR_SRQTR,SRE=0 S SRE=$O(^SRO(133,SRE)) I $P(^SRO(133,SRE,0),"^",18)'<SRFQ Q
S SRALERT=0 I SRDAY>206&(SRDAY<214)!(SRDAY>507&(SRDAY<515))!(SRDAY>806&(SRDAY<814))!(SRDAY>1106&(SRDAY<1114)) S SRALERT=1
D:SRALERT ALERT^SROQ1A D:'SRALERT AUTO
Q
CURRENT ; get current reporting quarter
S SRYR=$E(DT,1,3),SRDAY=$E(DT,4,7),SRQTR=4 I SRDAY>206 S SRQTR=$S(SRDAY<508:1,SRDAY<807:2,SRDAY<1107:3,1:4)
I SRQTR=4,SRDAY<207 S SRYR=SRYR-1
Q
DATES ; get start and end dates
S SRSMO=$S(SRQTR=1:"1001",SRQTR=2:"0101",SRQTR=3:"0401",1:"0701"),SREMO=$S(SRQTR=1:"1231",SRQTR=2:"0331",SRQTR=3:"0630",1:"0930"),SRSTART=$S(SRQTR=1:SRYR-1,1:SRYR)_SRSMO,SREND=$S(SRQTR=1:SRYR-1,1:SRYR)_SREMO
Q
VAR ; set report variables for non-interactive calls
D CURRENT,DATES S SRFLG=1
Q
AUTO ; automatic transmission of report
D VAR S (SRT,SRSOUT)=1 D NOW^%DTC S Y=$E(%,1,12) D TSK
Q
Q1 ; transmit report for 1st quarter
S (SRFLG,SRT)=1 D NOW^%DTC S SRNOW=+$E(%,1,12)
S SRYR=$E(SRSTART,1,3),SRYR=SRYR-1,SRSTART=SRYR_"1001",SREND=SRYR_"1231" D TSK1
Q
Q2 ; transmit report for 2nd quarter
S (SRFLG,SRT)=1 D NOW^%DTC S SRNOW=+$E(%,1,12)
S SRYR=$E(SRSTART,1,3),SRSTART=SRYR_"0101",SREND=SRYR_"0331" D TSK1
Q
Q3 ; transmit report for 3rd quarter
S (SRFLG,SRT)=1 D NOW^%DTC S SRNOW=+$E(%,1,12)
S SRYR=$E(SRSTART,1,3),SRSTART=SRYR_"0401",SREND=SRYR_"0630" D TSK1
Q
TSK1 S ZTDTH=SRNOW,ZTIO="",ZTDESC="Surgery Quarterly Report",(ZTSAVE("SRSTART"),ZTSAVE("SREND"),ZTSAVE("SRFLG"),ZTSAVE("SRT"))="",ZTRTN="EN^SROQT" D ^%ZTLOAD
Q
SROQT ;BIR/ADM - QTRLY RPT MESSAGE TO SERVER ;07/18/07
+1 ;;3.0; Surgery ;**38,43,62,67,70,77,50,95,123,126,129,153,160,163**;24 Jun 93;Build 2
+2 ;** NOTICE: This routine is part of an implementation of a nationally
+3 ;** controlled procedure. Local modifications to this routine
+4 ;** are prohibited.
+5 ;
+6 SET SRD=^XMB("NETNAME")
SET ISC=0
IF $EXTRACT(SRD,1,3)="FO-"!(SRD["ISC-")!(SRD["ISC.")!(SRD["FORUM")!(SRD["TST")!(SRD[".FO-")
SET ISC=1
+7 KILL ^TMP("SRQTR",$JOB),^TMP("SRATT",$JOB)
NEW SRDIV
SET SRDIV=$PIECE($$SITE^SROVAR,"^",3)_$SELECT(SRIEN:"-"_SRIEN,1:"")
+8 SET SRSMO=$EXTRACT(SRSTART,4,5)
SET SRQTR=$SELECT(SRSMO=10:1,SRSMO="01":2,SRSMO="04":3,1:4)
SET SRFYR=$SELECT(SRQTR=1:$EXTRACT(SRSTART,1,3)+1,1:$EXTRACT(SRSTART,1,3))+1700
SET SRFQ=SRFYR_SRQTR
+9 SET SRNODE=SRDIV_"^1^"_SRFQ_"^"_DT_"^"_SRCASES_"^"_SRMAJOR_"^"_SRMORT_"^"_SRCOMP_"^"_SRINPAT_"^"_SREMERG_"^"_SR60
FOR I=1:1:7
SET SRNODE=SRNODE_"^"_SRASA(I)
+10 SET SRNODE=SRNODE_"^"_SROPD_"^"_SRINV("O")_"^"_SRINV("I")_"^"_SRADMT
+11 IF SRIEN
SET SRNODE=SRNODE_"^"_SRINST_"^"_SRSTATN
+12 SET ^TMP("SRQTR",$JOB,1)=SRNODE
SP SET SRNODE=SRDIV_"^2"
FOR SRSS=50:1:55
SET SRNODE=SRNODE_"^"_^TMP("SRSS",$JOB,SRSS)
+1 SET ^TMP("SRQTR",$JOB,2)=SRNODE
+2 SET SRNODE=SRDIV_"^3"
FOR SRSS=56:1:61
SET SRNODE=SRNODE_"^"_^TMP("SRSS",$JOB,SRSS)
+3 SET ^TMP("SRQTR",$JOB,3)=SRNODE
+4 SET SRNODE=SRDIV_"^4"
FOR SRSS=62,48,49,78,"ZZ"
SET SRNODE=SRNODE_"^"_^TMP("SRSS",$JOB,SRSS)
+5 SET ^TMP("SRQTR",$JOB,4)=SRNODE
IX SET SRNODE=SRDIV_"^5"
FOR J=1:1:6
DO PROC
+1 SET SRNODE=SRNODE_"^^^"
FOR J=9:1:12
DO PROC
+2 SET ^TMP("SRQTR",$JOB,5)=SRNODE
COMP SET SRNODE=SRDIV_"^6"
FOR I=1:1:38
SET SRNODE=SRNODE_"^"_SRC(I)
+1 SET ^TMP("SRQTR",$JOB,6)=SRNODE
RES SET X=""
FOR I=1:1:14,99
SET X=X_$GET(SRATT(I))_"^"
+1 SET ^TMP("SRATT",$JOB,"TOTAL")=X
+2 FOR K="J","N"
SET X=""
Begin DoDot:1
+3 FOR I=1:1:14,99
SET X=X_$GET(SRATT(K,I))_"^"
+4 SET ^TMP("SRATT",$JOB,K)=X
End DoDot:1
+5 SET SRNODE=SRDIV_"^7^"_SRWC_"^"_$PIECE(^TMP("SRATT",$JOB,"TOTAL"),"^",1,4)_"^"_$PIECE(^TMP("SRATT",$JOB,"TOTAL"),"^",15)
+6 SET SRNODE=SRNODE_"^"_SRIN_"^"_$PIECE(^TMP("SRATT",$JOB,"J"),"^",1,4)_"^"_$PIECE(^TMP("SRATT",$JOB,"J"),"^",15)_"^"_$PIECE(^TMP("SRATT",$JOB,"N"),"^",1,4)_"^"_$PIECE(^TMP("SRATT",$JOB,"N"),"^",15)
+7 SET SRNODE=SRNODE_"^"_$PIECE(^TMP("SRATT",$JOB,"TOTAL"),"^",5,8)_"^"_$PIECE(^TMP("SRATT",$JOB,"J"),"^",5,8)_"^"_$PIECE(^TMP("SRATT",$JOB,"N"),"^",5,8)
+8 SET ^TMP("SRQTR",$JOB,7)=SRNODE
HIP SET SRNODE=SRDIV_"^8"
FOR J=7,8
DO PROC
+1 SET SRNODE=SRNODE_"^"_SRTOV_"^"_SRTONO_"^"_SRTONE_"^"_SRICY_"^"_SRICNO_"^"_SRICNR_"^"_SRICNE_"^"_SRSCY_"^"_SRSCNO_"^"_SRSCNR_"^"_SRSCNE
+2 FOR I="C","D","N","P","S","U","O","ZZ"
SET SRNODE=SRNODE_"^"_SRHAIR(I)
+3 SET ^TMP("SRQTR",$JOB,8)=SRNODE
+4 SET SRNODE=SRDIV_"^9^"_$PIECE(^TMP("SRATT",$JOB,"TOTAL"),"^",9,14)_"^"_$PIECE(^TMP("SRATT",$JOB,"J"),"^",9,14)_"^"_$PIECE(^TMP("SRATT",$JOB,"N"),"^",9,14)
+5 SET ^TMP("SRQTR",$JOB,9)=SRNODE
MSG ; create mail message to server
+1 SET X=$$ACTIVE^XUSER(DUZ)
IF '+X
SET XMDUZ=.5
+2 SET XMSUB="QUARTERLY REPORT - SURGICAL SERVICE"
+3 KILL XMY
IF 'ISC
SET (XMY("S.SRCOSERV@FO-HINES.MED.VA.GOV"),XMY("G.SRCOSERV@FO-HINES.MED.VA.GOV"))=""
+4 IF ISC
SET XMY("G.SR-QUARTERLY@"_SRD)=""
+5 SET XMTEXT="^TMP(""SRQTR"",$J,"
NEW I
DO ^XMD
KILL ^TMP("SRQTR",$JOB),XMY,XMTEXT
+6 IF SRIEN
QUIT
MSG1 SET XMY("G.SR-QUARTERLY@"_SRD)=""
SET XMSUB="QUARTERLY REPORT TRANSMISSION"
+1 SET SRMSG(1)="The Quarterly Report for quarter #"_$EXTRACT(SRFQ,5)_" of fiscal year "_$EXTRACT(SRFQ,1,4)_" has been"
+2 SET SRMSG(2)="transmitted to the central database of Surgical Service, VHA Headquarters."
+3 SET XMTEXT="SRMSG("
NEW I
DO ^XMD
KILL XMY,XMTEXT
+4 DO ^SROQM
DO SITE
+5 QUIT
PROC SET X=^TMP("SRPROC",$JOB,J)
SET SRNODE=SRNODE_"^"_$PIECE(X,"^")_"^"_$PIECE(X,"^",3)_"^"_$PIECE(X,"^",2)
+1 QUIT
QUE ; queue creation of report to central database
+1 WRITE !
KILL %DT
SET %DT("A")="Queue report to run at what date/time ? "
SET %DT(0)="NOW"
SET %DT("B")="NOW"
SET %DT="AEFXT"
DO ^%DT
IF Y=-1
SET SRSOUT=1
GOTO END^SROQ
+2 DO TSK
GOTO END^SROQ
TSK SET ZTDTH=Y
SET ZTIO=""
SET ZTDESC="Surgery Quarterly Report"
SET (ZTSAVE("SRSTART"),ZTSAVE("SREND"),ZTSAVE("SRFLG"),ZTSAVE("SRT"))=""
SET ZTRTN="EN^SROQT"
DO ^%ZTLOAD
+1 QUIT
EN ; entry point when queued to generate mail report only
+1 KILL SRINSTP
NEW SRDVSN,SRIEN,SRMULT
SET SRDVSN=""
SET (SRCOUNT,SRIEN,SRMULT,X)=0
Begin DoDot:1
+2 FOR
SET X=$ORDER(^SRO(133,X))
IF 'X
QUIT
IF '$PIECE($GET(^SRO(133,X,0)),"^",21)
SET SRCOUNT=SRCOUNT+1
SET SRDVSN(X)=$PIECE(^SRO(133,X,0),"^")
+3 IF SRCOUNT>1
SET SRMULT=1
End DoDot:1
+4 DO SET^SROQ2
DO SROQT
IF SRMULT
Begin DoDot:1
+5 SET SRIEN=0
FOR
SET SRIEN=$ORDER(SRDVSN(SRIEN))
IF 'SRIEN
QUIT
Begin DoDot:2
+6 SET SRINSTP=SRDVSN(SRIEN)
SET SRINST=$$GET1^DIQ(4,SRINSTP,.01)
SET SRSTATN=$$GET1^DIQ(4,SRINSTP,99)
+7 DO SET^SROQ2
DO SROQT
End DoDot:2
End DoDot:1
+8 FOR I="SRATT","SRDEATH","SRDPT","SRDREL","SRDTH","SREXP","SRINOUT","SRIOD","SRP","SRPROC","SRREL","SRSP","SRSS","SRTN"
KILL ^TMP(I,$JOB)
+9 SET ZTREQ="@"
+10 IF SRQTR=2
DO Q1
QUIT
+11 IF SRQTR=3
DO Q2
QUIT
+12 IF SRQTR=4
DO Q3
+13 QUIT
SITE ; update site parameters file
+1 SET X=$EXTRACT(SRSTART,4,7)
SET Y=$SELECT(X="1001":1,X="0101":2,X="0401":3,1:4)
SET SRLATE=SRYR_Y
+2 SET SRE=0
FOR
SET SRE=$ORDER(^SRO(133,SRE))
IF 'SRE
QUIT
IF $PIECE(^SRO(133,SRE,0),"^",18)<SRLATE
SET $PIECE(^(0),"^",18)=SRLATE
DALERT ; delete alert
+1 SET XQAID="SRQTR-"_SRLATE
SET XQAKILL=0
DO DELETEA^XQALERT
+2 QUIT
NIGHT ; determine if current quarterly report has been transmitted
+1 DO CURRENT
SET SRYR=SRYR+1700
SET SRFQ=SRYR_SRQTR
SET SRE=0
SET SRE=$ORDER(^SRO(133,SRE))
IF $PIECE(^SRO(133,SRE,0),"^",18)'<SRFQ
QUIT
+2 SET SRALERT=0
IF SRDAY>206&(SRDAY<214)!(SRDAY>507&(SRDAY<515))!(SRDAY>806&(SRDAY<814))!(SRDAY>1106&(SRDAY<1114))
SET SRALERT=1
+3 IF SRALERT
DO ALERT^SROQ1A
IF 'SRALERT
DO AUTO
+4 QUIT
CURRENT ; get current reporting quarter
+1 SET SRYR=$EXTRACT(DT,1,3)
SET SRDAY=$EXTRACT(DT,4,7)
SET SRQTR=4
IF SRDAY>206
SET SRQTR=$SELECT(SRDAY<508:1,SRDAY<807:2,SRDAY<1107:3,1:4)
+2 IF SRQTR=4
IF SRDAY<207
SET SRYR=SRYR-1
+3 QUIT
DATES ; get start and end dates
+1 SET SRSMO=$SELECT(SRQTR=1:"1001",SRQTR=2:"0101",SRQTR=3:"0401",1:"0701")
SET SREMO=$SELECT(SRQTR=1:"1231",SRQTR=2:"0331",SRQTR=3:"0630",1:"0930")
SET SRSTART=$SELECT(SRQTR=1:SRYR-1,1:SRYR)_SRSMO
SET SREND=$SELECT(SRQTR=1:SRYR-1,1:SRYR)_SREMO
+2 QUIT
VAR ; set report variables for non-interactive calls
+1 DO CURRENT
DO DATES
SET SRFLG=1
+2 QUIT
AUTO ; automatic transmission of report
+1 DO VAR
SET (SRT,SRSOUT)=1
DO NOW^%DTC
SET Y=$EXTRACT(%,1,12)
DO TSK
+2 QUIT
Q1 ; transmit report for 1st quarter
+1 SET (SRFLG,SRT)=1
DO NOW^%DTC
SET SRNOW=+$EXTRACT(%,1,12)
+2 SET SRYR=$EXTRACT(SRSTART,1,3)
SET SRYR=SRYR-1
SET SRSTART=SRYR_"1001"
SET SREND=SRYR_"1231"
DO TSK1
+3 QUIT
Q2 ; transmit report for 2nd quarter
+1 SET (SRFLG,SRT)=1
DO NOW^%DTC
SET SRNOW=+$EXTRACT(%,1,12)
+2 SET SRYR=$EXTRACT(SRSTART,1,3)
SET SRSTART=SRYR_"0101"
SET SREND=SRYR_"0331"
DO TSK1
+3 QUIT
Q3 ; transmit report for 3rd quarter
+1 SET (SRFLG,SRT)=1
DO NOW^%DTC
SET SRNOW=+$EXTRACT(%,1,12)
+2 SET SRYR=$EXTRACT(SRSTART,1,3)
SET SRSTART=SRYR_"0401"
SET SREND=SRYR_"0630"
DO TSK1
+3 QUIT
TSK1 SET ZTDTH=SRNOW
SET ZTIO=""
SET ZTDESC="Surgery Quarterly Report"
SET (ZTSAVE("SRSTART"),ZTSAVE("SREND"),ZTSAVE("SRFLG"),ZTSAVE("SRT"))=""
SET ZTRTN="EN^SROQT"
DO ^%ZTLOAD
+1 QUIT