Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: RAWKL3

RAWKL3.m

Go to the documentation of this file.
RAWKL3 ;HISC/FPT-Workload Reports (cont.) ;9/23/96  08:44
 ;;5.0;Radiology/Nuclear Medicine;;Mar 16, 1998
DIVTOT ; print division totals
 Q:RAITCNT(RADIV)=1  ;quit if only one imaging type selected for division
 K ^TMP($J,"RADIVFLD")
 D DIVHDR Q:$D(RAEOS)
 S RATMPNDE=^TMP($J,"RA",RADIV),RAITTEXM=$P(RATMPNDE,U,1)+$P(RATMPNDE,U,2),RAITTWWU=$P(RATMPNDE,U,3)
 S RAITHLD="",(RADIN,RADOUT,RADTOT,RADWWU)=0
 F  S RAITHLD=$O(^TMP($J,"RA",RADIV,RAITHLD)) Q:RAITHLD=""  S RAITFLD="" F  S RAITFLD=$O(^TMP($J,"RA",RADIV,RAITHLD,RAITFLD)) Q:RAITFLD=""  D
 .S RAITIN=$P(^TMP($J,"RA",RADIV,RAITHLD,RAITFLD),U,1)
 .S RAITOUT=$P(^TMP($J,"RA",RADIV,RAITHLD,RAITFLD),U,2)
 .S RAITWWU=$P(^TMP($J,"RA",RADIV,RAITHLD,RAITFLD),U,3)
 .S:'$D(^TMP($J,"RADIVFLD",RAITFLD)) ^TMP($J,"RADIVFLD",RAITFLD)="0^0^0"
 .S $P(^TMP($J,"RADIVFLD",RAITFLD),U,1)=$P(^TMP($J,"RADIVFLD",RAITFLD),U,1)+RAITIN
 .S $P(^TMP($J,"RADIVFLD",RAITFLD),U,2)=$P(^TMP($J,"RADIVFLD",RAITFLD),U,2)+RAITOUT
 .S $P(^TMP($J,"RADIVFLD",RAITFLD),U,3)=$P(^TMP($J,"RADIVFLD",RAITFLD),U,3)+RAITWWU
 .S RAITTOT=RAITIN+RAITOUT
 .S RADIN=RADIN+RAITIN,RADOUT=RADOUT+RAITOUT,RADTOT=RADTOT+RAITTOT,RADWWU=RADWWU+RAITWWU
 S RAITFLD=""
 F  S RAITFLD=$O(^TMP($J,"RADIVFLD",RAITFLD)) Q:RAITFLD=""!($D(RAEOS))  D
 .S RAITIN=$P(^TMP($J,"RADIVFLD",RAITFLD),U,1)
 .S RAITOUT=$P(^TMP($J,"RADIVFLD",RAITFLD),U,2)
 .S RAITWWU=$P(^TMP($J,"RADIVFLD",RAITFLD),U,3)
 .S RAITTOT=RAITIN+RAITOUT
 .W !?2,RAITFLD,?40,$J(RAITIN,5),?47,$J(RAITOUT,5),?54,$J(RAITTOT,5),?61,$J($S(RAITTEXM:(RAITTOT*100)/RAITTEXM,1:0),5,1) W:$D(RAFL) ?68,$J(RAITWWU,5),?75,$J($S(RAITTWWU:(RAITWWU*100)/RAITTWWU,1:0),5,1)
 .I ($Y+4)>IOSL D EOS^RAWKL2 Q:$D(RAEOS)  D DIVHDR
 Q:$D(RAEOS)
 W !,RA80DASH,!!?2,"Division Total",?40,$J(RADIN,5),?47,$J(RADOUT,5),?54,$J(RADTOT,5) W:$D(RAFL) ?68,$J(RADWWU,5)
 I ($Y+(RAITCNT(RADIV)\2)+3)>IOSL D EOS^RAWKL2 Q:$D(RAEOS)   D DIVHDR
 Q:$D(RAEOS)  W !!?2,"Imaging Type(s): "
 S RAITHLD=""
 F  S RAITHLD=$O(^TMP($J,"RA",RADIV,RAITHLD)) Q:RAITHLD=""!($D(RAEOS))  W:$X>(80-25) !?($X+$L("Imaging Type(s):")+3) D
 .I ($Y+4)>IOSL D EOS^RAWKL2 Q:$D(RAEOS)  D DIVHDR Q:$D(RAEOS)  W !?19
 .W $S($D(^RA(79.2,+$P(RAITHLD,"-",2),0)):$P(^(0),U,1),1:"UNKNOWN"),?($X+3)
 Q:$D(RAEOS)
 W !!?3,"# of "_RATITLE_"s selected: "_$S(RAINPUT=1:"ALL",1:$G(RAFLDCNT))
 K ^TMP($J,"RADIVFLD"),RADIN,RADOUT,RADTOT,RADWWU,RAITFLD,RAITHLD,RAITIN,RAITOUT,RAITTEXM,RAITTOT,RAITWWU,RAITTWWU,RATMPNDE
 I $O(^TMP($J,"RA",RADIV))]"" D EOS^RAWKL2
 Q
DIVHDR ; division totals header
 W:$Y>0 @IOF W !?10,">>> ",RATITLE," Workload Report <<<" S PAGE=PAGE+1 W ?70,"Page: ",PAGE
 W !!,?4,"Division: ",$S($D(^DIC(4,+RADIV,0)):$P(^(0),U,1),1:"UNKNOWN"),?52,"For period: ",?64,BEGDATE,?76,"to"
 W !?4,"Run Date: ",RARUNDTE,?64,ENDDATE
 W !!?45,"Examinations",?61,"Percent" W:$D(RAFL) ?73,"Percent"
 W !?2,RATITLE,?40,"   In",?47,"  Out",?54,"Total",?61," Exams" W:$D(RAFL) ?67,"  WWU",?73,"  WWU"
 W !,RA80DASH
 W !?10,"(Division Summary)"
 I $D(ZTQUEUED) D STOPCHK^RAUTL9 S:$G(ZTSTOP)=1 RAEOS=""
 Q