source: WorldVistAEHR/trunk/r/NURSING_SERVICE-NUR/NURA6D2.m@ 632

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

initial load of WorldVistAEHR

File size: 4.4 KB
Line 
1NURA6D2 ;HIRMFO/MD,RM,FT-FTEE PROFILE BY SERVICE POSITION ;8/24/96 10:29
2 ;;4.0;NURSING SERVICE;**7**;Apr 25, 1997
3 Q:'$D(^DIC(213.9,1,"OFF")) Q:$P(^DIC(213.9,1,"OFF"),"^",1)=1
4 S (NURSUMSW,NUROUT,NURMDSW,NURPLSW,NURQUEUE)=0
5 D EN1^NURSAUTL G QUIT:NUROUT
6 D EN9^NURSAGSP
7 I NURMDSW D EN12^NURSAGSP G:$G(NUROUT) QUIT S DIC(0)="AEMQZ",NURPLSCR=0 D EN5^NURSAGSP K NURPLSCR I $G(NUROUT) G QUIT
8 I NURMDSW=0,NURPLSW=1 S NURPLSCR=0 D PRD^NURSAGSP K NURPLSCR I $G(NUROUT) G QUIT
9 W ! D EN2^NURSAGSP G:NUROUT QUIT
10 D EN5^NURSAGP0 G QUIT:NUROUT
11 W ! S ZTDESC="FTEE Profile by Service Position",ZTRTN="START^NURA6D2" D EN7^NURSUT0 G:POP!($D(ZTSK)) QUIT
12START ;
13 K ^TMP($J),^TMP("NURA",$J) U IO S (NURPAGE,NURSW1,NURQUIT,NCT,NTCT,NSUBT,NSUBC,PCT,PSUBT,PSUBC,FCT,FSUBT,FSUBC)=0
14 D SORT G:NUROUT QUIT D:$G(NURSUMSW) NHDR Q:NURQUIT D NPRINT S:NURQUIT NCT=NCT+NSUBT I ($Y>(IOSL-6)),'NURQUIT D NHDR
15 S NURLINE="",$P(NURLINE,"*",7)=""
16 D EN2^NURAED3 W !?20,NURLINE,!,"TOTAL",?18,$J(NCT,8,3),!!,"COUNT - ASSIGN.",?18,$J(NTCT,8,3),?36,"PERSONNEL",?61,$J(NTOT,8,3)
17 W !!,"MEAN - ASSIGN.",?18,$S(NCT>0&(NTCT>0):$J((NCT/NTCT),8,3),1:" 0.000"),?36,"PERSONNEL",?61,$S(NCT>0&(NTOT>0):$J((NCT/NTOT),8,3),1:" 0.000")
18QUIT K ^TMP("NURA",$J),^TMP($J) D CLOSE^NURSUT1,^NURAKILL
19 Q
20NPRINT S (NURPROG(2),NURFAC(2))="" F S NURFAC(2)=$O(^TMP($J,"L",NURFAC(2))) Q:NURFAC(2)=""!NURQUIT D NL Q:NURQUIT D:NURMDSW FSUB Q:NURQUIT
21 Q
22NL F S NURPROG(2)=$O(^TMP($J,"L",NURFAC(2),NURPROG(2))) Q:NURPROG(2)=""!NURQUIT D:'$G(NURSUMSW) NHDR D NM Q:NURQUIT I $G(NURPLSW),'$G(NURSUMSW) D PSUB Q:NURQUIT
23 Q
24NM S NPRI="" F S NPRI=$O(^TMP($J,"L",NURFAC(2),NURPROG(2),NPRI)) Q:NPRI="" D NE Q:NURQUIT D NSUB W:'$G(NURSUMSW) ! Q:NURQUIT
25 Q
26NE S NSPO="" F S NSPO=$O(^TMP($J,"L",NURFAC(2),NURPROG(2),NPRI,NSPO)) Q:NSPO="" D NN Q:NURQUIT
27 Q
28NN S NFTEE="" F S NFTEE=$O(^TMP($J,"L",NURFAC(2),NURPROG(2),NPRI,NSPO,NFTEE)) Q:NFTEE=""!NURQUIT D NO Q:NURQUIT
29 Q
30NO S DA(1)=0 F S DA(1)=$O(^TMP($J,"L",NURFAC(2),NURPROG(2),NPRI,NSPO,NFTEE,DA(1))) Q:DA(1)'>0 D NP Q:NURQUIT
31 Q
32NP S DA(2)=0 F S DA(2)=$O(^TMP($J,"L",NURFAC(2),NURPROG(2),NPRI,NSPO,NFTEE,DA(1),DA(2))) Q:DA(2)'>0 S NURSORT=$G(^(DA(2))) I NURSORT D NQ
33 Q
34NQ S N1="" F S N1=$O(^TMP($J,"L1",NURSORT,N1)) Q:N1="" D NR Q:NURQUIT
35 Q
36NR S DA=0 F S DA=$O(^TMP($J,"L1",NURSORT,N1,DA)) Q:DA'>0 D NPPRINT Q:NURQUIT
37 Q
38NPPRINT I ($Y>(IOSL-6)) D NHDR Q:NURQUIT
39 S NPWARD=$P(^NURSF(211.8,DA(2),0),"^") D EN7^NURSAUTL S NL1=NPWARD
40 S NURSW1=1 S ^TMP("NURA",$J,DA(1),NURSORT)=""
41 S NSUBT=NSUBT+NFTEE,NSUBC=NSUBC+1,NSUBM=NSUBT/NSUBC
42 S PSUBT=PSUBT+NFTEE,PSUBC=PSUBC+1,PSUBM=PSUBT/PSUBC
43 S FSUBT=FSUBT+NFTEE,FSUBC=FSUBC+1,FSUBM=FSUBT/FSUBC
44 Q:$G(NURSUMSW)
45 W !,$S(+NFTEE:" ",1:"** ")
46 W:NSPO'=" BLANK" ?2,NSPO
47 W:NFTEE'=" BLANK" ?18,$J(NFTEE,8,3)
48 W:N1'=" BLANK" ?36,$E(N1,1,20)
49 W:NL1'=" BLANK" ?64,NL1 Q:NURQUIT
50 Q
51NHDR I 'NURQUEUE,NURSW1,$E(IOST)="C" D ENDPG^NURSUT1 S:NUROUT NURQUIT=+NUROUT Q:NURQUIT
52 S NURPAGE=NURPAGE+1 W:$E(IOST)="C"!(NURPAGE>1) @IOF
53 I NURMDSW W !,?$$CNTR^NURSUT2(NURFAC(2)),$S($G(NURFAC(2))=" BLANK":"NO FACILITY",1:$G(NURFAC(2)))
54 W !,"FTEE PROFILE BY SERVICE POSITION" S X="T" D ^%DT D:+Y D^DIQ W ?56,Y,?72,"PAGE: ",NURPAGE
55 W !!,"SERVICE",?36,"EMPLOYEE"
56 W !,"POSITION",?22,"FTEE",?36,"NAME",?64,"LOCATION"
57 W !,$$REPEAT^XLFSTR("-",80)
58 I NURPLSW,'$G(NURSUMSW) D NHDR1^NURA9D1
59 Q
60NSUB ; SUBTOTAL ROUTINE
61 I '$G(NURSUMSW) D:($Y>(IOSL-6)) NHDR Q:NURQUIT W !?21,$$REPEAT^XLFSTR("-",5)
62 I '$G(NURSUMSW) W !,"SUBTOTAL",?18,$J(NSUBT,8,3),!,"SUBCOUNT",?18,$J(NSUBC,8,3),!,"SUBMEAN" W ?18,$S(NSUBC'=0:$J((NSUBT/NSUBC),8,3),1:" 0.000")
63 S NCT=NSUBT+NCT,NTCT=NTCT+NSUBC
64 S (NSUBC,NSUBM,NSUBT)=0
65 Q
66PSUB ; PRODUCT LINE SUBTOTAL ROUTINE
67 D:($Y>(IOSL-6)) NHDR Q:NURQUIT W !,$S($E(NURPROG(2),1)=" ":$E(NURPROG(2),2,99),1:NURPROG(2))_" TOTALS" W !?20,$$REPEAT^XLFSTR("*",6)
68 W !,"SUBTOTAL",?18,$J(PSUBT,8,3) W:PSUBC'=(0.0) !,"SUBCOUNT",?18,$J(PSUBC,8,3),!,"SUBMEAN" W ?18,$S(PSUBC'=0:$J((PSUBT/PSUBC),8,3),1:" 0.000"),!!
69 S PCT=PSUBT+PCT
70 S (PSUBC,PSUBM,PSUBT)=0
71 Q
72FSUB ; FACILITY SUBTOTAL ROUTINE
73 D:($Y>(IOSL-6)) NHDR Q:NURQUIT W !,NURFAC(2)_" TOTALS" S NURLINE="",$P(NURLINE,"*",7)="" W !?20,NURLINE
74 W !,"SUBTOTAL",?18,$J(FSUBT,8,3) W:FSUBC'=(0.0) !,"SUBCOUNT",?18,$J(FSUBC,8,3),!,"SUBMEAN" W ?18,$S(FSUBC'=0:$J((FSUBT/FSUBC),8,3),1:" 0>000")
75 S FCT=FSUBT+FCT
76 S (FSUBC,FSUBM,FSUBT)=0
77 W:$G(NURSUMSW) !
78 Q
79SORT W ! S NURNEN=2,NRPT=3 D EN2^NURA9D11
80 S X=$O(^TMP($J,"")) I X="" S NURPROG(2)=$S($G(NURPROG)=0:NURPROG(1),1:"") D NHDR W !,"THERE IS NO DATA FOR THIS REPORT" S NUROUT=1
81 Q
Note: See TracBrowser for help on using the repository browser.