source: WorldVistAEHR/trunk/r/NURSING_SERVICE-NUR/NURSEPCA.m@ 1351

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

initial load of WorldVistAEHR

File size: 3.2 KB
Line 
1NURSEPCA ;HIRMFO/PC,FT-AA/FUNDING REQUEST,PRINT (132 COLUMN REPORT) ;5/7/96 15:08
2 ;;4.0;NURSING SERVICE;;Apr 25, 1997
3EN1 S X=$G(^PRSE(452.7,1,"OFF")) Q:X=""!(X=1)
4 S X=$G(^DIC(213.9,1,"OFF")) Q:X=""!(X=1)
5 W ! S (NURQUEUE,NURSW1,NURPAGE,NUROUT)=0
6 D EN1^NURSAUTL G QUIT:NUROUT D EN10^NURSUT3($G(DUZ)) I $G(NURSZAP)>7 S NDA=$O(^NURSF(210,"B",DUZ,0)) G DEV
7 I NURMDSW S DIC(0)="AEQZ",NURPLSCR=0 D EN5^NURSAGSP G QUIT:$G(NUROUT)
8 I NURMDSW=0,NURPLSW=1 S NURPLSCR=1 D PRD^NURSAGSP K NURPLSCR I $G(NUROUT) G QUIT
9 ; DATE SELECTION
10 D DATSEL^NURSAGP2 G:NUROUT QUIT
11 K DIC S DIC("S")="I +$$EN6^NURSUT3($G(Y))"
12EN2 W ! S NSP=0,DIC("A")="Select Nursing Staff Name (Press return for "_$S(DUZ(0)["n"!(DUZ(0)["@"):"entire",1:"your assigned")_" nursing staff): ",DIC(0)="AEMQ",DIC="^NURSF(210," D ^DIC
13 I '$D(DTOUT),(X="") S NSP=1 G DEV
14 I +Y'>0!$D(DTOUT) S NUROUT=1 G QUIT
15 S NDA=+$P($G(Y),U,2),NSPC=$S('$D(^VA(200,+$P($G(Y),U,2),0)):"",1:$P(^(0),"^",1))
16DEV W ! S ZTRTN="START^NURSEPCA",NURS132=1 D EN7^NURSUT0 K NURS132 G:POP!($D(ZTSK)) QUIT
17START ;
18 K ^TMP("NURE",$J) S (HOLD,HOLD(1))=1,(NTOTAL3,NTOTAL4)=0
19 I $G(NSP) F NDA=0:0 S NDA=$O(^NURSF(211.8,"C",NDA)) Q:NDA'>0 F NURNODE4=0:0 S NURNODE4=$O(^NURSF(211.8,"C",NDA,NURNODE4)) Q:NURNODE4'>0 D
20 .F NURNODE5=0:0 S NURNODE5=$O(^NURSF(211.8,"C",NDA,NURNODE4,NURNODE5)) Q:NURNODE5'>0 I $D(^NURSF(211.8,NURNODE4,1,NURNODE5,0)),$P(^(0),U)'>DT&(('$P(^(0),U,6))!($P(^(0),U,6)'<DT)) D
21 ..S DA=$O(^NURSF(210,"B",NDA,0)) I $P($G(^NURSF(210,+DA,0)),U,2)'="" W:$R(500)&($E(IOST)="C") "." D SORT
22 ..Q
23 .Q
24 I '$G(NSP) S DA=$O(^NURSF(210,"B",+NDA,0)) D
25 .F NURNODE4=0:0 S NURNODE4=$O(^NURSF(211.8,"C",NDA,NURNODE4)) Q:NURNODE4'>0 D
26 ..F NURNODE5=0:0 S NURNODE5=$O(^NURSF(211.8,"C",NDA,NURNODE4,NURNODE5)) Q:NURNODE5'>0 I $D(^NURSF(211.8,NURNODE4,1,NURNODE5,0)),$P(^(0),U)'>DT&(('$P(^(0),U,6))!($P(^(0),U,6)'<DT)) D
27 ..D SORT
28 ..Q
29 S X=$O(^TMP("NURE",$J,"")),NWRD("F")=$O(NURSNLOC(""))
30 I X="" S NURSW1="",NURPAGE=0,NURFAC(2)=$S($G(NURFAC)=0:$G(NURFAC(1)),1:""),NURPROG=$S($G(NURPROG)=0:$G(NURPROG(1)),1:"") D NHDR^NURSEPC1 W !,"THERE IS NO DATA FOR "_$S($G(NURHOSP)=0&'$D(NURSNLOC)#2:$G(NWRD("F")),1:"THIS REPORT") G QUIT
31 D EN1^NURSEPC1 I 'NUROUT D:$Y>(IOSL-5) NHDR^NURSEPC1 W:'NUROUT !!,"*** Total Funding Requested: ",$J(NTOTAL3,0,2),!,"*** Total Funding Authorized: ",$J(NTOTAL4,0,2),!
32QUIT K ^TMP("NURE",$J),N,NTOTAL3,NTOTAL4,NFUND D CLOSE^NURSUT1,^NURSKILL
33 Q
34SORT ;
35 Q:NDA'>0!(NURSZAP>7&(NURSZDA'=DA)) S NURSZORT=1 D EN3^NURSAUTL:NURSZAP>6,EN2^NURSAUTL:NURSZORT&NURSZAP Q:'NURSZORT
36 W:$E(IOST)="C"&($R(5000)) "." I $D(^VA(200,NDA,0)),$P(^(0),"^",1)'="" S N1=$P(^(0),"^",1)
37 E S N1=" BLANK"
38 D EN2^NURSUT0 S SP=NPSPOS(1)
39 S NURJ="" F S NURJ=$O(^PRSE(452,"AA","C",NDA,NURJ)) Q:NURJ="" F NDP=0:0 S NDP=$O(^PRSE(452,"AA","C",NDA,NURJ,NDP)) Q:NDP'>0 F NURI=0:0 S NURI=$O(^PRSE(452,"AA","C",NDA,NURJ,NDP,NURI)) Q:NURI'>0 D
40 . S NURNEN=1 D SETPROG^NURAAGS1,SETFAC^NURAAGS1
41 . I NURMDSW,'$G(NURFAC),$G(NURFAC(1))'=$G(NURFAC(2)) Q
42 . I NURPLSW,'$G(NURPROG),$G(NURPROG(1))'=$G(NURPROG(2)) Q
43 . S:NURPROG(2)="NURSING" NURPROG(2)=" "_NURPROG(2)
44 . S NDP(1)=$P((9999999-NDP),U) I NDP(1)<YRST!(NDP(1)>YREND) Q
45 . I 'NSP,N1'=NSPC Q
46 . S ^TMP("NURE",$J,NURFAC(2),NURPROG(2),$E(NDP(1),1,7),N1,NURI,DA)=$$CAT^NURSUT2(SP)
47 . Q
48 Q
Note: See TracBrowser for help on using the repository browser.