NURA9K ;HIRMFO/MD,FT-NURSING SERVICE PROFICIENCY REPORT BY LOCATION ; 1/3/03 1:08pm
;;4.0;NURSING SERVICE;**3,13,38**;Apr 25, 1997
Q:'$D(^DIC(213.9,1,"OFF")) Q:$P(^DIC(213.9,1,"OFF"),"^",1)=1
S (NURQUIT,NURQUEUE,NUROUT)=0
D EN1^NURSAUTL G QUIT:$G(NUROUT)
I NURMDSW S DIC(0)="AEQMZ",NURPLSCR=1 D EN5^NURSAGSP G QUIT:$G(NUROUT)
I NURMDSW=0,NURPLSW=1 S NURPLSCR=1 D PRD^NURSAGSP K NURPLSCR I $G(NUROUT) G QUIT
W ! D EN1^NURSAGSP G QUIT:$G(NUROUT)
D EN4^NURSAGP1 W ! G QUIT:$G(NUROUT)
S ZTDESC="Nursing Proficiency Report by Location",ZTRTN="START^NURA9K",NURS132=1,ZTIO=ION D EN7^NURSUT0 G:POP!($D(ZTSK)) QUIT
START ;
K ^TMP($J),^TMP("NURLOC",$J) U IO S (NURQUIT,NURPAGE,NURSW1)=0
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)),+^(0) S DA(1)=+^(0) W:$R(100)&($E(IOST)="C") "." D SORT
D:NURSZAP=7 EN4^NURSAUTL S X=$O(^TMP($J,""))
I $O(^TMP($J,""))="",'$D(NURSNLOC) 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"
I $O(^TMP($J,""))="",$D(NURSNLOC) S NURFAC(2)=$S($G(NURFAC)=0:$G(NURFAC(1)),1:""),NURPROG(2)=$S($G(NURPROG)=0:$G(NURPROG(1)),1:"") D NHDR S NL1="" F S NL1=$O(NURSNLOC(NL1)) Q:NL1="" D NODATA^NURSUT1
I $O(^TMP($J,""))'="",$D(NURSNLOC) D I NURSW1=1 D ENDPG^NURSUT1 S NURSW1=0
. 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)=""
. S NL1="" F S NL1=$O(NURSNLOC(NL1)) Q:NL1="" I '$D(^TMP("NURLOC",$J,NL1)) D
. . S NURFAC(2)=$S($G(NURFAC)=0:$G(NURFAC(1)),1:""),NURPROG(2)=$S($G(NURPROG)=0:$G(NURPROG(1)),1:"") D:NURSW1=0 NHDR S NURSW1=1 D NODATA^NURSUT1
. . Q
. Q
U IO D NPRINT
QUIT ;
K ^TMP($J) D CLOSE^NURSUT1,^NURAKILL
Q
SORT ; POSITION SORT
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
.I $D(^NURSF(211.8,NURNODE4,1,NURNODE5,0)),$P(^(0),U)'>DT&(('$P(^(0),U,6))!($P(^(0),U,6)'<DT)) D SORT1
.Q
Q
SORT1 Q:NURSZAP>7&(NURSZDA'=DA) S NURSZORT=1 D EN3^NURSAUTL:NURSZAP>6,EN2^NURSAUTL:NURSZORT&NURSZAP Q:'NURSZORT
S NURNEN=3 D SETFAC^NURAAGS1,SETPROG^NURAAGS1
I $D(^VA(200,DA(1),0)) S N1=$S($P(^(0),"^",1)'="":$P(^(0),"^",1),1:" BLANK")
I $D(^VA(200,DA(1),1)) S SSN=$S($P(^(1),"^",9)'="":$P(^(1),"^",9),1:" BLANK")
S NLO=$S($D(^NURSF(211.8,NURNODE4,0))&$P(^NURSF(211.8,NURNODE4,0),"^")'="":$P(^(0),"^"),1:" BLANK")
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
D EN2^NURSUT0 S NURSER=$G(NPSPOS(1))
S NPWARD=NLO D EN7^NURSAUTL S NL1=$S(NPWARD'="":$E(NPWARD,1,10),1:" BLANK")
Q:NURSER=""!'(NURSER="R")
I '$D(^NURSF(210,DA,14,0)) Q
S NURPROG("TST")=$G(NURPROG(2))
S NN=0 F II=0:0 S NN=$O(^NURSF(210,DA,14,NN)) Q:NN'>0 D NGO
K NURPROG("TST")
Q
NGO I '$D(^NURSF(210,DA,14,NN,0)) Q
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")
I 'NURHOSP,'$D(NURSNLOC(NL1)) Q
I 'NSP,NDD<NSPC!(NDD>NSPC(2)) Q
I NURMDSW,'$G(NURFAC),$G(NURFAC(1))'=$G(NURFAC(2)) Q
I NURPLSW,'$G(NURPROG),$G(NURPROG(1))'=NURPROG("TST") Q
S:NURPROG(2)="NURSING" NURPROG(2)=" "_NURPROG(2)
S ^TMP($J,NURFAC(2),NURPROG(2),NL1,NDD,N1,SSN,NEV,DA,NN)=""
Q
NPRINT S NURFAC(2)="" F S NURFAC(2)=$O(^TMP($J,NURFAC(2))) Q:NURFAC(2)=""!NURQUIT D NM Q:NURQUIT
Q
NM S NURPROG(2)="" F S NURPROG(2)=$O(^TMP($J,NURFAC(2),NURPROG(2))) Q:NURPROG(2)=""!(NURQUIT) D NN Q:NURQUIT
Q
NN S NL1="" F S NL1=$O(^TMP($J,NURFAC(2),NURPROG(2),NL1)) Q:NL1="" D NHDR Q:NURQUIT D NO Q:NURQUIT
Q
NO F NDD=0:0 S NDD=$O(^TMP($J,NURFAC(2),NURPROG(2),NL1,NDD)) Q:NDD'>0 D NR Q:NURQUIT
Q
NR S N1="" F S N1=$O(^TMP($J,NURFAC(2),NURPROG(2),NL1,NDD,N1)) Q:N1="" D NP Q:NURQUIT
Q
NP S SSN="" F S SSN=$O(^TMP($J,NURFAC(2),NURPROG(2),NL1,NDD,N1,SSN)) Q:SSN="" D NQ Q:NURQUIT
Q
NQ S NEV="" F S NEV=$O(^TMP($J,NURFAC(2),NURPROG(2),NL1,NDD,N1,SSN,NEV)) Q:NEV="" F DA=0:0 S DA=$O(^(NEV,DA)) Q:DA'>0 F D1=0:0 S D1=$O(^(DA,D1)) Q:D1'>0 D NPPRINT Q:NURQUIT
Q
NPPRINT I 'NURSW1!($Y>(IOSL-6)) D NHDR Q:NURQUIT
W !
W:N1'=" BLANK" $E(N1,1,20)
W:$D(SSN) ?25,$E(SSN,1,3),"-",$E(SSN,4,5),"-",$E(SSN,6,9)
W:NL1'=" BLANK" ?40,$E(NL1,1,10)
I NDD'=" BLANK" S Y=NDD D:+Y D^DIQ W:$D(Y) ?51,Y
W:NEV'=" BLANK" ?65,$E(NEV,1,20)
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
Q
NHDR I 'NURQUEUE,NURSW1,$E(IOST)="C" W $C(7),!!,"Press return to continue or ""^"" to exit: " R X:DTIME I '$T!(X="^") S NURQUIT=1 Q
S NURPAGE=NURPAGE+1,NURSW1=1 W:$E(IOST)="C"!(NURPAGE>1) @IOF
I $G(NURMDSW),$L($G(NURFAC(2)))>1 W !,?$$CNTR^NURSUT2(NURFAC(2)),$$FACL^NURSUT2(NURFAC(2))
W !,"NURSING SERVICE PROFICIENCY PROFILE BY LOCATION" S X="T" D ^%DT D:+Y D^DIQ W ?90,Y,?105,"PAGE: ",NURPAGE
W !!,?51,"DATE",?91,"WORK COPY",?105,"COPY RET'D"
W !,"NAME",?25,"SSN",?40,"LOCATION",?51,"DUE",?65,"EVALUATOR",?91,"SENT OUT",?105,"FOR TYPING",!
S X="",$P(X,"-",132)="" W X
I $G(NURPLSW),$L($G(NURPROG(2)))>1 N Z S Z=$$PROD^NURSUT2(NURPROG(2)) W !?$$CNTR^NURSUT2(Z),Z,!?$$CNTR^NURSUT2(Z),$$REPEAT^XLFSTR("-",$L(Z)+1),!
Q
NURA9K ;HIRMFO/MD,FT-NURSING SERVICE PROFICIENCY REPORT BY LOCATION ; 1/3/03 1:08pm
+1 ;;4.0;NURSING SERVICE;**3,13,38**;Apr 25, 1997
+2 IF '$DATA(^DIC(213.9,1,"OFF"))
QUIT
IF $PIECE(^DIC(213.9,1,"OFF"),"^",1)=1
QUIT
+3 SET (NURQUIT,NURQUEUE,NUROUT)=0
+4 DO EN1^NURSAUTL
IF $GET(NUROUT)
GOTO QUIT
+5 IF NURMDSW
SET DIC(0)="AEQMZ"
SET NURPLSCR=1
DO EN5^NURSAGSP
IF $GET(NUROUT)
GOTO QUIT
+6 IF NURMDSW=0
IF NURPLSW=1
SET NURPLSCR=1
DO PRD^NURSAGSP
KILL NURPLSCR
IF $GET(NUROUT)
GOTO QUIT
+7 WRITE !
DO EN1^NURSAGSP
IF $GET(NUROUT)
GOTO QUIT
+8 DO EN4^NURSAGP1
WRITE !
IF $GET(NUROUT)
GOTO QUIT
+9 SET ZTDESC="Nursing Proficiency Report by Location"
SET ZTRTN="START^NURA9K"
SET NURS132=1
SET ZTIO=ION
DO EN7^NURSUT0
IF POP!($DATA(ZTSK))
GOTO QUIT
START ;
+1 KILL ^TMP($JOB),^TMP("NURLOC",$JOB)
USE IO
SET (NURQUIT,NURPAGE,NURSW1)=0
+2 SET X=""
FOR
SET X=$ORDER(^NURSF(210,"AC",X))
IF X=""
QUIT
IF '(X="R")
FOR DA=0:0
SET DA=$ORDER(^NURSF(210,"AC",X,DA))
IF DA'>0
QUIT
IF $DATA(^NURSF(210,DA,0))
IF +^(0)
SET DA(1)=+^(0)
IF $RANDOM(100)&($EXTRACT(IOST)="C")
WRITE "."
DO SORT
+3 IF NURSZAP=7
DO EN4^NURSAUTL
SET X=$ORDER(^TMP($JOB,""))
+4 IF $ORDER(^TMP($JOB,""))=""
IF '$DATA(NURSNLOC)
SET NURFAC(2)=$SELECT($GET(NURFAC)=0:$GET(NURFAC(1)),1:"")
SET NURPROG(2)=$SELECT($GET(NURPROG)=0:$GET(NURPROG(1)),1:"")
DO NHDR
WRITE !!,"THERE IS NO DATA FOR THIS REPORT"
+5 IF $ORDER(^TMP($JOB,""))=""
IF $DATA(NURSNLOC)
SET NURFAC(2)=$SELECT($GET(NURFAC)=0:$GET(NURFAC(1)),1:"")
SET NURPROG(2)=$SELECT($GET(NURPROG)=0:$GET(NURPROG(1)),1:"")
DO NHDR
SET NL1=""
FOR
SET NL1=$ORDER(NURSNLOC(NL1))
IF NL1=""
QUIT
DO NODATA^NURSUT1
+6 IF $ORDER(^TMP($JOB,""))'=""
IF $DATA(NURSNLOC)
Begin DoDot:1
+7 SET (NURY,NURZ,NURX)=""
FOR
SET NURY=$ORDER(^TMP($JOB,NURY))
IF NURY=""
QUIT
FOR
SET NURZ=$ORDER(^TMP($JOB,NURY,NURZ))
IF NURZ=""
QUIT
FOR
SET NURX=$ORDER(^TMP($JOB,NURY,NURZ,NURX))
IF NURX=""
QUIT
SET ^TMP("NURLOC",$JOB,NURX)=""
+8 SET NL1=""
FOR
SET NL1=$ORDER(NURSNLOC(NL1))
IF NL1=""
QUIT
IF '$DATA(^TMP("NURLOC",$JOB,NL1))
Begin DoDot:2
+9 SET NURFAC(2)=$SELECT($GET(NURFAC)=0:$GET(NURFAC(1)),1:"")
SET NURPROG(2)=$SELECT($GET(NURPROG)=0:$GET(NURPROG(1)),1:"")
IF NURSW1=0
DO NHDR
SET NURSW1=1
DO NODATA^NURSUT1
+10 QUIT
End DoDot:2
+11 QUIT
End DoDot:1
IF NURSW1=1
DO ENDPG^NURSUT1
SET NURSW1=0
+12 USE IO
DO NPRINT
QUIT ;
+1 KILL ^TMP($JOB)
DO CLOSE^NURSUT1
DO ^NURAKILL
+2 QUIT
SORT ; POSITION SORT
+1 FOR NURNODE4=0:0
SET NURNODE4=$ORDER(^NURSF(211.8,"C",DA(1),NURNODE4))
IF NURNODE4'>0
QUIT
FOR NURNODE5=0:0
SET NURNODE5=$ORDER(^NURSF(211.8,"C",DA(1),NURNODE4,NURNODE5))
IF NURNODE5'>0
QUIT
Begin DoDot:1
+2 IF $DATA(^NURSF(211.8,NURNODE4,1,NURNODE5,0))
IF $PIECE(^(0),U)'>DT&(('$PIECE(^(0),U,6))!($PIECE(^(0),U,6)'<DT))
DO SORT1
+3 QUIT
End DoDot:1
+4 QUIT
SORT1 IF NURSZAP>7&(NURSZDA'=DA)
QUIT
SET NURSZORT=1
IF NURSZAP>6
DO EN3^NURSAUTL
IF NURSZORT&NURSZAP
DO EN2^NURSAUTL
IF 'NURSZORT
QUIT
+1 SET NURNEN=3
DO SETFAC^NURAAGS1
DO SETPROG^NURAAGS1
+2 IF $DATA(^VA(200,DA(1),0))
SET N1=$SELECT($PIECE(^(0),"^",1)'="":$PIECE(^(0),"^",1),1:" BLANK")
+3 IF $DATA(^VA(200,DA(1),1))
SET SSN=$SELECT($PIECE(^(1),"^",9)'="":$PIECE(^(1),"^",9),1:" BLANK")
+4 SET NLO=$SELECT($DATA(^NURSF(211.8,NURNODE4,0))&$PIECE(^NURSF(211.8,NURNODE4,0),"^")'="":$PIECE(^(0),"^"),1:" BLANK")
+5 IF $DATA(^NURSF(211.4,"B",+NLO))
SET NLO(1)=$ORDER(^NURSF(211.4,"B",+NLO,0))
IF $DATA(^NURSF(211.4,NLO(1),"I"))
IF $EXTRACT($PIECE(^("I"),"^"))="I"
QUIT
+6 DO EN2^NURSUT0
SET NURSER=$GET(NPSPOS(1))
+7 SET NPWARD=NLO
DO EN7^NURSAUTL
SET NL1=$SELECT(NPWARD'="":$EXTRACT(NPWARD,1,10),1:" BLANK")
+8 IF NURSER=""!'(NURSER="R")
QUIT
+9 IF '$DATA(^NURSF(210,DA,14,0))
QUIT
+10 SET NURPROG("TST")=$GET(NURPROG(2))
+11 SET NN=0
FOR II=0:0
SET NN=$ORDER(^NURSF(210,DA,14,NN))
IF NN'>0
QUIT
DO NGO
+12 KILL NURPROG("TST")
+13 QUIT
NGO IF '$DATA(^NURSF(210,DA,14,NN,0))
QUIT
+1 SET NDATA=^NURSF(210,DA,14,NN,0)
SET NDD=$SELECT($PIECE(NDATA,"^")'="":$PIECE(NDATA,"^"),1:" BLANK")
SET NEV=$SELECT($PIECE(NDATA,"^",2)>0:$PIECE(^VA(200,+$PIECE(NDATA,"^",2),0),"^"),1:" BLANK")
+2 IF 'NURHOSP
IF '$DATA(NURSNLOC(NL1))
QUIT
+3 IF 'NSP
IF NDD<NSPC!(NDD>NSPC(2))
QUIT
+4 IF NURMDSW
IF '$GET(NURFAC)
IF $GET(NURFAC(1))'=$GET(NURFAC(2))
QUIT
+5 IF NURPLSW
IF '$GET(NURPROG)
IF $GET(NURPROG(1))'=NURPROG("TST")
QUIT
+6 IF NURPROG(2)="NURSING"
SET NURPROG(2)=" "_NURPROG(2)
+7 SET ^TMP($JOB,NURFAC(2),NURPROG(2),NL1,NDD,N1,SSN,NEV,DA,NN)=""
+8 QUIT
NPRINT SET NURFAC(2)=""
FOR
SET NURFAC(2)=$ORDER(^TMP($JOB,NURFAC(2)))
IF NURFAC(2)=""!NURQUIT
QUIT
DO NM
IF NURQUIT
QUIT
+1 QUIT
NM SET NURPROG(2)=""
FOR
SET NURPROG(2)=$ORDER(^TMP($JOB,NURFAC(2),NURPROG(2)))
IF NURPROG(2)=""!(NURQUIT)
QUIT
DO NN
IF NURQUIT
QUIT
+1 QUIT
NN SET NL1=""
FOR
SET NL1=$ORDER(^TMP($JOB,NURFAC(2),NURPROG(2),NL1))
IF NL1=""
QUIT
DO NHDR
IF NURQUIT
QUIT
DO NO
IF NURQUIT
QUIT
+1 QUIT
NO FOR NDD=0:0
SET NDD=$ORDER(^TMP($JOB,NURFAC(2),NURPROG(2),NL1,NDD))
IF NDD'>0
QUIT
DO NR
IF NURQUIT
QUIT
+1 QUIT
NR SET N1=""
FOR
SET N1=$ORDER(^TMP($JOB,NURFAC(2),NURPROG(2),NL1,NDD,N1))
IF N1=""
QUIT
DO NP
IF NURQUIT
QUIT
+1 QUIT
NP SET SSN=""
FOR
SET SSN=$ORDER(^TMP($JOB,NURFAC(2),NURPROG(2),NL1,NDD,N1,SSN))
IF SSN=""
QUIT
DO NQ
IF NURQUIT
QUIT
+1 QUIT
NQ SET NEV=""
FOR
SET NEV=$ORDER(^TMP($JOB,NURFAC(2),NURPROG(2),NL1,NDD,N1,SSN,NEV))
IF NEV=""
QUIT
FOR DA=0:0
SET DA=$ORDER(^(NEV,DA))
IF DA'>0
QUIT
FOR D1=0:0
SET D1=$ORDER(^(DA,D1))
IF D1'>0
QUIT
DO NPPRINT
IF NURQUIT
QUIT
+1 QUIT
NPPRINT IF 'NURSW1!($Y>(IOSL-6))
DO NHDR
IF NURQUIT
QUIT
+1 WRITE !
+2 IF N1'=" BLANK"
WRITE $EXTRACT(N1,1,20)
+3 IF $DATA(SSN)
WRITE ?25,$EXTRACT(SSN,1,3),"-",$EXTRACT(SSN,4,5),"-",$EXTRACT(SSN,6,9)
+4 IF NL1'=" BLANK"
WRITE ?40,$EXTRACT(NL1,1,10)
+5 IF NDD'=" BLANK"
SET Y=NDD
IF +Y
DO D^DIQ
IF $DATA(Y)
WRITE ?51,Y
+6 IF NEV'=" BLANK"
WRITE ?65,$EXTRACT(NEV,1,20)
+7 SET DATA=$GET(^NURSF(210,DA,14,D1,0))
FOR I=4,5
IF +$PIECE(DATA,U,I)
SET Y=$PIECE(DATA,U,I)
DO D^DIQ
SET ZZ=$SELECT(I=4:91,1:105)
WRITE ?ZZ,Y
+8 QUIT
NHDR IF 'NURQUEUE
IF NURSW1
IF $EXTRACT(IOST)="C"
WRITE $CHAR(7),!!,"Press return to continue or ""^"" to exit: "
READ X:DTIME
IF '$TEST!(X="^")
SET NURQUIT=1
QUIT
+1 SET NURPAGE=NURPAGE+1
SET NURSW1=1
IF $EXTRACT(IOST)="C"!(NURPAGE>1)
WRITE @IOF
+2 IF $GET(NURMDSW)
IF $LENGTH($GET(NURFAC(2)))>1
WRITE !,?$$CNTR^NURSUT2(NURFAC(2)),$$FACL^NURSUT2(NURFAC(2))
+3 WRITE !,"NURSING SERVICE PROFICIENCY PROFILE BY LOCATION"
SET X="T"
DO ^%DT
IF +Y
DO D^DIQ
WRITE ?90,Y,?105,"PAGE: ",NURPAGE
+4 WRITE !!,?51,"DATE",?91,"WORK COPY",?105,"COPY RET'D"
+5 WRITE !,"NAME",?25,"SSN",?40,"LOCATION",?51,"DUE",?65,"EVALUATOR",?91,"SENT OUT",?105,"FOR TYPING",!
+6 SET X=""
SET $PIECE(X,"-",132)=""
WRITE X
+7 IF $GET(NURPLSW)
IF $LENGTH($GET(NURPROG(2)))>1
NEW Z
SET Z=$$PROD^NURSUT2(NURPROG(2))
WRITE !?$$CNTR^NURSUT2(Z),Z,!?$$CNTR^NURSUT2(Z),$$REPEAT^XLFSTR("-",$LENGTH(Z)+1),!
+8 QUIT