source: FOIAVistA/trunk/r/NURSING_SERVICE-NUR/NURA6I2.m@ 794

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

initial load of FOIAVistA 6/30/08 version

File size: 4.9 KB
Line 
1NURA6I2 ;HIRMFO/MD,RM,FT-NPSB REPORT FOR ENTIRE SERVICE ;8/23/96 09:46
2 ;;4.0;NURSING SERVICE;**13**;Apr 25, 1997
3 Q:'$D(^DIC(213.9,1,"OFF")) Q:$P(^DIC(213.9,1,"OFF"),"^",1)=1
4 S (NURQUEUE,NURQUIT,NURPLSW,NURMDSW,NURSW1,NURPAGE,NUROUT)=0,NRNLPN=1
5 D EN1^NURSAUTL G QUIT:NUROUT D EN9^NURSAGSP
6 I NURMDSW S DIC(0)="AEQMZ",NURPLSCR=0 D EN5^NURSAGSP K NURPLSCR I $G(NUROUT) G QUIT
7 I NURMDSW=0,NURPLSW=1 S NURPLSCR=0 D PRD^NURSAGSP K NURPLSCR I $G(NUROUT) G QUIT
8 D EN3^NURSAGSP G QUIT:NUROUT
9 D EN1^NURSAGP1 G QUIT:NUROUT
10 W ! S ZTDESC="NPSB Report for Entire Nursing Service",ZTRTN="START^NURA6I2",NURS132=1 D EN7^NURSUT0 G:POP!($D(ZTSK)) QUIT
11START ;
12 K ^TMP($J)
13 S X="" F S X=$O(^NURSF(210,"AC",X)) Q:X="" I X'="R" F DA=0:0 S DA=$O(^NURSF(210,"AC",X,DA)) Q:DA'>0 I $D(^NURSF(210,DA,0)),+$P(^(0),U) S DA(1)=$P(^(0),U) W:$R(100)&($E(IOST)="C") "." D SORT1
14 W ! S X=$O(^TMP($J,""))
15 I X="" S NURFAC(2)=$S($G(NURFAC)=0:$G(NURFAC(1)),1:""),NURPROG(2)=$S($G(NURPROG)=0:$G(NURPROG(1)),1:"") D NHDR W !,"THERE IS NO DATA FOR THIS REPORT" G QUIT
16 U IO S (NURQUIT,NURPAGE,NURSW1,NUROUT)=0 D NPRINT
17QUIT K ^TMP($J) D CLOSE^NURSUT1,^NURAKILL
18 Q
19SORT1 F NURNODE4=0:0 S NURNODE4=$O(^NURSF(211.8,"C",DA(1),NURNODE4)) Q:NURNODE4'>0 F NURNODE5=0:0 S NURNODE5=$O(^NURSF(211.8,"C",DA(1),NURNODE4,NURNODE5)) Q:NURNODE5'>0 D
20 .I $D(^NURSF(211.8,NURNODE4,1,NURNODE5,0)),$P(^(0),U)'>DT&(('$P(^(0),U,6))!($P(^(0),U,6)'<DT)) D SORT2
21 .Q
22 Q
23SORT2 Q:NURSZAP>7&(NURSZDA'=DA) S NURSZORT=1 D EN3^NURSAUTL:NURSZAP>6,EN2^NURSAUTL:NURSZORT&NURSZAP Q:'NURSZORT
24 I NURMDSW S NURFAC(2)=$$EN11^NURSUT3($G(NURNODE4)) Q:$G(NURFAC(2))=""
25 E S NURFAC(2)=" BLANK"
26 I NURPLSW S NURPROG(3)=$P($G(^NURSF(211.8,NURNODE4,1,NURNODE5,0)),U,3),NURPROG(2)=$P($G(^NURSF(211.3,+NURPROG(3),0)),U,7) S:NURPROG(2)="" NURPROG(2)=+$O(^NURSF(212.7,"B","NURSING",0)) S NURPROG(2)=$$GET1^DIQ(212.7,NURPROG(2),.01,"I")
27 E S NURPROG(2)=" BLANK"
28 I NURMDSW,'$G(NURFAC),$G(NURFAC(1))'=$G(NURFAC(2)) Q
29 I NURPLSW,'$G(NURPROG),$G(NURPROG(1))'=$G(NURPROG(2)) Q
30 I $D(^VA(200,DA(1),0)),$P(^(0),"^",1)'="" S N1=$P(^(0),"^",1)
31 E S N1=" BLANK"
32 S NLO=$S($D(^NURSF(211.8,NURNODE4,0))&($P(^(0),"^")'=""):$P(^(0),"^"),1:" BLANK")
33 E S NLO=" BLANK"
34 I $D(^NURSF(211.4,"B",+NLO)) S NLO(1)=$O(^NURSF(211.4,"B",+NLO,0)) I $D(^NURSF(211.4,+NLO(1),"I")),$E($P(^("I"),"^"))="I" Q
35 D EN2^NURSUT0 Q:$G(NPSPOS(1))="" I '+NURCAT,'$D(^TMP("NURSCAT",$J,NPSPOS(1))) Q
36 S NPWARD=NLO D EN7^NURSAUTL S NL1=$S(NPWARD'="":NPWARD,1:" BLANK")
37 D SETCAT^NURAAGS1
38 I NURSCATY="R"!(NURSCATY="L")!($E(NURSCATY)="O") F D1=0:0 S D1=$O(^NURSF(210,DA,14,D1)) Q:D1'>0 S ATD=$S(+$P($G(^NURSF(210,DA,14,D1,0)),U,3):$P(^(0),U,3),1:" BLANK") D SAVE
39 Q
40SAVE I 'NSP,ATD<NSPC!(ATD>NSPC(2)) Q
41 S:NURPROG(2)="NURSING" NURPROG(2)=" "_NURPROG(2)
42 S ^TMP($J,NURFAC(2),NURPROG(2),ATD,NL1,NURSCATY,N1,DA,D1)=""
43 Q
44NPRINT S NURFAC(2)="" F S NURFAC(2)=$O(^TMP($J,NURFAC(2))) Q:NURFAC(2)="" S NBRK=0 D NHDR D NL Q:NUROUT
45 Q
46NL S NURPROG(4)="" F S NURPROG(4)=$O(^TMP($J,NURFAC(2),NURPROG(4))) Q:NURPROG(4)=""!NUROUT D:$G(NURPLSW)&(NBRK=0) BRK D NM Q:NUROUT W:$G(NURPLSW) !
47 Q
48NM S ATD="" F S ATD=$O(^TMP($J,NURFAC(2),NURPROG(4),ATD)) Q:ATD="" D NO Q:NURQUIT
49 Q
50NO S NL1="" F S NL1=$O(^TMP($J,NURFAC(2),NURPROG(4),ATD,NL1)) Q:NL1="" D NR0 Q:NURQUIT
51 Q
52NR0 S NURCAT="" F S NURCAT=$O(^TMP($J,NURFAC(2),NURPROG(4),ATD,NL1,NURCAT)) Q:NURCAT="" D NR Q:NURQUIT
53 Q
54NR S N1="" F S N1=$O(^TMP($J,NURFAC(2),NURPROG(4),ATD,NL1,NURCAT,N1)) Q:N1="" D NS Q:NURQUIT
55 Q
56NS F DA=0:0 S DA=$O(^TMP($J,NURFAC(2),NURPROG(4),ATD,NL1,NURCAT,N1,DA)) Q:DA'>0 F D1=0:0 S D1=$O(^TMP($J,NURFAC(2),NURPROG(4),ATD,NL1,NURCAT,N1,DA,D1)) Q:D1'>0 D NPPRINT Q:NURQUIT
57 Q
58NPPRINT I ($Y>(IOSL-10)) D NHDR Q:NURQUIT
59 S:'NURSW1 NURSW1=1 S:'NBRK NBRK=1
60 W !?2,$E(N1,1,20)
61 I $D(^VA(200,$P(^NURSF(210,DA,0),"^"),1)),$P(^(1),"^",9)'="" S NURSSN=$P(^(1),"^",9) W ?25,$E(NURSSN,1,3),"-",$E(NURSSN,4,5),"-",$E(NURSSN,6,9)
62 W ?39,$E(NL1,1,10)
63 W:NURCAT="R"!(NURCAT="L") ?51,$$CAT^NURSUT2(NURCAT)
64 S DATA=$G(^NURSF(210,DA,14,D1,0)) F I=4,5,6,3 I +$P(DATA,U,I) S Y=+$P(DATA,U,I) D D^DIQ S ZZ=$S(I=4:61,I=5:77,I=6:93,1:109) W ?ZZ,Y
65 Q
66BRK S NURPROG(2)=$S($G(NURPROG(4))=" BLANK":"NO PRODUCT LINE",$E($G(NURPROG(4)))=" ":$E($G(NURPROG(4)),2,99),1:$G(NURPROG(4))) W !?$$CNTR^NURSUT2(NURPROG(2)),NURPROG(2)
67 S NURLINE="",$P(NURLINE,"-",$L(NURPROG(2))+1)="" W !?$$CNTR^NURSUT2(NURLINE),NURLINE,!
68 Q
69NHDR I 'NURQUEUE,NURSW1,$E(IOST)="C" D ENDPG^NURSUT1 S:NUROUT NURQUIT=+NUROUT Q:NURQUIT
70 S NURPAGE=NURPAGE+1 W:$E(IOST)="C"!(NURPAGE>1) @IOF
71 I $G(NURMDSW) W !,?$$CNTR^NURSUT2(NURFAC(2)),$S($G(NURFAC(2))=" BLANK":"NO FACILITY",1:NURFAC(2))
72 W !,"NURSING SERVICE NPSB PROFILE" S X="T" D ^%DT D:+Y D^DIQ W ?93,Y,?109,"PAGE: ",NURPAGE
73 W !!,?93,"TENTATIVE",!,?51,"SERVICE",?61,"DATE WORK COPY",?77,"DATE RETURNED",?93,"DATE FOR",?109,"ACTUAL DATE"
74 W !,?2,"NAME",?25,"SSN",?39,"LOCATION",?51,"CATEGORY",?61,"IS SENT OUT",?77,"FOR TYPING",?93,"FOR BOARD ACT.",?109,"OF BOARD ACT."
75 W !,$$REPEAT^XLFSTR("-",132)
76 I $G(NURPLSW),$G(NBRK) D BRK
77 Q
Note: See TracBrowser for help on using the repository browser.