source: WorldVistAEHR/trunk/r/NURSING_SERVICE-NUR/NURA9I.m@ 1211

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

initial load of WorldVistAEHR

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