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

RAPRC1.m

Go to the documentation of this file.
RAPRC1 ;HISC/FPT AISC/MJK-Procedure Workload Report ;10/21/97  09:08
 ;;5.0;Radiology/Nuclear Medicine;;Mar 16, 1998
 ;
 S Y=BEGDATE D D^RAUTL S BEGDATE=Y
 S Y=ENDDATE D D^RAUTL S ENDDATE=Y
 S X="NOW",%DT="T" D ^%DT K %DT D D^RAUTL S RARUNDTE=Y
 S RA80DASH=$$REPEAT^XLFSTR("-",79),(PAGE,RAEOS)=0
 F RADIV=0:0 S RADIV=$O(^TMP($J,"RA",RADIV)) Q:RAEOS!(RADIV'>0)  S RAZ=^(RADIV),RAY=$S($D(^DIC(4,RADIV,0)):$P(^(0),"^"),1:"UNKNOWN") D RAMIS Q:RAEOS  S RASUM="",Z=RAZ D HD Q:RAEOS  D DIV K RASUM
Q ; kill variables, close device
 K ^TMP($J,"RA"),^TMP($J,"RA D-TYPE"),^TMP($J,"RA I-TYPE"),^TMP($J,"RAPRC"),^TMP($J,"DIV-IMG")
 K %DT,A,A1,BEGDATE,C,DDH,ENDDATE,I,J,IN,OUT,PAGE,RA80DASH,RABEG,RACNI,RACRT,RAD0,RAEOS,RADFN,RADIV,RADTE,RADTI,RAEND,RAFL,RAI,RAIN,RAITNUM,RAITYPE,RAMIS,RAMUL
 K RANUM,RAOR,RAOUT,RAP0,RAPOP,RAPORT,RAQUIT,RAPRC,RAPRI,RAQI,RARUNDTE,RASTAT,RASUM,RATOT,RAWT,RAWWU,RAXIT,RAY,RAZ,TOT,WWU,X,Y,Z
 K:$D(RAPSTX) RACCESS,RAPSTX
 W ! D CLOSE^RAUTL
 K DUOUT,POP,RAMES,ZTDESC,ZTSAVE
 Q
 ;
RAMIS S RAMIS=0 F J=0:0 S RAMIS=$O(^TMP($J,"RA",RADIV,RAMIS)) Q:RAEOS!(RAMIS="")  S Z=^(RAMIS) D HD Q:RAEOS  D PRT
 Q
 ;
PRT S IN=$P(Z,"^"),OUT=$P(Z,"^",2),TOT=IN+OUT,WWU=$P(Z,"^",3)
 S RAPRC="" F I=0:0 S RAPRC=$O(^TMP($J,"RA",RADIV,RAMIS,RAPRC)) Q:RAPRC=""  S Y=^(RAPRC),RAIN=$P(Y,"^"),RAOUT=$P(Y,"^",2),RAWWU=$P(Y,"^",3),RATOT=RAIN+RAOUT D PRT1
 W !!?2,$S($D(RASUM):"DIVISION",1:"AMIS CATEGORY")," TOTALS",?35,$J(IN,5),?42,$J(OUT,5),?49,$J(TOT,5),?63,$J(WWU,5)
 S RAEOS=$$EOS^RAUTL5()
 Q
PRT1 I ($Y+4)>IOSL S RAEOS=$$EOS^RAUTL5() Q:RAEOS  D HD Q:RAEOS
 W !?2,RAPRC,?35,$J(RAIN,5),?42,$J(RAOUT,5),?49,$J(RATOT,5),?56,$J($S(TOT:(100*RATOT)/TOT,1:0),5,1),?63,$J(RAWWU,5),?70,$J($S(WWU:(RAWWU*100)/WWU,1:0),5,1)
 Q
 ;
HD W:$Y>0 @IOF W !?9,">>>>> Detailed Procedure Workload Report <<<<<" S PAGE=PAGE+1 W ?70,"Page: ",PAGE
 W !!?5,"Division: ",RAY
 W !?1,"Imaging Type: ",RAITYPE,?52,"For period: " W ?64,BEGDATE,?76,"to",!?5,"Run Date: ",RARUNDTE,?64,ENDDATE
 W !!?40,$S(RAMIS="MULP":"No. of Series",1:"Examinations"),?56,"Percent",?70,"Percent"
 W !?2,$S('$D(RASUM):"Procedure",1:"Amis Category"),?35,"   In",?42,"  Out",?49,"Total",?56,$S(RAMIS="MULP":"Series",1:" Exams"),?63,"  WWU",?70,"  WWU"
 W !,RA80DASH
 W:$D(RASUM) !?10,"(Division Summary)" W:'$D(RASUM) !?5,"Amis: ",$S(RAMIS:RAMIS,1:""),?15,$S($D(^RAMIS(71.1,RAMIS,0)):$P(^(0),"^"),RAMIS="MULP":"SERIES OF AMIS CODES",1:"UNKNOWN")
 I $D(ZTQUEUED) D STOPCHK^RAUTL9 S:$G(ZTSTOP)=1 RAEOS=1
 Q
 ;
DIV S IN=$P(Z,"^"),OUT=$P(Z,"^",2),TOT=IN+OUT,WWU=$P(Z,"^",3)
 F I=0:0 S RAMIS=$O(^TMP($J,"RA",RADIV,RAMIS)) Q:RAEOS!(RAMIS="")  I RAMIS'="MULP",RAMIS<25!(RAMIS=99) S Y=^(RAMIS),RAIN=$P(Y,"^"),RAOUT=$P(Y,"^",2),RAWWU=$P(Y,"^",3),RATOT=RAIN+RAOUT D DIV1 Q:RAEOS
 W !!?2,"DIVISION TOTALS",?35,$J(IN,5),?42,$J(OUT,5),?49,$J(TOT,5),?63,$J(WWU,5)
 W !!,RA80DASH
 F RAMIS=25,26,"MULP" I $D(^TMP($J,"RA",RADIV,RAMIS)) S Y=^(RAMIS),RAIN=$P(Y,"^"),RAOUT=$P(Y,"^",2),RAWWU=$P(Y,"^",3),RATOT=RAIN+RAOUT D DIV1 Q:RAEOS
 Q:RAEOS
 I $O(^TMP($J,"RA",RADIV))]"" S RAEOS=$$EOS^RAUTL5()
 Q
DIV1 I ($Y+4)>IOSL S RAEOS=$$EOS^RAUTL5() Q:RAEOS  D HD Q:RAEOS
 W !,$J($S(RAMIS:RAMIS,1:"  "),2),"-",$E($S($D(^RAMIS(71.1,RAMIS,0)):$P(^(0),"^"),RAMIS="MULP":"SERIES OF AMIS CODES",1:"UNKNOWN"),1,30)
 W ?35,$J(RAIN,5),?42,$J(RAOUT,5),?49,$J(RATOT,5),?56,$S(RAMIS="MULP":"",1:$J($S(TOT:(100*RATOT)/TOT,1:0),5,1)),?63,$J(RAWWU,5),?70,$J($S(WWU:(RAWWU*100)/WWU,1:0),5,1)
 Q
SAVEONE ; Save off the I-Type
 S RAITNUM=+$O(^TMP($J,"DIV-IMG",0))
 S RAITYPE=$P($G(^RA(79.2,RAITNUM,0)),"^")
 S ^TMP($J,"RA I-TYPE",RAITYPE,RAITNUM)=""
 Q