source: WorldVistAEHR/trunk/r/NURSING_SERVICE-NUR/NURAR1A.m@ 789

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

initial load of WorldVistAEHR

File size: 5.3 KB
Line 
1NURAR1A ;HIRMFO/MD,FT-ACCUMULATES FTEE TOTALS AND RUNS SVC. AMIS 1106b REPORT ;9/18/96 16:57
2 ;;4.0;NURSING SERVICE;;Apr 25, 1997
3HSKEEP ;
4 S X=$G(^DIC(213.9,1,"OFF")) Q:X=""!(X=1)
5 S (NODATSW,NUROUT,NURQUEUE,NURMDSW,NURSW1,NURPAGE)=0
6 D EN9^NURSAGSP I NURMDSW W ! S DIC(0)="AEMQZ" D EN8^NURSAGSP G QUIT:NUROUT
7 I 'NURMDSW S NDA=1,NURFAC=+$G(^NURSA(213.2,NDA,0)),NURFAC("F")=$$GET1^DIQ(4,+NURFAC,.01,"I") D NEXT
8 I NURMDSW,$G(NURFAC)=1 S NDA=0 F S NDA=$O(^NURSA(213.2,NDA)) Q:NDA'>0 S NURFAC("F")=$$GET1^DIQ(4,+$G(^NURSA(213.2,NDA,0)),.01,"I") D NEXT
9 I NURMDSW,$G(NURFAC)=0 S NDA=+Y,NURFAC("F")=$$GET1^DIQ(4,+$G(^NURSA(213.2,NDA,0)),.01,"I") D NEXT
10 I $G(NURFACSW)=1 S NURFAC=0 ;switch NURFAC to 0, not all divisions have data
11 W !!,?19,"THIS REPORT WILL COMPARE THE BUDGETED FTEE"
12 W !,?14,"TOTALS ENTERED IN THE NURS AMIS 1106B FTEE (#213.2) FILE"
13 W !,?10,"AGAINST TODAY'S CURRENT FTEE ENTRIES FOR AMIS SEGMENT 202 (1106B)"
14 ; QUEUE JOB TO TASKMAN
15 W ! S (ZTSAVE("NURSW1"),ZTSAVE("NURPAGE"),ZTSAVE("NURFAC*"))="",ZTRTN="START^NURAR1A" D EN7^NURSUT0 G:POP!($D(ZTSK)) QUIT
16START ;
17 S DA(2)=0 F S DA(2)=$O(^NURSF(211.8,"C",DA(2))) Q:DA(2)'>0 D
18 . S Z=0,Z=$O(^NURSF(210,"B",DA(2),0)) Q:Z="" D:$P($G(^NURSF(210,Z,0)),U,2)="A"
19 . . S DA(1)=0 F S DA(1)=$O(^NURSF(211.8,"C",DA(2),DA(1))) Q:DA(1)'>0 S DA=0 F S DA=$O(^NURSF(211.8,"C",DA(2),DA(1),DA)) Q:DA'>0 D
20 . . . S DA(4)=$P($G(^NURSF(211.8,DA(1),0)),U) Q:DA(4)'>0 I $D(^NURSF(211.4,"B",DA(4))) S DA(5)=0,DA(5)=$O(^NURSF(211.4,"B",DA(4),0)) I $S('$D(^NURSF(211.4,DA(5),"I")):1,$P(^("I"),U)="A":1,1:0) D
21 . . . . W:$E(IOST)="C"&($R(500)) "." S NDATA=$G(^NURSF(211.8,DA(1),1,DA,0)) S NDATA(1)=$S($$EN11^NURSUT3(DA(1))'="":$$EN11^NURSUT3(DA(1)),1:" BLANK")
22 . . . . I $S('+$P(NDATA,U,4):1,+$P(NDATA,U)>DT:1,+$P(NDATA,U,6)&(+$P(NDATA,U,6)<DT):1,1:0) Q
23 . . . . I NURMDSW,$G(NURFAC)=0,$G(NDATA(1))'=" BLANK",$G(NDATA(1))'=$G(NURFAC(1)) Q
24 . . . . I 'NURMDSW,$G(NDATA(1))'=$G(NURFAC("F")) Q
25 . . . . S NFTEE=+$P(NDATA,U,4),NURSCAT=$S($D(^NURSF(211.3,+$P(NDATA,U,3),0)):$P(^(0),U,5),1:""),NAMIS=$S($D(^NURSF(211.3,+$P(NDATA,U,3),0)):+$P(^(0),U,4),1:0)
26 . . . . I '+NAMIS,NURSCAT="R",$D(^NURSF(211.3,+$P(NDATA,U,3),0)) W !,"THE AMIS POSITION FIELD FOR THE "_$P(^(0),U)_" ENTRY IN THE NURS SERVICE POSITION FILE,",!,"#211.3 MUST BE FILLED IN TO GENERATE THIS REPORT",! S NUROUT=1 Q
27 . . . . S NURSCAT(1)=$S(NURSCAT="R":1,NURSCAT="L":2,NURSCAT="N":3,NURSCAT="C":4,NURSCAT="A":5,1:0)
28 . . . . I NURSCAT="R" D
29 . . . . . I NDATA(1)'=" BLANK" S NFCNT(NDATA(1),NAMIS)=NFCNT(NDATA(1),NAMIS)+NFTEE
30 . . . . . E S:'$D(NFCNT(" BLANK",NAMIS)) NFCNT(" BLANK",NAMIS)=0 S NFCNT(" BLANK",NAMIS)=NFCNT(" BLANK",NAMIS)+NFTEE
31 . . . . . Q
32 . . . . I NDATA(1)'=" BLANK",+NURSCAT(1) S NFCNT(NDATA(1),NURSCAT(1))=NFCNT(NDATA(1),NURSCAT(1))+NFTEE
33 . . . . I NDATA(1)=" BLANK",+NURSCAT S:'$D(NFCNT(" BLANK",NURSACT(1))) NFCNT(" BLANK",NURSCAT(1))=0 S NFCNT(" BLANK",NURSCAT(1))=NFCNT(" BLANK",NURSCAT(1))+NFTEE
34 . . . . Q
35 . . . Q
36 . . Q
37 . Q
38 U IO S NY="" F S NY=$O(NFCNT(NY)) Q:NY="" D HEADER Q:NUROUT D Q:NUROUT
39 . S NDA=$P($G(NFCNT(NY,"DATE")),U,2) S NZ=0 F S NZ=$O(^DD(213.2,NZ)) Q:NZ'>0!NUROUT S X=$$VFIELD^DILFD(213.2,NZ) I NZ'<1,NZ'>20,X D Q:NUROUT
40 . . I 'NURSW1!($E(IOST)="C"&($Y>(IOSL-5))) D HEADER Q:NUROUT
41 . . S ND=$S(NZ<17:0,1:.5),ND(1)=$S(NZ<17:$P($G(^NURSA(213.2,+NDA,ND)),U,NZ+1),1:$P($G(^NURSA(213.2,+NDA,ND)),U,NZ-16)) D FIELD^DID(213.2,NZ,"","LABEL","X"),FIELD^DID(213.2,NZ+20,"","LABEL","Y")
42 . . I $D(NFCNT(NY,NZ)) D
43 . . . W !,$P(X("LABEL"),"BUDGETED ",2),?24,$P(X("LABEL")," "),?29,$J(ND(1),8,3),?43,$P(Y("LABEL")," "),?48,$J(NFCNT(NY,NZ),8,3)
44 . . . W ?65,$J((NFCNT(NY,NZ)-ND(1)),9,3)
45 . . . Q
46 . . Q
47 . Q
48QUIT ;
49 D CLOSE^NURSUT1,^NURAKILL
50 Q
51HEADER I NURSW1,$E(IOST)="C" W ! D ENDPG^NURSUT1 Q:NUROUT
52 S NURPAGE=NURPAGE+1,Y=+$G(NFCNT(NY,"DATE")) D:+Y D^DIQ S NURSDATE=Y I $E(IOST)="C"!(NURPAGE>1) W @IOF
53 W ! S X="T" D ^%DT D:+Y D^DIQ W ?2,Y,?65,"PAGE: ",NURPAGE
54 W ! I NURMDSW W ?$$CNTR^NURSUT2(NY),$S(NY=" BLANK":"NO FACILITY",1:NY)
55 W !,?2,"AMIS 10-1106B (SEGMENT 202) CEILING (FTEE) ENTERED ON "_NURSDATE
56 W !,?2,"AND POSITIONS FILLED (FTEE)"
57 W !!,"POSITION",?29,"BUDGETED",?50,"ACTUAL",?66,"VARIANCE"
58 W !,"--------",?29,"--------",?50,"------",?66,"--------"
59 S NURSW1=1
60 Q
61NEXT ;
62 S NODATSW=0
63 I '$D(^NURSA(213.2,NDA,0))!('$D(^NURSA(213.2,NDA,1)))!('$D(^NURSA(213.2,NDA,.5))) S NODATSW=1
64 I NODATSW=0 S:$P(^NURSA(213.2,NDA,1),U,11)="" NODATSW=1 F NURI=1:1:17 S:$P(^NURSA(213.2,NDA,0),U,NURI)="" NODATSW=1
65 I NODATSW=0 F NURI=1:1:4 S:$P(^NURSA(213.2,NDA,.5),U,NURI)="" NODATSW=1
66 I NODATSW=1 D Q
67 .W !!,$C(7),"*** YOU ARE MISSING DATA IN THE "_NURFAC("F"),!," AMIS 1106B FTEE (213.2) FILE ENTRY.",!," CONTACT THE NURSING APPLICATION COORDINATOR.",!
68 .S:(NURMDSW&($G(NURFAC)=1)) NURFACSW=1 ;set flag to change NURFAC from 1 to 0
69 .Q
70 I NURMDSW,'$G(NURFAC),NURFAC("F")'=NURFAC(1) Q
71 F NURI=1:1:20 S NFCNT(NURFAC("F"),NURI)=0
72 S:'+$G(NFCNT(NURFAC("F"),"DATE")) NFCNT(NURFAC("F"),"DATE")=$P(^NURSA(213.2,NDA,1),U,11)_U_NDA
73 S NBUDCK=$P(^NURSA(213.2,NDA,0),U,2)
74 S NBUDCK1=0
75 F NURI=7:1:17 S NBUDCK1=NBUDCK1+$P(^NURSA(213.2,NDA,0),U,NURI)
76 F NURI=1:1:4 S NBUDCK1=NBUDCK1+$P(^NURSA(213.2,NDA,.5),U,NURI)
77 I NBUDCK'=NBUDCK1 W !!!,"INCORRECT BUDGET ENTRIES EXIST IN "_NURFAC("F")_":",!,"NUMBER OF RN'S BUDGETED MUST EQUAL SUM OF",!,"CATEGORIES 06 THRU 20 (E.G. CLIN SPECIALIST, RN PRACTITIONER, ETC.",!,"CONTACT NURSING APPLICATION COORDINATOR" Q
78 Q
Note: See TracBrowser for help on using the repository browser.