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

RAMIS1.m

Go to the documentation of this file.
RAMIS1 ;HISC/CAH,FPT,GJC-Radiology AMIS Report ;4/15/96  10:25
 ;;5.0;Radiology/Nuclear Medicine;;Mar 16, 1998
 S RADIVN(0)=""
 F  S RADIVN(0)=$O(^TMP($J,"RA D-TYPE",RADIVN(0))) Q:RADIVN(0)=""  D
 . S RADIVN=0
 . F  S RADIVN=$O(^TMP($J,"RA D-TYPE",RADIVN(0),RADIVN)) Q:RADIVN'>0  D
 .. I $O(^TMP($J,"RAMIS",RADIVN,""))="" S ^TMP($J,"RAMIS",RADIVN)=""
 .. Q
 . Q
 S (RACNT,RADATA)=0,PAGE=1
 F RADIV=0:0 S RADIV=$O(^TMP($J,"RAMIS",RADIV)) Q:RADIV'>0!RAXIT  S Y=$S($D(^DIC(4,RADIV,0)):$P(^(0),"^"),1:"UNKNOWN") S RACNT=RACNT+1 D PRT
 I RADATA'>0!(RAXIT) G Q
 I 'RAXIT,RACNT>1 S RADIV="TOT",Y="ALL DIVISIONS" D PRT
Q K ^TMP($J,"RA D-TYPE"),^TMP($J,"RAMIS"),%DT,A,BEGDATE,C,D,ENDDATE,I,IN,J,OUT,PAGE,RA,RA20,RA21H,RA21B,RABEG,RACNI,RACNT,RACRT,RAD0,RADATA,RADFLAG,RADFN,RADIV,RADIVN
 K RADTE,RADTI,RAEND,RAI,RAIN,RAINTOT,RAMIS,RAMUL,RAOR,RAOUT,RAOUTOT,RAP,RAP0,RAPOP,RAPORT,RAPRC,RAPRI,RAQI,RAQUIT,RASTAT,RATOT,RAVST,RAWT,RAXIT,RAZ,T,TOT,X,Y,Z,ZTRTN,ZTSAVE
 K:$D(RAPSTX) RACCESS,RAPSTX
 W ! D CLOSE^RAUTL
 K DDH,POP,DUOUT,RAMES,ZTDESC
 Q
 ;
PRT F T="EX","WT" S RAINTOT(T)=$G(^TMP($J,"RAMIS",RADIV,"TOT",T,"IN")),RAOUTOT(T)=$G(^("OUT")),RATOT(T)=RAINTOT(T)+RAOUTOT(T)
 D HD1 Q:RAXIT
 I $O(^TMP($J,"RAMIS",RADIV,""))="" D  Q
 . W !!,"No data for selected date range."
 . I $E(IOST,1,2)="C-" S RAXIT=$$EOS^RAUTL5()
 . Q
 S RADATA=1
 F RAMIS=0:0 S RAMIS=$O(^TMP($J,"RAMIS",RADIV,RAMIS)) Q:RAMIS'>0!RAXIT  I RAMIS<25!(RAMIS=99)!(RAMIS=27) D PRT1
 Q:RAXIT
 W !!?5,"TOTALS",?45,$J(RAINTOT("EX"),5),?52,$J(RAOUTOT("EX"),5),?59,$J(RATOT("EX"),5),?74,$J(RAINTOT("WT"),5),?81,$J(RAOUTOT("WT"),5),?88,$J(RATOT("WT"),5)
 S RAXIT=$$EOS("HD1") Q:RAXIT
 S IN=RAINTOT("EX"),OUT=RAOUTOT("EX"),TOT=RATOT("EX")
 W !?5,"AVERAGE WEIGHT PER EXAM",?74,$J($S(IN:(RAINTOT("WT")/IN),1:0),5,1),?81,$J($S(OUT:(RAOUTOT("WT")/OUT),1:0),5,1),?88,$J($S(TOT:(RATOT("WT")/TOT),1:0),5,1)
 S RAXIT=$$EOS("HD1") Q:RAXIT
 W ! F I=1:1:130 W "-"
 S RAXIT=$$EOS("HD1") Q:RAXIT
 F RAMIS=25,26,"MULP" D PRT1 Q:RAXIT
 Q:RAXIT
 I $E(IOST,1,2)="C-" S RAXIT=$$EOS^RAUTL5() Q:RAXIT
 D HD2 Q:RAXIT
 S RAXIT=$$EOS("HD2") Q:RAXIT
 W !?4,"*CINE RUNS",?45,$J(^TMP($J,"RAMIS",RADIV,"CINERUNS","IN"),5),?52,$J(^("OUT"),5),?59,$J((^("IN")+^("OUT")),5)
 S RAXIT=$$EOS("HD2") Q:RAXIT
 W !?4,"*NO. OF CINE FEET USED",?45,$J(^TMP($J,"RAMIS",RADIV,"CINE","IN"),5),?52,$J(^("OUT"),5),?59,$J((^("IN")+^("OUT")),5)
 S RAXIT=$$EOS("HD2") Q:RAXIT
 W !?4,"*NO. OF FILMS USED",?45,$J(^TMP($J,"RAMIS",RADIV,"FLM","IN"),5),?52,$J(^("OUT"),5),?59,$J((^("IN")+^("OUT")),5)
 S RAXIT=$$EOS("HD2") Q:RAXIT
 S IN=^TMP($J,"RAMIS",RADIV,"VST","IN"),OUT=^("OUT"),TOT=IN+OUT
 W !?5,"PATIENT VISITS",?45,$J(IN,5),?52,$J(OUT,5),?59,$J(TOT,5)
 S RAXIT=$$EOS("HD2") Q:RAXIT
 W !?5,"AVERAGE EXAMS PER VISIT",?45,$J($S(IN:(RAINTOT("EX")/IN),1:0),5,1),?52,$J($S(OUT:(RAOUTOT("EX")/OUT),1:0),5,1),?59,$J($S(TOT:(RATOT("EX")/TOT),1:0),5,1)
 S RAXIT=$$EOS("HD2") Q:RAXIT
 W !?5,"AVERAGE WORK UNITS PER VISIT",?45,$J($S(IN:(RAINTOT("WT")/IN),1:0),5,1),?52,$J($S(OUT:(RAOUTOT("WT")/OUT),1:0),5,1),?59,$J($S(TOT:(RATOT("WT")/TOT),1:0),5,1)
 S RAXIT=$$EOS("HD2") Q:RAXIT
 W !!!,"* These data are not to be used for AMIS. Use your inventory data."
 I $E(IOST,1,2)="C-" S RAXIT=$$EOS^RAUTL5()
 Q
 ;
PRT1 F T="EX","WT" S RAIN(T)=^TMP($J,"RAMIS",RADIV,RAMIS,T,"IN"),RAOUT(T)=^("OUT"),RA(T)=RAIN(T)+RAOUT(T),RAP(T)=$S(RATOT(T):100*(RA(T)/RATOT(T)),1:0)
 W !?1,$S(RAMIS:RAMIS,RAMIS="MULP":""),?5,$S($D(^RAMIS(71.1,RAMIS,0)):$P(^(0),"^"),RAMIS="MULP":"SERIES OF AMIS CODES",1:"UNKNOWN") W:RAMIS<25!(RAMIS=99)!(RAMIS=27) ?38,$J($S($D(^(0)):$P(^(0),"^",2),1:""),3)
 W ?45,$J(RAIN("EX"),5),?52,$J(RAOUT("EX"),5),?59,$J(RA("EX"),5),?64,$J(RAP("EX"),7,1)
 W ?74,$J(RAIN("WT"),5),?81,$J(RAOUT("WT"),5),?88,$J(RA("WT"),5),?93,$J(RAP("WT"),7,1)
 S RAXIT=$$EOS("HD1")
 Q
NONE W @IOF,!?45,">>> Overall Workload Report <<<"
 W !!?5,"No exams registered for time period " N Y S Y=BEGDATE D D^RAUTL W Y," to " S Y=ENDDATE D D^RAUTL W Y,".",!
 Q
 ;
HD1 I (PAGE>1)!($E(IOST,1,2)="C-") W @IOF
 W !?45,">>> Overall Workload Report <<<",?115,"Page: ",PAGE
 W !?1,"Division: ",Y,?95,"For period: " N Y S Y=BEGDATE D D^RAUTL W ?109,Y,?121,"to"
 S X="NOW",%DT="T" D ^%DT K %DT D D^RAUTL W !?1,"Run Date: ",Y S Y=ENDDATE D D^RAUTL W ?109,Y
 W !!?50,"Examinations",?78,"Weighted Work Units"
 W !?5,"Amis Category",?37,"Weight",?45,"   IN",?52,"  OUT",?59,"TOTAL",?66,"   %",?74,"   IN",?81,"  OUT",?88,"TOTAL",?95,"   %"
 S PAGE=PAGE+1
 W ! F I=1:1:130 W "-"
 I $D(ZTQUEUED) D STOPCHK^RAUTL9 S:$G(ZTSTOP)=1 RAXIT=1
 Q
HD2 I $E(IOST,1,2)="C-" W @IOF
 W !!!?48,"Other Statistics",!?5,"Statistic Item",?45,"   IN",?52,"  OUT",?59,"TOTAL" W ! F I=1:1:130 W "-"
 I $D(ZTQUEUED) D STOPCHK^RAUTL9 S:$G(ZTSTOP)=1 RAXIT=1
 Q
EOS(HDR) ; Generate the header passed in by the application
 N RAXIT S RAXIT=0
 I $Y>(IOSL-4) D
 . N HOLDY S HOLDY=Y
 . S RAXIT=$$EOS^RAUTL5()
 . I 'RAXIT,$G(HDR)]"" S Y=HOLDY D @HDR
 Q RAXIT