source: FOIAVistA/trunk/r/SOCIAL_WORK-SOW-SWBH-SWFG/SOWKLCD.m@ 632

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

initial load of FOIAVistA 6/30/08 version

File size: 2.3 KB
Line 
1SOWKLCD ;B'HAM ISC/SAB,DLR-DIVISIONAL LOCATION OF PATIENTS BY COST CENTERS REPORT ; 01 Feb 94 / 1:50 PM [ 01/31/96 2:22 PM ]
2 ;;3.0; Social Work ;**17,31,35,34,41,53**;27 Apr 93
3 Q:'$D(SOWK)
4 S:$G(SOWKAB)'="ALL" SOWKFD=""
5 G:SOWKFD]"" ENQ
6BEG I SOWKFD="" W ! S %DT="AEXP",%DT("A")="ALL CASES STARTING FROM: " D ^%DT G:"^"[X CLOS G:Y'>0 BEG S SOWKFD=Y
7EN S %DT("A")="ALL CASES ENDING: " D ^%DT G:"^"[X CLOS G:Y'>0 EN S SOWKFB=Y
8DEV ;
9 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
10 K SOWKION I $D(IO("Q")) S ZTDESC="SOCIAL WORK DIVISIONAL LOCATION OF PATIENTS BY COST CENTERS REPORT",ZTRTN="ENQ^SOWKLCD" F G="SOWK","SOWKDIV","SOWKFD","SOWKFB","SOWKAB" S ZTSAVE(G)=""
11 I K IO("Q") D ^%ZTLOAD I '$D(ZTSK) S OUT=1 K G,%DT,X,ZTSK Q
12 I $D(ZTSK) K G,ZTSK W !!,"Task Queued to Print",! Q
13ENQ ;CALCULATE TOTALS
14 S SWLP=0
15 F I=0:0 S I=$O(^SOWK(650,I)) Q:'I S A=^SOWK(650,I,0) D SAB
16 G PRI
17 Q
18SAB I $P(A,"^",2)'>SOWKFB,$P(A,"^",13),('$P(A,"^",18)!($P(A,"^",18)&($P(A,"^",18)'<SOWKFD))),$P(A,"^",5)=SOWK S SWAL=$P(A,"^",13),SWS(SWAL)=$S('$D(SWS(SWAL)):0,1:SWS(SWAL))+1,SWLP=SWLP+1
19 Q
20PRI ;PRINT TOTALS
21 I SWLP=0 G NR
22 W:$Y @IOF D HDR
23 F T=0:0 S T=$O(^SOWK(651,T)) Q:'T!($G(OUT1)=1) I $D(SWS(T)),'$P(^SOWK(651,T,0),"^",2) S B=^(0) D:($Y+10)>IOSL CHK Q:$G(OUT1)=1 D
24 .W !,$P(B,"^")_" ("_$P(B,"^",4)_")",?57,$J($S('$D(SWS(T)):0,1:SWS(T)),3,0),?63,$J($S('$D(SWS(T)):0,1:SWS(T))/SWLP*100,3,0)
25 I $G(OUT1)'=1 W !,"TOTAL",?57,$J(SWLP,3,0),?63,$S(SWLP:$J("100",3,0),1:$J(SWLP,3,0)),!
26CLOS I $E(IOST)["C",($G(OUT1)'=1) R !,"Press <RETURN> to continue: ",SWXX:DTIME K SWXX W @IOF
27 I $G(SOWKAB)'="ALL" W:$E(IOST)'["C" @IOF D ^%ZISC K SOWKAB,SOWKFB,SOWKFD,Y
28 K SWLP,SWAL,SWD,%DT,I,T,SWL,SWLB,A,B,IOP,POP,SWS,OUT,OUT1 D:$D(ZTSK) KILL^%ZTLOAD
29 Q
30NR U IO W *7,!,"THERE IS NOTHING TO REPORT FOR LOCATION OF PATIENTS BY COST CENTERS ",! G CLOS
31 Q
32HDR U IO W "COMPLETE SERVICE for DIVISION "_$P(^SOWK(650.1,SOWKDIV,0),"^"),!
33 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),?25,"LOCATION OF PATIENTS BY COST CENTERS",!!
34 W ?57,"NO.",?65,"%"
35 Q
36CHK ; page break
37 N SWXX
38 I $E(IOST)["C" R !,"Press <RETURN> to continue or ""^"" to Quit",SWXX:DTIME I SWXX["^" S OUT1=1 W @IOF Q
39 W @IOF D HDR
40 Q
Note: See TracBrowser for help on using the repository browser.