source: WorldVistAEHR/trunk/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RALWKL4.m@ 1211

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

initial load of WorldVistAEHR

File size: 4.1 KB
Line 
1RALWKL4 ;HISC/FPT-Workload Reports By Functional Area ;4/11/96 09:33
2 ;;5.0;Radiology/Nuclear Medicine;;Mar 16, 1998
3EN1 ; This subroutine prints out only the Summary data as requested by the
4 ; user.
5 S RADIV=""
6 F S RADIV=$O(^TMP($J,"RA",RADIV)) Q:RAXIT!(RADIV="") S RADIVNDE=$G(^(RADIV)) D IMGSUM,DIVSUM:'RAXIT
7 K BEGDATE,ENDDATE,I,RADIFLG,RADIV,RADIVNDE,RADIVTOT,RADIVWWU,RAFL,RAFLD,RAFLDCNT,RAFLDNDE,RAFLDTOT,RAFLDWWU,RAIMG,RAIMGNDE,RAIMGSUM,RAIMGTOT,RAIMGWWU,RAINPUT,RAITCNT,RAITHLD,RALN,RAPG,RASUMNDE,RATDY,RATITLE,RAXIT
8 Q
9IMGSUM ; imaging summary
10 S RAIMG="",RAIMGSUM="",RADIVTOT=0,RADIVWWU=$P(RADIVNDE,U,5)
11 F I=1:1:4 S RADIVTOT=RADIVTOT+(+$P(RADIVNDE,U,I))
12 F S RAIMG=$O(^TMP($J,"RA",RADIV,RAIMG)) Q:RAXIT!(RAIMG="") S RAIMGNDE=$G(^(RAIMG)) D HD^RALWKL1,IMGTOT,RAFLD,PIMGTOT:'RAXIT Q:RAXIT I RADIFLG(RADIV)>1 S RAXIT=$$EOS^RAUTL5()
13 Q
14IMGTOT ; calculate imaging totals
15 S RAIMGTOT=0,RAIMGWWU=$P(RAIMGNDE,U,5)
16 F I=1:1:4 S RAIMGTOT=RAIMGTOT+(+$P(RAIMGNDE,U,I))
17 Q
18RAFLD ;
19 S RAFLD=""
20 F S RAFLD=$O(^TMP($J,"RA",RADIV,RAIMG,RAFLD)) Q:RAXIT!(RAFLD="") S RAFLDNDE=$G(^(RAFLD)) D PFLDTOT
21 Q
22PFLDTOT ; print rafld totals within imaging type
23 S RAFLDTOT=0,RAFLDWWU=$P(RAFLDNDE,U,5)
24 F I=1:1:4 S RAFLDTOT=RAFLDTOT+(+$P(RAFLDNDE,U,I))
25 Q:'RAFLDTOT
26 W !,$E(RAFLD,1,28),?30,$J(+$P(RAFLDNDE,U,1),5)
27 W ?36,$J(+$P(RAFLDNDE,U,2),5)
28 W ?42,$J(+$P(RAFLDNDE,U,3),5)
29 W ?48,$J(+$P(RAFLDNDE,U,4),5)
30 W ?55,$J(RAFLDTOT,5)
31 W:$D(RAFL) ?62,$J($S(RAIMGTOT:(100*RAFLDTOT)/RAIMGTOT,1:0),5,1)
32 W ?68,$J(RAFLDWWU,5)
33 W:$D(RAFL) ?75,$J($S(RAIMGWWU:(100*RAFLDWWU)/RAIMGWWU,1:0),5,1)
34 I ($Y+4)>IOSL S RAXIT=$$EOS^RAUTL5 Q:RAXIT I $O(^TMP($J,"RA",RADIV,RAIMG,RAFLD))]"" D HD^RALWKL1
35 Q
36PIMGTOT ; print imaging type totals
37 I ($Y+4)>IOSL S RAXIT=$$EOS^RAUTL5 Q:RAXIT D HD^RALWKL1
38 Q:RAXIT W !,RALN
39 W !!,"Imaging Type Total:",?30,$J(+$P(RAIMGNDE,U,1),5)
40 W ?36,$J(+$P(RAIMGNDE,U,2),5)
41 W ?42,$J(+$P(RAIMGNDE,U,3),5)
42 W ?48,$J(+$P(RAIMGNDE,U,4),5)
43 W ?55,$J(RAIMGTOT,5)
44 W ?68,$J(RAIMGWWU,5)
45 W !!?3,"# of "_RATITLE_"s selected: "_$S(RAINPUT=1:"ALL",1:$G(RAFLDCNT))
46 Q
47DIVSUM ; print division totals
48 I RADIFLG(RADIV)=1,$O(RADIFLG(RADIV))]"" S RAXIT=$$EOS^RAUTL5 Q:RAXIT
49 Q:RADIFLG(RADIV)=1 ;quit if only one imaging type selected for division
50 D DIVHDR Q:RAXIT
51 S RAFLD=""
52 F S RAFLD=$O(^TMP($J,"RA1",RADIV,RAFLD)) Q:RAXIT!(RAFLD="") S RASUMNDE=$G(^(RAFLD)) D PDIVFLD
53 D:'RAXIT PDIVTOT
54 I $O(^TMP($J,"RA",RADIV))]"" S RAXIT=$$EOS^RAUTL5
55 Q
56PDIVFLD ;
57 S RAFLDTOT=0
58 F I=1:1:4 S RAFLDTOT=RAFLDTOT+(+$P(RASUMNDE,U,I))
59 W !,$E(RAFLD,1,28),?30,$J(+$P(RASUMNDE,U,1),5),?36,$J(+$P(RASUMNDE,U,2),5),?42,$J(+$P(RASUMNDE,U,3),5),?48,$J(+$P(RASUMNDE,U,4),5),?55,$J(RAFLDTOT,5)
60 W ?62,$J($S(RADIVTOT:(RAFLDTOT*100)/RADIVTOT,1:0),5,1)
61 W ?68,$J(+$P(RASUMNDE,U,5),5)
62 W:$D(RAFL) ?75,$J($S(RADIVWWU:($P(RASUMNDE,U,5)*100)/RADIVWWU,1:0),5,1)
63 I ($Y+4)>IOSL S RAXIT=$$EOS^RAUTL5() D:'RAXIT DIVHDR
64 Q
65PDIVTOT ;
66 I ($Y+4)>IOSL S RAXIT=$$EOS^RAUTL5() Q:RAXIT D DIVHDR
67 W !,RALN,!!,"Division Total",?30,$J(+$P(RADIVNDE,U,1),5),?36,$J(+$P(RADIVNDE,U,2),5),?42,$J(+$P(RADIVNDE,U,3),5),?48,$J(+$P(RADIVNDE,U,4),5),?55,$J(RADIVTOT,5)
68 W ?68,$J(+$P(RADIVNDE,U,5),5)
69 I ($Y+(RADIFLG(RADIV)\2)+3)>IOSL S RAXIT=$$EOS^RAUTL5() Q:RAXIT D DIVHDR
70 W !!?2,"Imaging Type(s): "
71 S RAITHLD=""
72 F S RAITHLD=$O(^TMP($J,"RA",RADIV,RAITHLD)) Q:RAXIT!(RAITHLD="") W:$X>(80-25) !?($X+$L("Imaging Type(s):")+3) D
73 .I $Y>(IOSL-4) S RAXIT=$$EOS^RAUTL5() D:'RAXIT DIVHDR Q:RAXIT
74 .W $S($D(^RA(79.2,+$P(RAITHLD,"-",2),0)):$P(^(0),U,1),1:"UNKNOWN"),?($X+3)
75 Q:RAXIT
76 W !!?3,"# of "_RATITLE_"s selected: "_$S(RAINPUT=1:"ALL",1:$G(RAFLDCNT))
77 Q
78DIVHDR ; division totals header
79 W:$Y>0 @IOF W !?5,">>> ",RATITLE," Workload Report <<<" S RAPG=RAPG+1 W ?70,"Page: ",RAPG
80 W !!,?4,"Division: ",$S($D(^DIC(4,+RADIV,0)):$P(^(0),U,1),1:"UNKNOWN"),?52,"For period: " W ?64,BEGDATE("X"),?76," to"
81 W !?4,"Run Date: ",RATDY W ?64,ENDDATE("X")
82 W !!?32,"-------Examinations------",!?62,"% of" W:$D(RAFL) ?75," % of"
83 W !,RATITLE,?30," Inpt",?36," Opt",?42," Res",?48,"Other",?55,"Total",?62,"Exams"
84 W:$D(RAFL) ?68," WWU",?75," WWU"
85 W !,RALN
86 W !?10,"(Division Summary)"
87 I $D(ZTQUEUED) D STOPCHK^RAUTL9 S:$G(ZTSTOP)=1 RAXIT=1
88 Q
Note: See TracBrowser for help on using the repository browser.