NURA5A ;HIRMFO/MD,FT-SALARY REPORT FOR ENTIRE SERVICE ;8/8/96 12:42
;;4.0;NURSING SERVICE;;Apr 25, 1997
Q:'$D(^DIC(213.9,1,"OFF")) Q:$P(^DIC(213.9,1,"OFF"),"^",1)=1
W !
S (NURQUEUE,NURSW1,NURPAGE,NUROUT)=0
D EN1^NURSAUTL G QUIT:NUROUT
I NURMDSW S DIC(0)="AEQZ",NURPLSCR=0 D EN5^NURSAGSP G:$G(NUROUT) QUIT
I NURMDSW=0,NURPLSW=1 S NURPLSCR=1 D PRD^NURSAGSP K NURPLSCR I $G(NUROUT) G QUIT
W ! S ZTDESC="Salary Report for Entire Nursing Service",ZTRTN="START^NURA5A" D EN7^NURSUT0 G:POP!($D(ZTSK)) QUIT
START ;
K ^TMP($J)
S X="" F I=0:0 S X=$O(^NURSF(210,"AC",X)) Q:X="" I X'="R" F DA=0:0 S DA=$O(^NURSF(210,"AC",X,DA)) Q:DA'>0 I $D(^NURSF(210,DA,0)),+$P(^(0),U) S DA(1)=$P(^(0),U) D BLD1
U IO D HEADER,PRINT
QUIT K ^TMP($J) D CLOSE^NURSUT1,^NURAKILL
Q
BLD1 F NURNODE4=0:0 S NURNODE4=$O(^NURSF(211.8,"C",DA(1),NURNODE4)) Q:NURNODE4'>0 F NURNODE5=0:0 S NURNODE5=$O(^NURSF(211.8,"C",DA(1),NURNODE4,NURNODE5)) Q:NURNODE5'>0 D
.I $D(^NURSF(211.8,NURNODE4,1,NURNODE5,0)),$P(^(0),U)'>DT&(('$P(^(0),U,6))!($P(^(0),U,6)'<DT)) D BLD2
.Q
Q
BLD2 Q:NURSZAP>7&(NURSZDA'=DA) S NURSZORT=1 D EN3^NURSAUTL:NURSZAP>6,EN2^NURSAUTL:NURSZORT&NURSZAP Q:'NURSZORT
W:$E(IOST)="C"&($R(100)) "." S NURNEN=1 D SETFAC^NURAAGS1,SETPROG^NURAAGS1
I $D(^VA(200,DA(1),0)),$P(^(0),"^",1)'="" S N1=$P(^(0),"^")
E S N1=" BLANK"
I $G(NURMDSW),'$G(NURFAC),$G(NURFAC(1))'=$G(NURFAC(2)) Q
I $G(NURPLSW),$G(NURPROG)=0,$G(NURPROG(1))'=$G(NURPROG(2)) Q
I $G(NURPLSW) S:NURPROG(2)="NURSING" NURPROG(2)=" NURSING"
S ^TMP($J,NURFAC(2),NURPROG(2),N1,DA)=""
Q
; DETAIL LINE PRINT ROUTINE
PRINT S NURFAC(2)=""
F S NURFAC(2)=$O(^TMP($J,NURFAC(2))) Q:NURFAC(2)=""!(NUROUT) S NURPROG(2)="" F S NURPROG(2)=$O(^TMP($J,NURFAC(2),NURPROG(2))) Q:NURPROG(2)=""!(NUROUT) S N1="" F S N1=$O(^TMP($J,NURFAC(2),NURPROG(2),N1)) Q:N1="" D P1 Q:NUROUT
Q
P1 F DA=0:0 S DA=$O(^TMP($J,NURFAC(2),NURPROG(2),N1,DA)) Q:DA'>0 D WRITE Q:NUROUT
Q
WRITE I ($Y>(IOSL-6)) D HEADER Q:NUROUT
S NURSW1=1
I $D(^VA(200,$P(^NURSF(210,DA,0),"^"),0)),$P(^(0),"^")'="" W !,$E($P(^(0),"^"),1,20)
E Q
S DATA=$S($D(^NURSF(210,DA,7)):^(7),1:"")
I $P(DATA,"^")'="",$D(^NURSF(211.1,$P(DATA,"^"),0)) S DATA(1)=^(0)
E S DATA(1)=""
W:DATA(1)'="" ?32,$P(DATA(1),"^") S NURSAL=+$$EN12^NURSUT0(DA) W ?55,$J(NURSAL,6,2)
Q
S NURPAGE=NURPAGE+1 W:$E(IOST)="C"!(NURPAGE>1) @IOF
I NURMDSW,$G(NURFAC(2))'="" W ?$$CNTR^NURSUT2(NURFAC(2)),$$FACL^NURSUT2(NURFAC(2))
W !!,"NURSING SERVICE STAFF SALARIES" S X="T" D ^%DT D:+Y D^DIQ W ?44,Y,?59,"PAGE: ",NURPAGE
W !!,?32,"GRADE/STEP",?55,"GRADE/STEP" W !,"EMPLOYEE NAME",?32,"CODE",?55,"SALARY" W !,$$REPEAT^XLFSTR("-",70)
I $G(NURPLSW),$G(NURPROG(2))'="" N Z S Z=$$PROD^NURSUT2(NURPROG(2)) W !,?$$CNTR^NURSUT2(NURPROG(2)),$G(Z),!,?$$CNTR^NURSUT2(NURPROG(2)),$$REPEAT^XLFSTR("-",$L(Z)+1)
Q
NURA5A ;HIRMFO/MD,FT-SALARY REPORT FOR ENTIRE SERVICE ;8/8/96 12:42
+1 ;;4.0;NURSING SERVICE;;Apr 25, 1997
+2 IF '$DATA(^DIC(213.9,1,"OFF"))
QUIT
IF $PIECE(^DIC(213.9,1,"OFF"),"^",1)=1
QUIT
+3 WRITE !
+4 SET (NURQUEUE,NURSW1,NURPAGE,NUROUT)=0
+5 DO EN1^NURSAUTL
IF NUROUT
GOTO QUIT
+6 IF NURMDSW
SET DIC(0)="AEQZ"
SET NURPLSCR=0
DO EN5^NURSAGSP
IF $GET(NUROUT)
GOTO QUIT
+7 IF NURMDSW=0
IF NURPLSW=1
SET NURPLSCR=1
DO PRD^NURSAGSP
KILL NURPLSCR
IF $GET(NUROUT)
GOTO QUIT
+8 WRITE !
SET ZTDESC="Salary Report for Entire Nursing Service"
SET ZTRTN="START^NURA5A"
DO EN7^NURSUT0
IF POP!($DATA(ZTSK))
GOTO QUIT
START ;
+1 KILL ^TMP($JOB)
+2 SET X=""
FOR I=0:0
SET X=$ORDER(^NURSF(210,"AC",X))
IF X=""
QUIT
IF X'="R"
FOR DA=0:0
SET DA=$ORDER(^NURSF(210,"AC",X,DA))
IF DA'>0
QUIT
IF $DATA(^NURSF(210,DA,0))
IF +$PIECE(^(0),U)
SET DA(1)=$PIECE(^(0),U)
DO BLD1
+3 USE IO
DO HEADER
DO PRINT
QUIT KILL ^TMP($JOB)
DO CLOSE^NURSUT1
DO ^NURAKILL
+1 QUIT
BLD1 FOR NURNODE4=0:0
SET NURNODE4=$ORDER(^NURSF(211.8,"C",DA(1),NURNODE4))
IF NURNODE4'>0
QUIT
FOR NURNODE5=0:0
SET NURNODE5=$ORDER(^NURSF(211.8,"C",DA(1),NURNODE4,NURNODE5))
IF NURNODE5'>0
QUIT
Begin DoDot:1
+1 IF $DATA(^NURSF(211.8,NURNODE4,1,NURNODE5,0))
IF $PIECE(^(0),U)'>DT&(('$PIECE(^(0),U,6))!($PIECE(^(0),U,6)'<DT))
DO BLD2
+2 QUIT
End DoDot:1
+3 QUIT
BLD2 IF NURSZAP>7&(NURSZDA'=DA)
QUIT
SET NURSZORT=1
IF NURSZAP>6
DO EN3^NURSAUTL
IF NURSZORT&NURSZAP
DO EN2^NURSAUTL
IF 'NURSZORT
QUIT
+1 IF $EXTRACT(IOST)="C"&($RANDOM(100))
WRITE "."
SET NURNEN=1
DO SETFAC^NURAAGS1
DO SETPROG^NURAAGS1
+2 IF $DATA(^VA(200,DA(1),0))
IF $PIECE(^(0),"^",1)'=""
SET N1=$PIECE(^(0),"^")
+3 IF '$TEST
SET N1=" BLANK"
+4 IF $GET(NURMDSW)
IF '$GET(NURFAC)
IF $GET(NURFAC(1))'=$GET(NURFAC(2))
QUIT
+5 IF $GET(NURPLSW)
IF $GET(NURPROG)=0
IF $GET(NURPROG(1))'=$GET(NURPROG(2))
QUIT
+6 IF $GET(NURPLSW)
IF NURPROG(2)="NURSING"
SET NURPROG(2)=" NURSING"
+7 SET ^TMP($JOB,NURFAC(2),NURPROG(2),N1,DA)=""
+8 QUIT
+9 ; DETAIL LINE PRINT ROUTINE
PRINT SET NURFAC(2)=""
+1 FOR
SET NURFAC(2)=$ORDER(^TMP($JOB,NURFAC(2)))
IF NURFAC(2)=""!(NUROUT)
QUIT
SET NURPROG(2)=""
FOR
SET NURPROG(2)=$ORDER(^TMP($JOB,NURFAC(2),NURPROG(2)))
IF NURPROG(2)=""!(NUROUT)
QUIT
SET N1=""
FOR
SET N1=$ORDER(^TMP($JOB,NURFAC(2),NURPROG(2),N1))
IF N1=""
QUIT
DO P1
IF NUROUT
QUIT
+2 QUIT
P1 FOR DA=0:0
SET DA=$ORDER(^TMP($JOB,NURFAC(2),NURPROG(2),N1,DA))
IF DA'>0
QUIT
DO WRITE
IF NUROUT
QUIT
+1 QUIT
WRITE IF ($Y>(IOSL-6))
DO HEADER
IF NUROUT
QUIT
+1 SET NURSW1=1
+2 IF $DATA(^VA(200,$PIECE(^NURSF(210,DA,0),"^"),0))
IF $PIECE(^(0),"^")'=""
WRITE !,$EXTRACT($PIECE(^(0),"^"),1,20)
+3 IF '$TEST
QUIT
+4 SET DATA=$SELECT($DATA(^NURSF(210,DA,7)):^(7),1:"")
+5 IF $PIECE(DATA,"^")'=""
IF $DATA(^NURSF(211.1,$PIECE(DATA,"^"),0))
SET DATA(1)=^(0)
+6 IF '$TEST
SET DATA(1)=""
+7 IF DATA(1)'=""
WRITE ?32,$PIECE(DATA(1),"^")
SET NURSAL=+$$EN12^NURSUT0(DA)
WRITE ?55,$JUSTIFY(NURSAL,6,2)
+8 QUIT
IF $EXTRACT(IOST)="C"
IF NURSW1
DO ENDPG^NURSUT1
IF NUROUT
QUIT
+1 SET NURPAGE=NURPAGE+1
IF $EXTRACT(IOST)="C"!(NURPAGE>1)
WRITE @IOF
+2 IF NURMDSW
IF $GET(NURFAC(2))'=""
WRITE ?$$CNTR^NURSUT2(NURFAC(2)),$$FACL^NURSUT2(NURFAC(2))
+3 WRITE !!,"NURSING SERVICE STAFF SALARIES"
SET X="T"
DO ^%DT
IF +Y
DO D^DIQ
WRITE ?44,Y,?59,"PAGE: ",NURPAGE
+4 WRITE !!,?32,"GRADE/STEP",?55,"GRADE/STEP"
WRITE !,"EMPLOYEE NAME",?32,"CODE",?55,"SALARY"
WRITE !,$$REPEAT^XLFSTR("-",70)
+5 IF $GET(NURPLSW)
IF $GET(NURPROG(2))'=""
NEW Z
SET Z=$$PROD^NURSUT2(NURPROG(2))
WRITE !,?$$CNTR^NURSUT2(NURPROG(2)),$GET(Z),!,?$$CNTR^NURSUT2(NURPROG(2)),$$REPEAT^XLFSTR("-",$LENGTH(Z)+1)
+6 QUIT