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

NURAMH9.m

Go to the documentation of this file.
NURAMH9 ;HIRMFO/JH,FT,MD-MANHOURS EXCEPTION REPORT ;4/28/97
 ;;4.0;NURSING SERVICE;**1,2**;Apr 25, 1997
EN1 ;
 Q:'$D(^DIC(213.9,1,"OFF"))  Q:$P(^DIC(213.9,1,"OFF"),"^",1)=1
 S (NUROUT,NUROUTSW)=0
 S NHOSPSW=0 D WARDSEL^NURARMH0 I NUROUT G QT
 G ASKDAT
EN2 ;
 Q:'$D(^DIC(213.9,1,"OFF"))  Q:$P(^DIC(213.9,1,"OFF"),"^")=1
 S NHOSPSW=1,(NUROUT,NUROUTSW,NURMDSW)=0
 D EN9^NURSAGSP I NURMDSW W ! S DIC(0)="AEQMZ" D EN8^NURSAGSP G QT:$G(NUROUT)
ASKDAT D EN7^NURSAGP1 S NUROUTSW=$G(NUROUT) G:NUROUTSW QT
 S NSP(1)=$P(NDATED,"^"),NSP(2)=$P(NDATED,"^",2)
 W ! S ZTRTN="START^NURAMH9",ZTDESC="MANHOUR EXCEPTION REPORT" D EN7^NURSUT0 G:POP!($D(ZTSK)) QT
START ;
 U IO K ^TMP($J) S (NURSW1,NURPAGE,NBK)=0
 S NURX=+NDATED_" 0" F  S NURX=$O(^NURSA(213.4,"B",NURX)) Q:$E(NURX,1,7)>$P(NDATED,U,2)!(NURX="")  S DA=$O(^NURSA(213.4,"B",NURX,0)) I $G(^NURSA(213.4,DA,0))'="",$P(^(0),U,2)="",$P(^(0),U,3)="",$P(^(0),U,4)="" D  Q:NUROUT
 .  S NURDATA=$G(^NURSA(213.4,DA,0)) Q:NURDATA=""  S (YY(0),NPWARD)=+$E(NURDATA,9,99) S:NHOSPSW NURSWARD=+$E(NURDATA,9,99) I 'NHOSPSW,YY(0)'=NURSWARD Q
 .  Q:+NPWARD'>0!($P($G(^NURSF(211.4,+NPWARD,0)),U)="")!($P($G(^NURSF(211.4,+NPWARD,1)),U)="I")!($P($G(^NURSF(211.4,+NPWARD,"I")),U)="I")
 .  S NURFAC(2)=$S($$EN12^NURSUT3(NPWARD)'="":$$EN12^NURSUT3(NPWARD),1:"  BLANK") I $G(NURFAC)=0,NURFAC(2)'="  BLANK",NURFAC(2)'=NURFAC(1) Q
 .  S NDATE=$E(NURDATA,1,7),NURSHFT=$E(NURDATA,8) S NPWARD=NURSWARD D EN6^NURSAUTL S ^TMP($J,NURFAC(2),NDATE,NPWARD,NURSHFT)=""
 .  Q
 I '$D(^TMP($J)) S NURFAC(2)=$S($G(NURFAC)=0:NURFAC(1),1:"") D HEADER S Y=NSP(1) D:+Y D^DIQ S Y(1)=Y,Y=NSP(2) D:+Y D^DIQ S Y(2)=Y W !!,$C(7),"No exception records for "_Y(1)_" - "_Y(2) S NUROUT=1 G QT
 S NURFAC(2)="" F  S NURFAC(2)=$O(^TMP($J,NURFAC(2))) Q:NURFAC(2)=""  D:NHOSPSW HEADER D  Q:NUROUT
 .  S NDATE=0 F  S NDATE=$O(^TMP($J,NURFAC(2),NDATE)) Q:NDATE'>0!(NUROUT)  D  Q:NUROUT  S NBK=0
 .  .  S NWRD="" F  S NWRD=$O(^TMP($J,NURFAC(2),NDATE,NWRD)) Q:NWRD=""!(NUROUT)  W ! S NURSHFT="" F  S NURSHFT=$O(^TMP($J,NURFAC(2),NDATE,NWRD,NURSHFT)) Q:NURSHFT=""  D  Q:NUROUT
 .  .  .  I ($Y>(IOSL-6))!'(NURSW1) D HEADER Q:NUROUT
 .  .  .  D:'NBK HEADER1 S NBK=1 W !,?28,$E(NWRD,1,10),?48,$S(NURSHFT="D":"DAY",NURSHFT="E":"EVENING",NURSHFT="N":"NIGHT",1:"")
 .  .  .  Q
 .  .  Q
 .  Q
QT K ^TMP($J) D CLOSE^NURSUT1,^NURAKILL
 Q
 I '$D(ZTSK),$E(IOST)="C",NURSW1 D ENDPG^NURSUT1 Q:NUROUT
 S NURSX="",$P(NURSX,"-",80)="",NURPAGE=NURPAGE+1,Y=DT D:+Y D^DIQ
 W:$E(IOST)="C"!(NURPAGE>1) @IOF
 I NHOSPSW,NURMDSW W !,?$$CNTR^NURSUT2(NURFAC(2)),$$FACL^NURSUT2(NURFAC(2))
 W !,Y,?28,"MANHOURS EXCEPTION REPORT",?66,"PAGE: ",NURPAGE,!!,?28,"LOCATION",?47,"SHIFT",!,NURSX
 S NURSW1=1
 Q
HEADER1 ;
 S Y=NDATE D:+Y D^DIQ W !,?32,Y,!,?32,$$REPEAT^XLFSTR("-",12),!
 Q