source: FOIAVistA/trunk/r/NURSING_SERVICE-NUR/NURA6D1.m@ 1203

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

initial load of FOIAVistA 6/30/08 version

File size: 4.4 KB
Line 
1NURA6D1 ;HIRMFO/MD,RM,FT-FTEE PROFILE BY SERVICE CATEGORY ;8/23/96 12:06
2 ;;4.0;NURSING SERVICE;;Apr 25, 1997
3 Q:'$D(^DIC(213.9,1,"OFF")) Q:$P(^DIC(213.9,1,"OFF"),"^",1)=1
4 S (NURSUMSW,NURPLSW,NURMDSW,NUROUT,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 D EN3^NURSAGSP G:NUROUT QUIT
10 D EN5^NURSAGP0 G QUIT:NUROUT
11 W ! S ZTDESC="FTEE Profile by Service Category",ZTRTN="START^NURA6D1" D EN7^NURSUT0 G:POP!($D(ZTSK)) QUIT
12START ;
13 K ^TMP($J),^TMP("NURA",$J) U IO S (NBRK,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 Q:NURQUIT
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 Q:NURQUIT D NJ Q:NURQUIT D:NURMDSW FSUB Q:NURQUIT
21 Q
22NJ F S NURPROG(2)=$O(^TMP($J,"L",NURFAC(2),NURPROG(2))) Q:NURPROG(2)=""!NURQUIT D:'$G(NURSUMSW) NHDR Q:NURQUIT D NK Q:NURQUIT I $G(NURPLSW),'$G(NURSUMSW) D PSUB Q:NURQUIT
23 Q
24NK S NURCAT="" F S NURCAT=$O(^TMP($J,"L",NURFAC(2),NURPROG(2),NURCAT)) Q:NURCAT="" D NL Q:NURQUIT D NSUB W:'$G(NURSUMSW) ! Q:NURQUIT
25 Q
26NL S NFTEE="" F S NFTEE=$O(^TMP($J,"L",NURFAC(2),NURPROG(2),NURCAT,NFTEE)) Q:NFTEE=""!NURQUIT D NM Q:NURQUIT
27 Q
28NM S DA(1)=0 F S DA(1)=$O(^TMP($J,"L",NURFAC(2),NURPROG(2),NURCAT,NFTEE,DA(1))) Q:DA(1)'>0 D NN Q:NURQUIT
29 Q
30NN S DA(2)=0 F S DA(2)=$O(^TMP($J,"L",NURFAC(2),NURPROG(2),NURCAT,NFTEE,DA(1),DA(2))) Q:DA(2)'>0 S NURSORT=$G(^(DA(2))) I NURSORT D NO Q:NURQUIT
31 Q
32NO S N1="" F S N1=$O(^TMP($J,"L1",NURSORT,N1)) Q:N1="" D NP Q:NURQUIT
33 Q
34NP S D1=0 F S D1=$O(^TMP($J,"L1",NURSORT,N1,D1)) Q:D1'>0 D NPPRINT Q:NURQUIT
35 Q
36NPPRINT I ($Y>(IOSL-6)) D NHDR Q:NURQUIT
37 S NPWARD=$P(^NURSF(211.8,DA(2),0),"^") D EN7^NURSAUTL S NL1=NPWARD
38 S NURSW1=1 S ^TMP("NURA",$J,DA(1),NURSORT)=""
39 S NSUBT=NSUBT+NFTEE,NSUBC=NSUBC+1,NSUBM=NSUBT/NSUBC
40 S PSUBT=PSUBT+NFTEE,PSUBC=PSUBC+1,PSUBM=PSUBT/PSUBC
41 S FSUBT=FSUBT+NFTEE,FSUBC=FSUBC+1,FSUBM=FSUBT/FSUBC
42 Q:NURSUMSW
43 W !,$S(+NFTEE:" ",1:"** ")
44 W:NURCAT'=" BLANK" ?2,$$CAT^NURSUT2(NURCAT)
45 W:NFTEE'=" BLANK" ?18,$J(NFTEE,8,3)
46 W:N1'=" BLANK" ?36,$E(N1,1,20)
47 W:NL1'=" BLANK" ?64,NL1 Q:NURQUIT
48 Q
49NHDR ;
50 I 'NURQUEUE,NURSW1,$E(IOST)="C" D ENDPG^NURSUT1 S:NUROUT NURQUIT=+NUROUT Q:NURQUIT
51 S NURPAGE=NURPAGE+1 W:$E(IOST)="C"!(NURPAGE>1) @IOF
52 I NURMDSW,'NURSUMSW W !,?$$CNTR^NURSUT2(NURFAC(2)),$S($G(NURFAC(2))=" BLANK":"NO FACILITY",1:$G(NURFAC(2)))
53 W !,"FTEE PROFILE BY SERVICE CATEGORY" S X="T" D ^%DT D:+Y D^DIQ W ?56,Y,?72,"PAGE: ",NURPAGE
54 W !
55 W !!,"SERVICE",?36,"EMPLOYEE"
56 W !,"CATEGORY",?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 'NURSUMSW D:($Y>(IOSL-6)) NHDR Q:NURQUIT W !?21,$$REPEAT^XLFSTR("-",5)
62 I '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 S NURNEN=1,NRPT=3 D EN2^NURA9D11
80 S X=$O(^TMP($J,"")) I X="" S NURFAC(2)=$S($G(NURFAC)=0:NURFAC(1),1:""),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.