source: WorldVistAEHR/trunk/r/INTERIM_MANAGEMENT_SUPPORT-ECT/ECTSNP.m@ 1111

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

initial load of WorldVistAEHR

File size: 2.9 KB
RevLine 
[613]1ECTSNP ;B'ham ISC/PTD-Inpatient Workload Trends by Fiscal Year ;01/29/91 08:00
2V ;;1.05;INTERIM MANAGEMENT SUPPORT;;
3 I '$D(^ECT(731)) W *7,!!?29,"OPTION IS UNAVAILABLE!",!,"The 'VAMC Management' File - #731 is not loaded on your system.",!! S XQUIT="" Q
4 I '$O(^ECT(731,0)) W *7,!!,"'VAMC Management' File - #731 has not been populated on your system.",!! S XQUIT="" Q
5 W !,"You may select the fiscal year RANGE for this report.",!,"(Up to 5 years of data may be displayed.)",!!,"Enter ONLY the 2 or 4 digit year!",!
6BYR S %DT="AE",%DT("A")="Enter BEGINNING fiscal year: ",%DT(0)=2700000 D ^%DT K %DT G:$D(DTOUT)!("^"[X) EXIT S BYRDA=$E(Y,1,3),BYR=$E(Y,2,3)
7EYR S %DT="AE",%DT("A")="Enter ENDING fiscal year: ",%DT(0)=BYRDA_"0000" D ^%DT K %DT G:$D(DTOUT)!("^"[X) EXIT S EYRDA=$E(Y,1,3),EYR=$E(Y,2,3)
8 I EYRDA-BYRDA>4 W *7,!!,"Only a 5 year range may be shown on one report!",!! K BYRDA,BYR,EYRDA,EYR,X,Y G BYR
9 S FLG=0 F YR=BYRDA:1:EYRDA I $D(^ECT(731,YR,30,0)) S FLG=1
10 I FLG=0 W *7,!!,"There is NO DATA in the file for the selected date range!",!! G EXIT
11DEV K %ZIS,IOP S %ZIS="QM",%ZIS("B")="" D ^%ZIS I POP W !,"NO DEVICE SELECTED OR REPORT PRINTED!" G EXIT
12 I $D(IO("Q")) K IO("Q") S ZTRTN="ENQ^ECTSNP",ZTDESC="Inpatient Workload Trends by Fiscal Year",ZTSAVE("BYRDA")="",ZTSAVE("EYRDA")=""
13 I D ^%ZTLOAD K ZTSK G EXIT
14 U IO
15 ;
16ENQ ;ENTRY POINT WHEN QUEUED
17 K ^TMP($J) S CNT=0 F YR=BYRDA:1:EYRDA S INP=0,CNT=CNT+1,(TOT(YR),TAF(YR))=0 F J=0:0 S INP=$O(^ECT(731,YR,30,INP)) Q:'INP S LCN=$P(^ECT(731,YR,30,INP,0),"^"),DSCH=$P(^(0),"^",3),^TMP($J,LCN,YR)=DSCH,TAF(YR)=$P(^ECT(731,YR,0),"^",2)
18 S PGCT=1,(INP,QFLG)="",$P(LN,"-",81)="" D HDR
19LCN F K=0:0 S INP=$O(^TMP($J,INP)) Q:INP="" D WRTLN G:QFLG EXIT
20WRTOT W !?34 F J=1:1:46 W "-"
21 W !?12,"TOTAL DISCHARGES:" S CT=0,INCR=9,COL=25 F YEAR=BYRDA:1:EYRDA S CT=CT+1,COL=COL+INCR S TOT=$P(TOT(YEAR),"^") W:CT'>CNT ?COL,$S(TOT=0:" NO DATA",1:$J(TOT,7))
22WRTAF W !!?9,"TOTAL ASSIGNED FTEE:" S CT=0,INCR=9,COL=25 F YEAR=BYRDA:1:EYRDA S CT=CT+1,COL=COL+INCR S TAF=$P(TAF(YEAR),"^") W:CT'>CNT ?COL,$S(TAF=0:"NO DATA",1:$J(TAF,8,3))
23 ;
24EXIT K ^TMP($J),%,%H,%I,BYR,BYRDA,CNT,COL,CT,DTOUT,DIR,DSCH,EYR,EYRDA,FLG,INCR,INP,J,K,LCN,LN,PGCT,POP,QFLG,TAF,TOT,X,Y,YEAR,YR,ZTDESC,ZTRTN,ZTSAVE,ZTSK
25 D ^%ZISC I IO="" S IOP="HOME" D ^%ZIS
26 Q
27 ;
28HDR ;PRINT REPORT MAIN HEADER
29 W @IOF,!?25,"VAMC INPATIENT WORKLOAD TRENDS",!?22,"DISCHARGES FROM FY: "_(1700+BYRDA)_" TO FY: "_(1700+EYRDA) D NOW^%DTC S Y=$E(%,1,12) X ^DD("DD") W !!?45,Y,?70,"PAGE ",PGCT S PGCT=PGCT+1
30 W !!?10,"LOCATION" S CT=0,INCR=9,COL=27 F YR=BYRDA:1:EYRDA S CT=CT+1,COL=COL+INCR W:CT'>CNT ?COL,"FY "_$E(((BYRDA-1)+CT),2,3)
31 W !,LN
32 Q
33 ;
34WRTLN D:$Y+5>IOSL PRTCHK Q:QFLG W !,INP S CT=0,INCR=9,COL=26
35 F YEAR=BYRDA:1:EYRDA S CT=CT+1,COL=COL+INCR D DSCH S TOT(YEAR)=TOT(YEAR)+DSCH W:CT'>CNT ?COL,$S(DSCH="":"NO DATA",1:$J(DSCH,6))
36 Q
37 ;
38DSCH I '$D(^TMP($J,INP,YEAR)) S DSCH="" Q
39 S DSCH=$P(^TMP($J,INP,YEAR),"^")
40 Q
41 ;
42PRTCHK I $E(IOST)="C" S DIR(0)="E" D ^DIR I Y=0 S QFLG=1 Q
43 D HDR
44 Q
45 ;
Note: See TracBrowser for help on using the repository browser.