NURSEPD3 ;HIRMFO/MD-INCOMPLETE NURS M I REPORT (BY CLASS) PART 1 OF 2 ;8/19/97
;;4.0;NURSING SERVICE;**3,10**;Apr 25, 1997
I $O(^TMP("NURE",$J,"SORT1",""))="" S NURFAC=$S($G(NURFAC)=0:$G(NURFAC(1)),1:""),NURPROG=$S($G(NURPROG)=0:$G(NURPROG(1)),1:"") D Q
.D HDR Q:NUROUT
.I 'NONE W !,"NO DEFICIENCIES FOUND FOR THIS TIME PERIOD." Q
.I NONE S NPWARD=$G(NWRD) D EN6^NURSAUTL W !,"Unit : "_$S($G(NPWARD)="":" ",1:NPWARD),!!,"NO GROUPS/CLASSES ARE ASSIGNED TO NURSING PERSONNEL",! Q
S NURFAC=""
F S NURFAC=$O(^TMP("NURE",$J,"SORT1",NURFAC)) Q:NURFAC="" S NURPROG="" F S NURPROG=$O(^TMP("NURE",$J,"SORT1",NURFAC,NURPROG)) Q:NURPROG="" S NURSPEC="" F S NURSPEC=$O(^TMP("NURE",$J,"SORT1",NURFAC,NURPROG,NURSPEC)) Q:NURSPEC=""!(NUROUT) D
.D HDR Q:NUROUT S TMP=$G(^TMP("NURE",$J,"%",NURFAC,NURPROG,NURSPEC)),COMPLIAN=""
.S TOT=$P(TMP,U),DEF=$P(TMP,U,2)
.S COMPLIAN=$S(TOT:100-(100*DEF/TOT),1:"")
.I 'NURSW1!($Y>(IOSL-5)) D HDR W ! Q:NUROUT
.D SUBHDR
.S NURSPEC(1)="" F S NURSPEC(1)=$O(^TMP("NURE",$J,"SORT1",NURFAC,NURPROG,NURSPEC,NURSPEC(1))) Q:NURSPEC(1)=""!(NUROUT) S HOLD=1 D S HOLD=1
..S CLASSNUM=+$G(^TMP("NURE",$J,"SORT1",NURFAC,NURPROG,NURSPEC,NURSPEC(1))) Q:CLASSNUM'>0
..S NAM="" F S NAM=$O(^TMP("NURE",$J,"SORT2",CLASSNUM,NAM)) Q:NAM=""!(NUROUT) S HOLD2=1 D W ! S HOLD2=1
...S CLASSTXT="" F S CLASSTXT=$O(^TMP("NURE",$J,"SORT2",CLASSNUM,NAM,CLASSTXT)) Q:CLASSTXT=""!(NUROUT) D
....I ($Y>(IOSL-5))!'(NURSW1) D HDR,SUBHDR W ! Q:NUROUT
....I HOLD S NSCT(1)=$$CAT^NURSUT2(NURSPEC(1)) S HOLD=0
....W:NAM'=" BLANK"&HOLD2=1 $S(NURS132:NAM,1:$E(NAM,1,25))_" "_$S(NSCT(1)=" BLANK":" ",1:NSCT(1)) S HOLD2=0
....S DROPDEAD=$G(^TMP("NURE",$J,"SORT2",CLASSNUM,NAM,CLASSTXT))
....W:$G(DROPDEAD)>0 ?$S(NURS132:50,1:35),$$FMTE^XLFDT(DROPDEAD,2)
....W:CLASSTXT'=" BLANK" ?$S(NURS132:79,1:47),$S(NURS132:CLASSTXT,1:$E(CLASSTXT,1,33)),! S NURSW1=1
....Q
...Q
..Q
.Q
Q
HDR ; PRINT REPORT HEADER
I NURSW1,$E(IOST)="C" D ENDPG^NURSUT1 Q:NUROUT
S COUNT=COUNT+1,(NURSW1,HOLD,HOLD2)=1,NSW2=0
W:$E(IOST)="C"!(COUNT>1) @IOF
I NURMDSW,$G(NURFAC)'="" W !?$$CNTR^NURSUT2(NURFAC),$$FACL^NURSUT2(NURFAC)
W !,"MANDATORY DEFICIENCY REPORT BY "_$S($G(NURSEL(1))=2:"SVC. CATEGORY",1:"UNIT")_" FOR "_$S(TYP="C":"CY ",TYP="F":"FY ",1:" ")
W $S(TYP="C"!(TYP="F"):$G(NYR),1:$G(YRST(1))_" - "_$G(YREND(1)))
W ?$S(NURS132:101,1:58)," ",$$FMTE^XLFDT(DT,2),?$S(NURS132:121,1:71),"PAGE: ",COUNT
W !!,?$S(NURS132:50,1:35),"ANNIVERSARY"
W !,"EMPLOYEE NAME",?$S(NURS132:50,1:35),"DATE",?$S(NURS132:79,1:47),"CLASS"
W !,$$REPEAT^XLFSTR("_",$S(NURS132:132,1:80))
PROD I $G(NURPLSW),$G(NURPROG)'="" N Z S Z=$$PROD^NURSUT2(NURPROG) W !,?$$CNTR^NURSUT2(Z),Z,!,?$$CNTR^NURSUT2(NURPROG),$$REPEAT^XLFSTR("-",$L(Z)+1)
Q
SUBHDR ;
Q:NUROUT
W !,$S($G(NURSEL(1))=2:"Service Category: ",1:"Unit: ")_$S(NURSPEC=" BLANK":" ",1:NURSPEC)
; %Compliance = 100% -( ( # of deficient persons on the unit/
; # of persons on the unit ) * 100%)
W ?40,"% Compliance: ",$J(COMPLIAN,3,0) I COMPLIAN=100,$G(NSPC)]"" W ?$X+3,NSPC
W !!
Q
NURSEPD3 ;HIRMFO/MD-INCOMPLETE NURS M I REPORT (BY CLASS) PART 1 OF 2 ;8/19/97
+1 ;;4.0;NURSING SERVICE;**3,10**;Apr 25, 1997
+2 IF $ORDER(^TMP("NURE",$JOB,"SORT1",""))=""
SET NURFAC=$SELECT($GET(NURFAC)=0:$GET(NURFAC(1)),1:"")
SET NURPROG=$SELECT($GET(NURPROG)=0:$GET(NURPROG(1)),1:"")
Begin DoDot:1
+3 DO HDR
IF NUROUT
QUIT
+4 IF 'NONE
WRITE !,"NO DEFICIENCIES FOUND FOR THIS TIME PERIOD."
QUIT
+5 IF NONE
SET NPWARD=$GET(NWRD)
DO EN6^NURSAUTL
WRITE !,"Unit : "_$SELECT($GET(NPWARD)="":" ",1:NPWARD),!!,"NO GROUPS/CLASSES ARE ASSIGNED TO NURSING PERSONNEL",!
QUIT
End DoDot:1
QUIT
+6 SET NURFAC=""
+7 FOR
SET NURFAC=$ORDER(^TMP("NURE",$JOB,"SORT1",NURFAC))
IF NURFAC=""
QUIT
SET NURPROG=""
FOR
SET NURPROG=$ORDER(^TMP("NURE",$JOB,"SORT1",NURFAC,NURPROG))
IF NURPROG=""
QUIT
SET NURSPEC=""
FOR
SET NURSPEC=$ORDER(^TMP("NURE",$JOB,"SORT1",NURFAC,NURPROG,NURSPEC))
IF NURSPEC=""!(NUROUT)
QUIT
Begin DoDot:1
+8 DO HDR
IF NUROUT
QUIT
SET TMP=$GET(^TMP("NURE",$JOB,"%",NURFAC,NURPROG,NURSPEC))
SET COMPLIAN=""
+9 SET TOT=$PIECE(TMP,U)
SET DEF=$PIECE(TMP,U,2)
+10 SET COMPLIAN=$SELECT(TOT:100-(100*DEF/TOT),1:"")
+11 IF 'NURSW1!($Y>(IOSL-5))
DO HDR
WRITE !
IF NUROUT
QUIT
+12 DO SUBHDR
+13 SET NURSPEC(1)=""
FOR
SET NURSPEC(1)=$ORDER(^TMP("NURE",$JOB,"SORT1",NURFAC,NURPROG,NURSPEC,NURSPEC(1)))
IF NURSPEC(1)=""!(NUROUT)
QUIT
SET HOLD=1
Begin DoDot:2
+14 SET CLASSNUM=+$GET(^TMP("NURE",$JOB,"SORT1",NURFAC,NURPROG,NURSPEC,NURSPEC(1)))
IF CLASSNUM'>0
QUIT
+15 SET NAM=""
FOR
SET NAM=$ORDER(^TMP("NURE",$JOB,"SORT2",CLASSNUM,NAM))
IF NAM=""!(NUROUT)
QUIT
SET HOLD2=1
Begin DoDot:3
+16 SET CLASSTXT=""
FOR
SET CLASSTXT=$ORDER(^TMP("NURE",$JOB,"SORT2",CLASSNUM,NAM,CLASSTXT))
IF CLASSTXT=""!(NUROUT)
QUIT
Begin DoDot:4
+17 IF ($Y>(IOSL-5))!'(NURSW1)
DO HDR
DO SUBHDR
WRITE !
IF NUROUT
QUIT
+18 IF HOLD
SET NSCT(1)=$$CAT^NURSUT2(NURSPEC(1))
SET HOLD=0
+19 IF NAM'=" BLANK"&HOLD2=1
WRITE $SELECT(NURS132:NAM,1:$EXTRACT(NAM,1,25))_" "_$SELECT(NSCT(1)=" BLANK":" ",1:NSCT(1))
SET HOLD2=0
+20 SET DROPDEAD=$GET(^TMP("NURE",$JOB,"SORT2",CLASSNUM,NAM,CLASSTXT))
+21 IF $GET(DROPDEAD)>0
WRITE ?$SELECT(NURS132:50,1:35),$$FMTE^XLFDT(DROPDEAD,2)
+22 IF CLASSTXT'=" BLANK"
WRITE ?$SELECT(NURS132:79,1:47),$SELECT(NURS132:CLASSTXT,1:$EXTRACT(CLASSTXT,1,33)),!
SET NURSW1=1
+23 QUIT
End DoDot:4
+24 QUIT
End DoDot:3
WRITE !
SET HOLD2=1
+25 QUIT
End DoDot:2
SET HOLD=1
+26 QUIT
End DoDot:1
+27 QUIT
HDR ; PRINT REPORT HEADER
+1 IF NURSW1
IF $EXTRACT(IOST)="C"
DO ENDPG^NURSUT1
IF NUROUT
QUIT
+2 SET COUNT=COUNT+1
SET (NURSW1,HOLD,HOLD2)=1
SET NSW2=0
+3 IF $EXTRACT(IOST)="C"!(COUNT>1)
WRITE @IOF
+4 IF NURMDSW
IF $GET(NURFAC)'=""
WRITE !?$$CNTR^NURSUT2(NURFAC),$$FACL^NURSUT2(NURFAC)
+5 WRITE !,"MANDATORY DEFICIENCY REPORT BY "_$SELECT($GET(NURSEL(1))=2:"SVC. CATEGORY",1:"UNIT")_" FOR "_$SELECT(TYP="C":"CY ",TYP="F":"FY ",1:" ")
+6 WRITE $SELECT(TYP="C"!(TYP="F"):$GET(NYR),1:$GET(YRST(1))_" - "_$GET(YREND(1)))
+7 WRITE ?$SELECT(NURS132:101,1:58)," ",$$FMTE^XLFDT(DT,2),?$SELECT(NURS132:121,1:71),"PAGE: ",COUNT
+8 WRITE !!,?$SELECT(NURS132:50,1:35),"ANNIVERSARY"
+9 WRITE !,"EMPLOYEE NAME",?$SELECT(NURS132:50,1:35),"DATE",?$SELECT(NURS132:79,1:47),"CLASS"
+10 WRITE !,$$REPEAT^XLFSTR("_",$SELECT(NURS132:132,1:80))
PROD IF $GET(NURPLSW)
IF $GET(NURPROG)'=""
NEW Z
SET Z=$$PROD^NURSUT2(NURPROG)
WRITE !,?$$CNTR^NURSUT2(Z),Z,!,?$$CNTR^NURSUT2(NURPROG),$$REPEAT^XLFSTR("-",$LENGTH(Z)+1)
+1 QUIT
SUBHDR ;
+1 IF NUROUT
QUIT
+2 WRITE !,$SELECT($GET(NURSEL(1))=2:"Service Category: ",1:"Unit: ")_$SELECT(NURSPEC=" BLANK":" ",1:NURSPEC)
+3 ; %Compliance = 100% -( ( # of deficient persons on the unit/
+4 ; # of persons on the unit ) * 100%)
+5 WRITE ?40,"% Compliance: ",$JUSTIFY(COMPLIAN,3,0)
IF COMPLIAN=100
IF $GET(NSPC)]""
WRITE ?$X+3,NSPC
+6 WRITE !!
+7 QUIT