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

PRSEPMD6.m

Go to the documentation of this file.
PRSEPMD6 ;HISC/GLB-INCOMPLETE MANDATORY INSERVICE CLASS DATA PART 2 OF 2 ;2/17/94
 ;;4.0;PAID;**20**;Sep 21, 1995
 I $O(^TMP("PRSE",$J,"SORT1",""))="" D HDR W !,"NO DEFICIENCIES FOUND FOR THIS TIME PERIOD." W:$G(PSPC)]"" !,"SERVICE: ",PSPC W:$G(PRSECLS)]"" !,"CLASS: ",PRSECLS Q
 S (PRSESER,DUEDT)="" F  S PRSESER=$O(^TMP("PRSE",$J,"SORT1",PRSESER)) Q:PRSESER=""!(PRSEOUT)  D
 .S TMP=$G(^TMP("PRSE",$J,"%",PRSESER)),COMPLIAN=""
 .S TOT=$P(TMP,U),DEF=$P(TMP,U,2)
 .S COMPLIAN=$S(TOT:100-(100*DEF/TOT),1:"")
 .I ($Y>(IOSL-8))!'(NSW1) D HDR W ! Q:PRSEOUT
 .D SUBHDR
 .S NSCT="" F  S NSCT=$O(^TMP("PRSE",$J,"SORT1",PRSESER,NSCT)) Q:NSCT=""!(PRSEOUT)  S HOLD=1 D  S HOLD=1
 ..S CLASSNUM=+$G(^TMP("PRSE",$J,"SORT1",PRSESER,NSCT)) Q:CLASSNUM'>0
 ..S NAM="" F  S NAM=$O(^TMP("PRSE",$J,"SORT2",CLASSNUM,NAM)) Q:NAM=""!(PRSEOUT)  S HOLD2=1 D  W ! S HOLD2=1
 ...S CLASSTXT="" F  S CLASSTXT=$O(^TMP("PRSE",$J,"SORT2",CLASSNUM,NAM,CLASSTXT)) Q:CLASSTXT=""!(PRSEOUT)  S DUEDT=^(CLASSTXT) D
 ....I ($Y>(IOSL-8))!'(NSW1) D HDR,SUBHDR W ! Q:PRSEOUT
 ....I HOLD W $S(NSCT="  BLANK":"       ",1:$S(PRSE132:$E(NSCT,1,32),1:$E(NSCT,1,25))),! S HOLD=0
 ....I HOLD2 W ?10,$S(NAM="  BLANK":"       ",1:$S(PRSE132:NAM,1:$E(NAM,1,25))) S HOLD2=0
 ....W ?40,$$FMTE^XLFDT(DUEDT,2)
 ....W ?$S(PRSE132:70,1:54),CLASSTXT,!
 ....S DUEDT="" Q
 ...Q
 ..Q
 .Q
 Q
HDR ; PRINT REPORT HEARDER
 I NSW1,$E(IOST)="C" D ENDPG^PRSEUTL S PRSEOUT=+POUT Q:POUT
 S COUNT=COUNT+1,(HOLD,NSW1)=1,NSW2=0
 W:$E(IOST)="C"!(COUNT>1) @IOF W !,"SERVICE MANDATORY TRAINING DEFICIENCY REPORT FOR "_$S(TYP="C":"CY ",TYP="F":"FY ",1:" ")
 W $S(TYP="C"!(TYP="F"):$G(PYR),1:$G(YRST(1))_" - "_$G(YREND(1)))
 S Y=DT D:+Y D^DIQ
 I PRSE132 D
 .W ?101,Y,?121,"PAGE: ",COUNT
 .W !!,"TITLE",!,?10,"NAME",?40,"DEFICIENT AS OF",?70,"CLASS"
 E  D
 .W ?68,Y,!?68,"PAGE: ",COUNT
 .W !!,"TITLE",?40,"DEFICIENT",!?10,"NAME",?40,"AS OF",?54,"CLASS"
 S SE1="",$P(SE1,"-",$S(PRSE132:133,1:81))="" W !,SE1
 Q
SUBHDR ;
 Q:PRSEOUT
 W !,"Service: "_$S(PRSESER="  BLANK":" ",1:PRSESER)
 ; %Compliance = 100% - ( ( # of deficient persons in the service /
 ;                          # of persons in the service ) * 100% )
 ;# or persons in service=$P(^TMP("PRSE",$J,%,PRSESERV),U)
 ;# of persons deficient as of date report run("TODAY")=$P(^(PRSESERV),U,2)
 W ?50,"% Compliance: ",$J(COMPLIAN,3,0) I COMPLIAN=100,$G(PRSECLS)]"" W ?$X+3,PRSECLS
 W !!
 Q