41 lines
2.4 KiB
Mathematica
41 lines
2.4 KiB
Mathematica
SOWKRFD ;B'HAM ISC/SAB-Routine to print Divisional Referral report ; 01 Feb 94 / 1:49 PM [ 08/05/94 8:01 AM ]
|
|
;;3.0; Social Work ;**17,31,35,53**;27 Apr 93
|
|
Q:'$D(SOWK)
|
|
S:$G(SOWKAB)'="ALL" SOWKFD=""
|
|
G:SOWKFD]"" ENQ
|
|
BEG I SOWKFD="" W ! S %DT="AEXP",%DT("A")="ALL CASES STARTING FROM: " D ^%DT G:"^"[X CLOS G:Y'>0 BEG S SOWKFD=Y
|
|
EN S %DT("A")="ALL CASES ENDING: " D ^%DT G:"^"[X CLOS G:Y'>0 EN S SOWKFB=Y
|
|
DEV ;
|
|
K ZTSK,OUT,%ZIS,IOP S SOWKION=ION,%ZIS="QM",%ZIS("B")="" D ^%ZIS K %ZIS I POP S IOP=SOWKION D ^%ZIS K IOP,SOWKION G CLOS
|
|
K SOWKION I $D(IO("Q")) S ZTDESC="SOCIAL WORK DIVISIONAL RESOURCES/REFERRALS REPORT",ZTRTN="ENQ^SOWKRFD" F G="SOWK","SOWKDIV","SOWKAB","SOWKFD","SOWKFB" S:$D(@G) ZTSAVE(G)=""
|
|
I K IO("Q") D ^%ZTLOAD I '$D(ZTSK) K G,%DT G CLOS Q
|
|
I $D(ZTSK) K G,%DT,ZTSK W !!,"Task Queued to Print",! G CLOS Q
|
|
ENQ ;CALCULATES TOTAL
|
|
S OUT=0
|
|
D CLE F I=0:0 S I=$O(^SOWK(650,I)) Q:'I S H=^SOWK(650,I,0) F C=0:0 S C=$O(^SOWK(650,I,1,C)) Q:'C I $P(H,"^",18)'<SOWKFD,$P(H,"^",5)=SOWKDIV,$P(H,"^",18)'>SOWKFB S W=$P(^SOWK(650,I,1,C,0),"^") D RES
|
|
;PRINT TOTALS
|
|
S:US PT=(US/US)*100 S:NU NPT=(NU/NU)*100
|
|
F O=0:0 S O=$O(^SOWK(653,O)) Q:'O S:US TP(O)=(US(O)/US)*100 S:NU NA(O)=(NU(O)/NU)*100
|
|
W:$Y @IOF D HDR
|
|
F I=0:0 S I=$O(^SOWK(653,I)) Q:'I!(OUT) D:($Y+5)>IOSL FF Q:OUT W !,$E($P(^SOWK(653,I,0),"^"),1,24),?25,$J(US(I),3,0),?36,$J(TP(I),3,0),?43,$J(NU(I),3,0),?54,$J(NA(I),3,0)
|
|
W:'OUT !,"TOTALS",?25,$J(US,3,0),?36,$J(PT,3,0),?43,$J(NU,3,0),?54,$J(NPT,3,0),!
|
|
CLOS I $E(IOST)["C",('$G(OUT)) R !,"Press <RETURN> to continue: ",SWXX:DTIME K SWXX W @IOF
|
|
W ! I $G(SOWKAB)'="ALL" W:$E(IOST)'["C" @IOF D ^%ZISC K SOWKAB,SOWKFD,SOWKFB
|
|
K X,NA,US,NU,H,NPT,PT,O,C,Y,US,TP,Q,POP,%DT,A,SWD,G,I,W D:$D(ZTSK) KILL^%ZTLOAD
|
|
Q
|
|
CLE S (PT,NPT,US,NU)=0
|
|
F I=0:0 S I=$O(^SOWK(653,I)) Q:'I S (NA(I),TP(I),US(I),NU(I))=0
|
|
Q
|
|
RES I $P(^SOWK(650,I,1,C,0),"^",3) S US(W)=US(W)+1,US=US+1 Q
|
|
S NU(W)=NU(W)+1,NU=NU+1
|
|
Q
|
|
HDR U IO W "COMPLETE SERVICE for DIVISION "_$P(^SOWK(650.1,SOWKDIV,0),"^"),!
|
|
W !,$E(SOWKFD,4,5)_"/"_$E(SOWKFD,6,7)_"/"_$E(SOWKFD,2,3)_" TO "_$E(SOWKFB,4,5)_"/"_$E(SOWKFB,6,7)_"/"_$E(SOWKFB,2,3),?30,"RESOURCES/REFERRALS",!!,?43,"UNABLE",!?45,"TO"
|
|
W !?25,"USED",?34,"PERCENT",?43,"ACCESS",?52,"PERCENT"
|
|
Q
|
|
FF ;check form length for 80 column screen printed reports
|
|
N SWXX
|
|
I $E(IOST)["C" R !!,"Press <RETURN> to continue or ""^"" to Quit",SWXX:DTIME I SWXX["^" S OUT=1 W @IOF Q
|
|
W @IOF D HDR
|
|
Q
|