source: WorldVistAEHR/trunk/r/NURSING_SERVICE-NUR/NURA9D1.m@ 623

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

initial load of WorldVistAEHR

File size: 5.4 KB
Line 
1NURA9D1 ;HIRMFO/MD,RM,FT-FTEE PROFILE BY LOCATION AND SERVICE CATEGORY ;5/2/97 10:16
2 ;;4.0;NURSING SERVICE;**1,13**;Apr 25, 1997
3 Q:'$D(^DIC(213.9,1,"OFF")) Q:$P(^DIC(213.9,1,"OFF"),"^",1)=1
4 S (NURPLSW,NUROUT,NURMDSW,NURQUEUE)=0
5 D EN1^NURSAUTL G QUIT:$G(NUROUT)
6 D EN9^NURSAGSP
7 I NURMDSW S DIC(0)="AEMQZ",NURPLSCR=1 D EN5^NURSAGSP K NURPLSCR I $G(NUROUT) G 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 D EN5^NURSAGP0 W ! G QUIT:$G(NUROUT)
12 S ZTDESC="Nursing FTEE Profile by Location & Service Category",ZTRTN="START^NURA9D1" D EN7^NURSUT0 G:POP!($D(ZTSK)) QUIT
13START ;
14 K ^TMP($J),^TMP("NURA",$J),^TMP("NURLOC",$J) U IO S (NBRK,NURPAGE,NURSW1,NURQUIT,NTCT,NCT,NSUBT,NSUBC,PCT,PSUBT,PSUBC,FCT,FSUBT,FSUBC)=0
15 D SORT G:NUROUT QUIT D NPRINT S:NURQUIT NCT=NCT+NSUBT I ($Y>(IOSL-6)),'NURQUIT D NHDR
16 S NURLINE="",$P(NURLINE,"*",7)=""
17 D EN2^NURAED3 W !!,?20,NURLINE,!,"REPORT TOTAL",?18,$J(NCT,8,3),!!,"COUNT - ASSIGN.",?18,$J(NTCT,8,3) W ?36,"PERSONNEL",?62,$J(NTOT,8,3)
18 W !!,"MEAN - ASSIGN.",?18,$S(NCT>0&(NTCT>0):$J((NCT/NTCT),8,3),1:" 0.000"),?36,"PERSONNEL",?62,$S(NCT>0&(NTOT>0):$J((NCT/NTOT),8,3),1:" 0.000")
19QUIT K ^TMP("NURA",$J),^TMP($J),NTOUR,NUR,NUM D CLOSE^NURSUT1,^NURAKILL
20 Q
21NPRINT S (NURPROG(2),NURFAC(2))="" F S NURFAC(2)=$O(^TMP($J,"L",NURFAC(2))) Q:NURFAC(2)=""!NURQUIT D NK Q:NURQUIT D:NURMDSW FSUB Q:NURQUIT
22 Q
23NK F S NURPROG(2)=$O(^TMP($J,"L",NURFAC(2),NURPROG(2))) Q:NURPROG(2)=""!NURQUIT D NHDR Q:NURQUIT D NL Q:NURQUIT I NURPLSW D PSUB Q:NURQUIT
24 Q
25NL S NL1="" F S NL1=$O(^TMP($J,"L",NURFAC(2),NURPROG(2),NL1)) Q:NL1=""!NURQUIT D NM Q:NURQUIT D NHDR Q:NURQUIT
26 Q
27NM S NURCAT="" F S NURCAT=$O(^TMP($J,"L",NURFAC(2),NURPROG(2),NL1,NURCAT)) Q:NURCAT=""!NURQUIT D NN Q:NURQUIT D NSUB W ! Q:NURQUIT
28 Q
29NN S NFTEE="" F S NFTEE=$O(^TMP($J,"L",NURFAC(2),NURPROG(2),NL1,NURCAT,NFTEE)) Q:NFTEE=""!NURQUIT S NURSORT=$G(^(NFTEE)) I NURSORT D NOT Q:NURQUIT
30 Q
31NOT S N1="" F S N1=$O(^TMP($J,"L1",NURSORT,N1)) Q:N1=""!NURQUIT S NUM(1)=0 F S NUM(1)=$O(^TMP($J,"L1",NURSORT,N1,NUM(1))) Q:NUM(1)'>0!NURQUIT D NOT1
32 Q
33NOT1 S NUM(2)=0 F S NUM(2)=$O(^TMP($J,"L1",NURSORT,N1,NUM(1),NUM(2))) Q:NUM(2)'>0 D NP Q:NURQUIT
34 Q
35NP S DA(1)=0 F S DA(1)=$O(^TMP($J,"L1",NURSORT,N1,NUM(1),NUM(2),DA(1))) Q:DA(1)'>0 D NPPRINT Q:NURQUIT
36 Q
37NPPRINT I ($Y>(IOSL-6)) D NHDR Q:NURQUIT
38 S NTOUR=DA(1) D S NTOUR=NUR(1)
39 .N DA S DA=NTOUR D EN9^NURSUT0
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 W !,$S(+NFTEE:" ",1:"** ")
45 W:NURCAT'=" BLANK" $$CAT^NURSUT2(NURCAT)
46 W:NFTEE'=" BLANK" ?18,$J(NFTEE,8,3)
47 W:N1'=" BLANK" ?36,$E(N1,1,20)
48 W:NL1'=" BLANK" ?64,$E(NL1,1,15) W:IOM>120 ?85,NTOUR Q:NURQUIT
49 Q
50NHDR I 'NURQUEUE,NURSW1,$E(IOST)="C" D ENDPG^NURSUT1 S:$G(NUROUT) NURQUIT=+NUROUT Q:NURQUIT
51 S NURPAGE=NURPAGE+1 W:$E(IOST)="C"!(NURPAGE>1) @IOF
52 I NURMDSW,$G(NWRD)="" W !,?$$CNTR^NURSUT2($G(NURFAC(2))),$S($G(NURFAC(2))=" BLANK":"NO FACILITY",1:$G(NURFAC(2)))
53 W !,"FTEE PROFILE BY LOCATION AND SERVICE CATEGORY" S X="T" D ^%DT D:+Y D^DIQ W ?56,Y,?72,"PAGE: ",NURPAGE
54 W !,"SERVICE",?36,"EMPLOYEE"
55 W !,"CATEGORY",?22,"FTEE",?36,"NAME",?64,"LOCATION" W:IOM>120 ?85,"TOUR"
56 W !
57 S NURLINE="",$P(NURLINE,"-",IOM)="" W NURLINE
58NHDR1 I $G(NURPROG(2))'="",$G(NURPROG(2))'=" BLANK" W !?$$CNTR^NURSUT2(NURPROG(2)),$S($E(NURPROG(2),1)=" ":$E(NURPROG(2),2,99),1:$G(NURPROG(2))) W !?$$CNTR^NURSUT2(NURPROG(2)),$$REPEAT^XLFSTR("-",$L(NURPROG(2))+1),!
59 Q
60NSUB ; SUBTOTAL ROUTINE
61 D:($Y>(IOSL-6)) NHDR Q:NURQUIT W !?21,"-----"
62 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,"******"
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 Q
78SORT W ! S NRPT=3 D EN1^NURA9D11
79 I $O(^TMP($J,""))="",'$D(NURSNLOC) S NUROUT=1 S NURPROG(2)=$S($G(NURPROG)=0:NURPROG(1),1:""),NURFAC(2)=$S($G(NURFAC)=0:NURFAC(1),1:"") D NHDR W !,"THERE IS NO DATA FOR THIS REPORT"
80 I $O(^TMP($J,""))="",$D(NURSNLOC) S NUROUT=1 S NURPROG(2)=$S($G(NURPROG)=0:NURPROG(1),1:""),NURFAC(2)=$S($G(NURFAC)=0:NURFAC(1),1:"") D NHDR S NL1="" F S NL1=$O(NURSNLOC(NL1)) Q:NL1="" D NODATA^NURSUT1
81 I $O(^TMP($J,""))'="",$D(NURSNLOC) D I NURSW1=1 D ENDPG^NURSUT1 S NURSW1=0
82 . S (NURY,NURZ,NURX)="" F S NURY=$O(^TMP($J,"L",NURY)) Q:NURY="" F S NURZ=$O(^TMP($J,"L",NURY,NURZ)) Q:NURZ="" F S NURX=$O(^TMP($J,"L",NURY,NURZ,NURX)) Q:NURX="" S ^TMP("NURLOC",$J,NURX)=""
83 . S NL1="" F S NL1=$O(NURSNLOC(NL1)) Q:NL1="" I '$D(^TMP("NURLOC",$J,NL1)) D
84 . . S NURPROG(2)=$S($G(NURPROG)=0:NURPROG(1),1:""),NURFAC(2)=$S($G(NURFAC)=0:NURFAC(1),1:"") D:NURSW1=0 NHDR S NURSW1=1 D NODATA^NURSUT1
85 . . Q
86 . Q
87 Q
Note: See TracBrowser for help on using the repository browser.