source: WorldVistAEHR/trunk/r/NURSING_SERVICE-NUR/NURA6K2.m@ 1696

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

initial load of WorldVistAEHR

File size: 4.1 KB
Line 
1NURA6K2 ;HIRMFO/MD,FT-NURSING SERVICE PROFICIENCY REPORT BY SERVICE ; 1/3/03 1:14pm
2 ;;4.0;NURSING SERVICE;**38**;Apr 25, 1997
3 Q:'$D(^DIC(213.9,1,"OFF")) Q:$P(^DIC(213.9,1,"OFF"),"^",1)=1
4 S (NURQUIT,NURQUEUE,NUROUT)=0,NURHOSP=1
5 D EN1^NURSAUTL G QUIT:NUROUT
6 I NURMDSW S DIC(0)="AEQMZ" S NURPLSCR=0 D EN5^NURSAGSP G QUIT:$G(NUROUT)
7 I NURMDSW=0,NURPLSW=1 S NURPLSCR=0 D PRD^NURSAGSP K NURPLSCR I $G(NUROUT) G QUIT
8 D EN4^NURSAGP1 G QUIT:NUROUT
9 W ! S ZTDESC="Nursing Service Proficiency Report by Service",ZTRTN="START^NURA6K2",NURS132=1 D EN7^NURSUT0 G:POP!($D(ZTSK)) QUIT
10START ;
11 K ^TMP($J)
12 S X="",(NURQUIT,NURSW1,NURPAGE)=0 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 SORT
13 S X=$O(^TMP($J,"")) I X="" D NHDR W !,"THERE IS NO DATA FOR THIS REPORT" S DIR(0)="E" D:$E(IOST)="C" ^DIR S NUROUT=1 G QUIT
14 U IO D NPRINT
15QUIT K ^TMP($J) D CLOSE^NURSUT1,^NURAKILL
16 Q
17SORT ; POSITION SORT
18 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
19 .I $D(^NURSF(211.8,NURNODE4,1,NURNODE5,0)),$P(^(0),U)'>DT&(('$P(^(0),U,6))!($P(^(0),U,6)'<DT)) D SORT1
20 .Q
21 Q
22SORT1 Q:NURSZAP>7&(NURSZDA'=DA) S NURSZORT=1 D EN3^NURSAUTL:NURSZAP>6,EN2^NURSAUTL:NURSZORT&NURSZAP Q:'NURSZORT
23 S NURNEN=1 D SETFAC^NURAAGS1,SETPROG^NURAAGS1
24 I $D(^VA(200,DA(1),0)) S N1=$S($P(^(0),"^",1)'="":$P(^(0),"^",1),1:" BLANK")
25 I $D(^VA(200,DA(1),1)) S SSN=$S($P(^(1),"^",9)'="":$P(^(1),"^",9),1:" BLANK")
26 S NLO=$S($D(^NURSF(211.8,NURNODE4,0))&$P(^NURSF(211.8,NURNODE4,0),"^")'="":$P(^(0),"^"),1:" BLANK")
27 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
28 D EN2^NURSUT0 S NURSER=$G(NPSPOS(1))
29 S NPWARD=NLO D EN7^NURSAUTL S NL1=$S(NPWARD'="":NPWARD,1:" BLANK")
30 Q:NURSER=""!'(NURSER="R")
31 I '$D(^NURSF(210,DA,14,0)) Q
32 S NURPROG("TST")=$G(NURPROG(2))
33 S NN=0 F II=0:0 S NN=$O(^NURSF(210,DA,14,NN)) Q:NN'>0 D NGO
34 K NURPROG("TST")
35 Q
36NGO I '$D(^NURSF(210,DA,14,NN,0)) Q
37 S NDATA=^NURSF(210,DA,14,NN,0),NDD=$S($P(NDATA,"^")'="":$P(NDATA,"^"),1:" BLANK"),NEV=$S($P(NDATA,"^",2)>0:$P(^VA(200,+$P(NDATA,"^",2),0),"^"),1:" BLANK")
38 I 'NURHOSP,'$D(NURSNLOC(NLO)) Q
39 I 'NSP,NDD<NSPC!(NDD>NSPC(2)) Q
40 I NURMDSW,'$G(NURFAC),$G(NURFAC(1))'=$G(NURFAC(2)) Q
41 I NURPLSW,'$G(NURPROG),$G(NURPROG(1))'=NURPROG("TST") Q
42 S:NURPROG(2)="NURSING" NURPROG(2)=" "_NURPROG(2)
43 S ^TMP($J,NURFAC(2),NURPROG(2),NDD,NL1,N1,SSN,NEV,DA,NN)=""
44 Q
45NPRINT S NURFAC(2)="" F S NURFAC(2)=$O(^TMP($J,NURFAC(2))) Q:NURFAC(2)=""!NURQUIT D NM Q:NURQUIT
46 Q
47NM S NURPROG(2)="" F S NURPROG(2)=$O(^TMP($J,NURFAC(2),NURPROG(2))) Q:NURPROG(2)=""!NURQUIT D:NURSW1 NHDR Q:NURQUIT D NN Q:NURQUIT
48 Q
49NN S NDD="" F S NDD=$O(^TMP($J,NURFAC(2),NURPROG(2),NDD)) Q:NDD="" D NO Q:NURQUIT
50 Q
51NO S NL1="" F S NL1=$O(^TMP($J,NURFAC(2),NURPROG(2),NDD,NL1)) Q:NL1="" D NR Q:NURQUIT
52 Q
53NR S N1="" F S N1=$O(^TMP($J,NURFAC(2),NURPROG(2),NDD,NL1,N1)) Q:N1="" S SSN=$O(^(N1,"")),NEV=$O(^(SSN,"")),DA=$O(^(NEV,0)),D1=$O(^(DA,0)) D NPPRINT Q:NURQUIT
54 Q
55NPPRINT I ($Y>(IOSL-10))!'(NURSW1) D NHDR Q:NURQUIT
56 W !
57 W:N1'=" BLANK" $E(N1,1,20)
58 W ?23,$E(SSN,1,3),"-",$E(SSN,4,5),"-",$E(SSN,6,9)
59 W:NL1'=" BLANK" ?40,$E(NL1,1,10)
60 S Y=NDD D:Y'=" BLANK" D^DIQ W:Y'=" BLANK" ?51,Y
61 W:NEV'=" BLANK" ?65,NEV
62 S DATA=$G(^NURSF(210,DA,14,D1,0)) F I=4,5 I +$P(DATA,U,I) S Y=$P(DATA,U,I) D D^DIQ S ZZ=$S(I=4:91,1:105) W ?ZZ,Y
63 Q
64NHDR I 'NURQUEUE,NURSW1,$E(IOST)="C" D ENDPG^NURSUT1 S:NUROUT NURQUIT=+NUROUT Q:NURQUIT
65 I 'NURSW1 S NURSW1=1
66 S NURPAGE=NURPAGE+1 W:$E(IOST)="C"!(NURPAGE>1) @IOF
67 I $G(NURMDSW) W !,?$$CNTR^NURSUT2(NURFAC(2)),$$FACL^NURSUT2(NURFAC(2))
68 W !,"NURSING SERVICE PROFICIENCY PROFILE" S X="T" D ^%DT D:+Y D^DIQ W ?90,Y,?105,"PAGE: ",NURPAGE
69 W !!,?51,"DATE",?91,"WORK COPY",?105,"COPY RET'D"
70 W !,"NAME",?23,"SSN",?40,"LOCATION",?51,"DUE",?65,"EVALUATOR",?91,"SENT OUT",?105,"FOR TYPING",!
71 S X="",$P(X,"-",132)="" W X,!
72 I $G(NURPLSW),$G(NURPROG(2))'="" N Z S Z=$$PROD^NURSUT2(NURPROG(2)) W !?$$CNTR^NURSUT2(Z),Z,!?$$CNTR^NURSUT2(Z),$$REPEAT^XLFSTR("-",$L(Z)+1),!
73 Q
Note: See TracBrowser for help on using the repository browser.