Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: NURSEPCA

NURSEPCA.m

Go to the documentation of this file.
NURSEPCA ;HIRMFO/PC,FT-AA/FUNDING REQUEST,PRINT (132 COLUMN REPORT) ;5/7/96  15:08
 ;;4.0;NURSING SERVICE;;Apr 25, 1997
EN1 S X=$G(^PRSE(452.7,1,"OFF")) Q:X=""!(X=1)
 S X=$G(^DIC(213.9,1,"OFF")) Q:X=""!(X=1)
 W ! S (NURQUEUE,NURSW1,NURPAGE,NUROUT)=0
 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
 I NURMDSW S DIC(0)="AEQZ",NURPLSCR=0 D EN5^NURSAGSP G QUIT:$G(NUROUT)
 I NURMDSW=0,NURPLSW=1 S NURPLSCR=1 D PRD^NURSAGSP K NURPLSCR I $G(NUROUT) G QUIT
 ; DATE SELECTION
 D DATSEL^NURSAGP2 G:NUROUT QUIT
 K DIC S DIC("S")="I +$$EN6^NURSUT3($G(Y))"
EN2 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
 I '$D(DTOUT),(X="") S NSP=1 G DEV
 I +Y'>0!$D(DTOUT) S NUROUT=1 G QUIT
 S NDA=+$P($G(Y),U,2),NSPC=$S('$D(^VA(200,+$P($G(Y),U,2),0)):"",1:$P(^(0),"^",1))
DEV W ! S ZTRTN="START^NURSEPCA",NURS132=1 D EN7^NURSUT0 K NURS132 G:POP!($D(ZTSK)) QUIT
START ;
 K ^TMP("NURE",$J) S (HOLD,HOLD(1))=1,(NTOTAL3,NTOTAL4)=0
 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
 .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
 ..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
 ..Q
 .Q
 I '$G(NSP) S DA=$O(^NURSF(210,"B",+NDA,0)) D
 .F NURNODE4=0:0 S NURNODE4=$O(^NURSF(211.8,"C",NDA,NURNODE4)) Q:NURNODE4'>0  D
 ..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
 ..D SORT
 ..Q
 S X=$O(^TMP("NURE",$J,"")),NWRD("F")=$O(NURSNLOC(""))
 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
 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),!
QUIT K ^TMP("NURE",$J),N,NTOTAL3,NTOTAL4,NFUND D CLOSE^NURSUT1,^NURSKILL
 Q
SORT ;
 Q:NDA'>0!(NURSZAP>7&(NURSZDA'=DA))  S NURSZORT=1 D EN3^NURSAUTL:NURSZAP>6,EN2^NURSAUTL:NURSZORT&NURSZAP Q:'NURSZORT
 W:$E(IOST)="C"&($R(5000)) "." I $D(^VA(200,NDA,0)),$P(^(0),"^",1)'="" S N1=$P(^(0),"^",1)
 E  S N1="  BLANK"
 D EN2^NURSUT0 S SP=NPSPOS(1)
 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
 .   S NURNEN=1 D SETPROG^NURAAGS1,SETFAC^NURAAGS1
 .   I NURMDSW,'$G(NURFAC),$G(NURFAC(1))'=$G(NURFAC(2)) Q
 .   I NURPLSW,'$G(NURPROG),$G(NURPROG(1))'=$G(NURPROG(2)) Q
 .   S:NURPROG(2)="NURSING" NURPROG(2)=" "_NURPROG(2)
 .   S NDP(1)=$P((9999999-NDP),U) I NDP(1)<YRST!(NDP(1)>YREND) Q
 .   I 'NSP,N1'=NSPC Q
 .   S ^TMP("NURE",$J,NURFAC(2),NURPROG(2),$E(NDP(1),1,7),N1,NURI,DA)=$$CAT^NURSUT2(SP)
 .   Q
 Q