source: WorldVistAEHR/trunk/r/SOCIAL_WORK-SOW-SWBH-SWFG/SOWKLC.m@ 1306

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

initial load of WorldVistAEHR

File size: 3.5 KB
Line 
1SOWKLC ;B'HAM ISC/SAB,DLR-LOCATION OF PATIENTS BY COST CENTERS REPORT ; 02 Mar 94 / 9:50 AM [ 08/05/94 7:58 AM ]
2 ;;3.0; Social Work ;**17,25,30,31,35,53**;27 Apr 93
3 S:$G(SOWKAB)'="ALL" SOWKFD="" G:SOWKFD]"" ENQ
4BEG W ! S %DT="AEXP",%DT("A")="ALL CASES STARTING FROM: " D ^%DT G:"^"[X CLOS G:Y'>0 BEG S SOWKFD=Y
5EN S %DT("A")="ALL CASES ENDING: " D ^%DT G:"^"[X CLOS G:Y'>0 EN S SOWKFB=Y
6 F L=0:0 W !,"Do you want Complete Service " S %=2 D YN^DICN Q:% I %Y["?" D YN^SOWKHELP
7 I %=1 S SWA=1,SWB=0 G ACU
8 G:%=-1 CLOS F L=0:0 W !,"Do you want report by Supervisor " S %=2 D YN^DICN Q:% I %Y["?" D YN^SOWKHELP
9 I %=1 S SWB=1,SWA=0
10 G:%=2 SWW G:%=-1 CLOS S DIC="^VA(200,",DIC(0)="AEQ",DIC("A")="Enter Supervisor's last name: ",D="B",DIC("S")="I $D(^VA(200,""ASWC"",+Y))"
11 D IX^DIC G:"^"[X CLOS S SWZ=+Y K DIC G:Y'>0 CLOS G ACD
12SWW S DIC("S")="I $D(^VA(200,+Y,654)),$P(^VA(200,+Y,654),""^"")",DIC="^VA(200,",DIC(0)="AEQ",DIC("A")="Enter Social Worker's last name: "
13 D ^DIC G:"^"[X CLOS S SWZ=+Y K DIC G:Y'>0 CLOS S (SWA,SWB)=0 G ACB
14ACU ;CALCULATE TOTALS
15 D DEV I $D(ZTSK)!($D(OUT))!(POP) K ZTSK G CLOS
16ENQ Q:"^"[X
17EN1 G:SWB ENQ1 G:'SWA&'SWB ENQ2 S SWLP=0
18EN2 S SWLP=0 F I=0:0 S I=$O(^SOWK(650,I)) Q:'I S AA=^SOWK(650,I,0) D SAB
19CU ;PRINT TOTALS
20 I SWLP=0 G NR
21 W:$Y @IOF D HDR
22 F T=0:0 S T=$O(^SOWK(651,T)) Q:'T!($G(OUT1)=1) I $D(SW(T)),'$P(^SOWK(651,T,0),"^",2) S SWL=$P(^(0),"^") D CHK Q:$G(OUT1)=1 D
23 .W !,SWL_" ("_$P(^(0),"^",4)_")",?57,$J($S('$D(SW(T)):0,1:SW(T)),3,0),?63,$J($S('$D(SW(T)):0,1:SW(T))/SWLP*100,3,0)
24 D CHK Q:$G(OUT1)=1 W !!,"TOTAL",?57,$J(SWLP,3,0),?63,$S(SWLP:$J("100",3,0),1:$J(SWLP,3,0)),!
25CLOS I $E(IOST)["C",('$G(OUT1)) R !,"Press <RETURN> to continue: ",SWXX:DTIME K SWXX W @IOF
26 I $G(SOWKAB)'="ALL" W:$E(IOST)'["C" @IOF D ^%ZISC K A,Z,B,SOWKFB,SOWKFD,SOWKAB,SWA,SWB,SWZ,OUT1
27 K X,L,D,AA,%,%Y,SWLP,SWAL,SWD,%DT,I,T,SW,SWL,SWLB,IOP,POP,%ZIS,DIC,Y D:$D(ZTSK) KILL^%ZTLOAD
28 Q
29ACD D DEV I $D(ZTSK)!($D(OUT))!(POP) K ZTSK G CLOS
30ENQ1 ;
31 S SWLP=0
32 F I=0:0 S I=$O(^SOWK(650,I)) Q:'I S AA=^SOWK(650,I,0) I $P(^VA(200,$P(AA,"^",3),654),"^",2)=SWZ D SAB
33 G CU
34 Q
35ACB D DEV I $D(ZTSK)!($D(OUT))!(POP) K ZTSK G CLOS
36ENQ2 ;
37 S SWLP=0 F I=0:0 S I=$O(^SOWK(650,I)) Q:'I S AA=^SOWK(650,I,0) I $P(AA,"^",3)=SWZ D SAB
38 G CU
39 Q
40NR I SWA,'SWB U IO W *7,!,"THERE IS NOTHING TO REPORT FOR LOCATION OF PATIENTS BY COST CENTERS ",! G CLOS
41 U IO W *7,!,"THERE IS NOTHING TO REPORT ON AMIS LOCATIONS FOR ",$P(^VA(200,SWZ,0),"^"),! G CLOS
42SAB I $P(AA,"^",2)'>SOWKFB,$P(AA,"^",13),('$P(AA,"^",18)!($P(AA,"^",18)&($P(AA,"^",18)'<SOWKFD))) S SWAL=$P(AA,"^",13),SW(SWAL)=$S('$D(SW(SWAL)):0,1:SW(SWAL))+1,SWLP=SWLP+1
43 Q
44DEV ;
45 S OUT1=0
46 K ZTSK,OUT,%ZIS,IOP,POP S SOWKION=ION,%ZIS="QM",%ZIS("B")="" D ^%ZIS K %ZIS I POP S IOP=SOWKION D ^%ZIS K IOP,SOWKION S POP=1 Q
47 K SOWKION I $D(IO("Q")) S ZTRTN=$S(SWA:"EN1^SOWKLC",SWB:"ENQ1^SOWKLC",'SWA&'SWB:"ENQ2^SOWKLC",1:"EN1^SOWKLC") F G="SOWKAB","SOWKFD","SOWKFB","SWZ","SWB","SWA","X","OUT1" S ZTSAVE(G)=""
48 I K IO("Q") D ^%ZTLOAD K DIC,G,%DT,X I '$D(ZTSK) S OUT=1 W:$E(IOST)'["C" @IOF D ^%ZISC Q
49 I $D(ZTSK) K G,%DT,DIC,X W !!,"Task Queued to Print",!
50 Q
51HDR Q:$G(OUT1)=1
52 U IO W $S(SWA:"COMPLETE SERVICE",SWB:"SUPERVISOR "_$P(^VA(200,SWZ,0),"^"),1:"SOCIAL WORKER "_$P(^VA(200,SWZ,0),"^"))
53 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",!
54 W ?57,"NO.",?65,"%",!!
55 Q
56CHK ;checks for end of page
57 Q:($Y+8)'>IOSL
58 N SWXX
59 I $E(IOST)["C" R !,"Press <RETURN> to continue: ",SWXX:DTIME I SWXX="^" S OUT1=1 W @IOF Q
60 W @IOF D HDR
61 Q
Note: See TracBrowser for help on using the repository browser.