source: WorldVistAEHR/trunk/r/NURSING_SERVICE-NUR/NURA5C.m@ 824

Last change on this file since 824 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 5.5 KB
Line 
1NURA5C ;HIRMFO/MD,FT-SALARY REPORT BY LOCATION AND SVC. CATEGORY
2 ;;4.0;NURSING SERVICE;**21**;Apr 25, 1997
3 S X=$G(^DIC(213.9,1,"OFF")) Q:X=""!(X=1)
4 W !
5 S (NURQUEUE,NURSW1,NURPAGE,NUROUT)=0
6 D EN1^NURSAUTL G QUIT:NUROUT
7 I NURMDSW S DIC(0)="AEQZ",NURPLSCR=1 D EN5^NURSAGSP G:$G(NUROUT) QUIT
8 I NURMDSW=0,NURPLSW=1 S NURPLSCR=1 D PRD^NURSAGSP K NURPLSCR I $G(NUROUT) G QUIT
9 W ! D EN1^NURSAGSP G:$G(NUROUT) QUIT
10 D EN3^NURSAGSP G:$G(NUROUT) QUIT
11 W ! S ZTDESC="Salary Report by location and service category",ZTRTN="START^NURA5C" D EN7^NURSUT0 G:POP!($D(ZTSK)) QUIT
12START ;
13 K ^TMP($J) S (CAVG,NAVG,FAVG,LAVG,PAVG,NSALT,PSALT,FSALT,CSALT,LSALT,CSUBC,NSUBC,PSUBC,FSUBC,LSUBC)=0
14 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
15 I '$D(^TMP($J)) S NURPROG(2)=$S($G(NURPROG(1))'="":NURPROG(1),1:"") D HEADER W !,"THERE IS NO DATA FOR THIS REPORT" G QUIT
16 U IO D PRINT
17 S:NUROUT NSALT=NSALT+CSALT D:'NUROUT PGCHK Q:NUROUT
18 S:+NSALT>0 NAVG=NSALT/NSUBC S X="",$P(X,"*",13)="" W !!?22,X,!,"EMPLOYEES COUNTED",?25,$J(NSUBC,9,2),!,"REPORT TOTAL ",?22,$J(NSALT,12,2),!,"AVERAGE SALARY ",?22,$J(NAVG,12,2)
19QUIT K ^TMP($J) D CLOSE^NURSUT1,^NURAKILL
20 Q
21BLD1 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
22 .I $D(^NURSF(211.8,NURNODE4,1,NURNODE5,0)),$P(^(0),U)'>DT&(('$P(^(0),U,6))!($P(^(0),U,6)'<DT)) D BLD2
23 .Q
24 Q
25BLD2 Q:NURSZAP>7&(NURSZDA'=DA) S NURSZORT=1 D EN3^NURSAUTL:NURSZAP>6,EN2^NURSAUTL:NURSZORT&NURSZAP Q:'NURSZORT
26 S NLOCN=$S($D(^NURSF(211.8,NURNODE4,0)):$P(^(0),U),1:" BLANK")
27 I +NLOCN S NPWARD=NLOCN D EN7^NURSAUTL S NLOCN(1)=$S(NPWARD'="":$E(NPWARD,1,10),1:" BLANK")
28 W:$E(IOST)="C"&($R(100)) "." S NURNEN=4 D SETFAC^NURAAGS1,SETPROG^NURAAGS1,SETCAT^NURAAGS1
29 I $G(NURMDSW),$G(NURFAC)=0,$G(NURFAC(1))'=$G(NURFAC(2)) Q
30 I $G(NURHOSP)=0,'$D(NURSNLOC(NLOCN(1))) Q
31 I $G(NURPLSW),$G(NURPROG)=0,$G(NURPROG(1))'=$G(NURPROG(2)) Q
32 I $E($G(NURSCATY))="O",$P($G(NURSCATY),"O ",2)="" S NURSCATY="O"
33 I $S($E(NURSCATY)'="O":'$D(^TMP("NURSCAT",$J,NURSCATY)),$P($G(NURSCATY),"O ",2)'="":'$D(^TMP("NURSCAT",$J,$E(NURSCATY,3,99))),$P($G(NURSCATY),"O ",2)="":'$D(^TMP("NURSCAT",$J,"O")),1:0) Q
34 I $D(^VA(200,DA(1),0)),$P(^(0),U,1)'="" S N1=$P(^(0),U)
35 E S N1=" BLANK"
36 I $G(NURMDSW),$G(NURFAC)=0,$G(NURFAC(1))'=$G(NURFAC(2)) Q
37 S ^TMP($J,NURFAC(2),NURPROG(2),NLOCN(1),NURSCATY,N1,DA)=+$P($G(^NURSF(211.8,NURNODE4,1,NURNODE5,0)),U,4)
38 Q
39 ; DETAIL LINE PRINT ROUTINE
40PRINT S NURFAC(2)="" F S NURFAC(2)=$O(^TMP($J,NURFAC(2))) Q:NURFAC(2)=""!(NUROUT) D P0 Q:NUROUT D:NURMDSW FSUB Q:NUROUT
41 Q
42P0 S NURPROG(2)="" F S NURPROG(2)=$O(^TMP($J,NURFAC(2),NURPROG(2))) Q:NURPROG(2)=""!(NUROUT) D P1 Q:NUROUT I NURPLSW D PSUB Q:NUROUT
43 Q
44P1 S NLOC="" F S NLOC=$O(^TMP($J,NURFAC(2),NURPROG(2),NLOC)) Q:NLOC=""!NUROUT D HEADER Q:NUROUT D P2 Q:NUROUT D LSUB Q:NUROUT
45 Q
46P2 S NURCAT="" F S NURCAT=$O(^TMP($J,NURFAC(2),NURPROG(2),NLOC,NURCAT)) Q:NURCAT=""!(NUROUT) D P3 Q:NUROUT D CSUB Q:NUROUT W !
47 Q
48P3 S N1="" F S N1=$O(^TMP($J,NURFAC(2),NURPROG(2),NLOC,NURCAT,N1)) Q:N1=""!(NUROUT) S DA=0 F S DA=$O(^TMP($J,NURFAC(2),NURPROG(2),NLOC,NURCAT,N1,DA)) Q:DA'>0 S NFTEE=+^(DA) D WRITE Q:NUROUT
49 Q
50WRITE D PGCHK Q:NUROUT
51 S NURSAL=(+$$EN12^NURSUT0(DA)*NFTEE)
52 I $P($G(^VA(200,$P(^NURSF(210,DA,0),U),0)),U)'="" W !,$S(+NURSAL'>0:"** ",1:" "),$E($P(^(0),U),1,20)
53 E Q
54 W:NURCAT'=" BLANK" ?28,$$CAT^NURSUT2(NURCAT) W ?42,NLOC
55 S DATA=$G(^NURSF(210,DA,7))
56 S DATA(1)=$S($G(^NURSF(211.1,+DATA,0))'="":^(0),1:"")
57 W:DATA(1)'="" ?56,$P(DATA(1),U) W:+NURSAL>0 ?69,$J(NURSAL,6,2)
58 I NURSAL>0 S FSALT=FSALT+NURSAL,FSUBC=FSUBC+1,LSALT=LSALT+NURSAL,LSUBC=LSUBC+1,CSALT=CSALT+NURSAL,CSUBC=CSUBC+1,PSALT=PSALT+NURSAL,PSUBC=PSUBC+1,NSALT=NSALT+NURSAL,NSUBC=NSUBC+1
59 Q
60CSUB ; CATEGORY SUBTLS/AVG
61 D PGCHK Q:NUROUT W !!?20,"-------------"
62 S:CSALT>0 CAVG=CSALT/CSUBC
63 W !,"EMPLOYEES COUNTED:",?25,$J(CSUBC,8,2)
64 W !,"CATEGORY SUBTOTAL:",?22,$J(CSALT,11,2)
65 W !,"AVERAGE SALARY:",?22,$J(CAVG,11,2)
66 S (CSALT,CSUBC,CAVG)=0
67 Q
68PSUB ; PRODUCT LINE SUBTLS/AVG
69 D PGCHK Q:NUROUT W !?20,"-------------"
70 S:PSALT>0 PAVG=PSALT/PSUBC
71 W !,"EMPLOYEES COUNTED:",?25,$J(PSUBC,8,2)
72 W !,"PRODUCT LINE SUBTOTAL:",?22,$J(PSALT,11,2)
73 W !,"AVERAGE SALARY:",?22,$J(PAVG,11,2)
74 S (PAVG,PSALT,PSUBC)=0
75 Q
76FSUB ; FACILITY SUBTLS/AVG
77 D PGCHK Q:NUROUT W !?22,"------------"
78 S:FSALT>0 FAVG=FSALT/FSUBC
79 W !,"EMPLOYEES COUNTED:",?25,$J(FSUBC,9,2)
80 W !,"FACILITY SUBTOTAL:",?22,$J(FSALT,12,2)
81 W !,"AVERAGE SALARY:",?22,$J(FAVG,12,2)
82 S (FAVG,FSALT,FSUBC)=0
83 Q
84LSUB ;LOCATION SUBTLS/AVG
85 D PGCHK Q:NUROUT W !?20,"-------------"
86 S:LSALT>0 LAVG=LSALT/LSUBC
87 W !,"EMPLOYEES COUNTED:",?25,$J(LSUBC,8,2)
88 W !,"UNIT SUBTOTAL:",?22,$J(LSALT,11,2)
89 W !,"AVERAGE SALARY:",?22,$J(LAVG,11,2)
90 S (LAVG,LSALT,LSUBC)=0
91 Q
92PGCHK ; FORM FEED CHECK
93 I ($Y>(IOSL-6)) D HEADER
94 Q
95HEADER I 'NURQUEUE,$E(IOST)="C",NURSW1 D ENDPG^NURSUT1 Q:NUROUT
96 S NURPAGE=NURPAGE+1,NURSW1=1 W:$E(IOST)="C"!(NURPAGE>1) @IOF
97 I NURMDSW,$G(NURFAC(2))'="" W ?$$CNTR^NURSUT2(NURFAC(2)),$$FACL^NURSUT2(NURFAC(2))
98 W !!,"STAFF SALARIES BY LOCATION AND SERVICE CATEGORY" S X="T" D ^%DT D:+Y D^DIQ W ?54,Y,?69,"PAGE: ",NURPAGE
99 W !!,?28,"SERVICE",?56,"GRADE/STEP",?69,"GRADE/STEP" W !,"EMPLOYEE NAME",?28,"CATEGORY",?42,"LOCATION",?56,"CODE",?69,"SALARY" W !,$$REPEAT^XLFSTR("-",80)
100 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)
101 Q
Note: See TracBrowser for help on using the repository browser.