source: WorldVistAEHR/trunk/r/NURSING_SERVICE-NUR/NURAMH9.m@ 1006

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

initial load of WorldVistAEHR

File size: 2.7 KB
Line 
1NURAMH9 ;HIRMFO/JH,FT,MD-MANHOURS EXCEPTION REPORT ;4/28/97
2 ;;4.0;NURSING SERVICE;**1,2**;Apr 25, 1997
3EN1 ;
4 Q:'$D(^DIC(213.9,1,"OFF")) Q:$P(^DIC(213.9,1,"OFF"),"^",1)=1
5 S (NUROUT,NUROUTSW)=0
6 S NHOSPSW=0 D WARDSEL^NURARMH0 I NUROUT G QT
7 G ASKDAT
8EN2 ;
9 Q:'$D(^DIC(213.9,1,"OFF")) Q:$P(^DIC(213.9,1,"OFF"),"^")=1
10 S NHOSPSW=1,(NUROUT,NUROUTSW,NURMDSW)=0
11 D EN9^NURSAGSP I NURMDSW W ! S DIC(0)="AEQMZ" D EN8^NURSAGSP G QT:$G(NUROUT)
12ASKDAT D EN7^NURSAGP1 S NUROUTSW=$G(NUROUT) G:NUROUTSW QT
13 S NSP(1)=$P(NDATED,"^"),NSP(2)=$P(NDATED,"^",2)
14 W ! S ZTRTN="START^NURAMH9",ZTDESC="MANHOUR EXCEPTION REPORT" D EN7^NURSUT0 G:POP!($D(ZTSK)) QT
15START ;
16 U IO K ^TMP($J) S (NURSW1,NURPAGE,NBK)=0
17 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
18 . 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
19 . 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")
20 . S NURFAC(2)=$S($$EN12^NURSUT3(NPWARD)'="":$$EN12^NURSUT3(NPWARD),1:" BLANK") I $G(NURFAC)=0,NURFAC(2)'=" BLANK",NURFAC(2)'=NURFAC(1) Q
21 . S NDATE=$E(NURDATA,1,7),NURSHFT=$E(NURDATA,8) S NPWARD=NURSWARD D EN6^NURSAUTL S ^TMP($J,NURFAC(2),NDATE,NPWARD,NURSHFT)=""
22 . Q
23 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
24 S NURFAC(2)="" F S NURFAC(2)=$O(^TMP($J,NURFAC(2))) Q:NURFAC(2)="" D:NHOSPSW HEADER D Q:NUROUT
25 . S NDATE=0 F S NDATE=$O(^TMP($J,NURFAC(2),NDATE)) Q:NDATE'>0!(NUROUT) D Q:NUROUT S NBK=0
26 . . 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
27 . . . I ($Y>(IOSL-6))!'(NURSW1) D HEADER Q:NUROUT
28 . . . D:'NBK HEADER1 S NBK=1 W !,?28,$E(NWRD,1,10),?48,$S(NURSHFT="D":"DAY",NURSHFT="E":"EVENING",NURSHFT="N":"NIGHT",1:"")
29 . . . Q
30 . . Q
31 . Q
32QT K ^TMP($J) D CLOSE^NURSUT1,^NURAKILL
33 Q
34HEADER ;
35 I '$D(ZTSK),$E(IOST)="C",NURSW1 D ENDPG^NURSUT1 Q:NUROUT
36 S NURSX="",$P(NURSX,"-",80)="",NURPAGE=NURPAGE+1,Y=DT D:+Y D^DIQ
37 W:$E(IOST)="C"!(NURPAGE>1) @IOF
38 I NHOSPSW,NURMDSW W !,?$$CNTR^NURSUT2(NURFAC(2)),$$FACL^NURSUT2(NURFAC(2))
39 W !,Y,?28,"MANHOURS EXCEPTION REPORT",?66,"PAGE: ",NURPAGE,!!,?28,"LOCATION",?47,"SHIFT",!,NURSX
40 S NURSW1=1
41 Q
42HEADER1 ;
43 S Y=NDATE D:+Y D^DIQ W !,?32,Y,!,?32,$$REPEAT^XLFSTR("-",12),!
44 Q
Note: See TracBrowser for help on using the repository browser.