NURAEDCK ;HIRMFO/RM-ROUTINE CALCULATES HIGHEST NURSING DEGREE ;SEPTEMBER 1986
;;4.0;NURSING SERVICE;;Apr 25, 1997
;CALLED FROM [NURS-I-STAFF4] INPUT TEMPLATE
D KILLA,KILLN
Q:'$D(^NURSF(210,DA,6))
Q:($P(^NURSF(210,DA,6,0),"^",4)=0)!($P(^NURSF(210,DA,6,0),"^",4)="")
F NURSNXT=0:0 S NURSNXT=$O(^NURSF(210,DA,6,NURSNXT)) Q:NURSNXT'>0 S NURSNBR=$P(^NURSF(210,DA,6,NURSNXT,0),"^",1),NURSCODE=$P(^NURSF(212.1,NURSNBR,0),"^",3) D FINDHIGH
D SETHIGH,QUIT
Q
KILLA ; KILLS HIGHEST ACADEMIC DEGREE
S $P(^NURSF(210,DA,17),"^",2)=""
Q
KILLN ; KILLS HIGHEST NURSING DEGREE
S:$D(^NURSF(210,DA,17)) $P(^NURSF(210,DA,17),"^",1)=""
Q
FINDHIGH ; FINDS HIGHEST ACADEMIC AND NURSING DEGREES
D FINDACAD
D:(NURSCODE="DIP")!(NURSCODE="AD")!(NURSCODE="BSN")!(NURSCODE="MSN")!(NURSCODE="DNSC") FINDNURS
Q
FINDACAD ;
I '$D(NURSNBRA) S NURSNBRA=NURSNBR Q
S NURSPRI0=$P(^NURSF(212.1,NURSNBRA,0),"^",4),NURSPRI1=$P(^NURSF(212.1,NURSNBR,0),"^",4)
S:NURSPRI1>NURSPRI0 NURSNBRA=NURSNBR
I NURSPRI1=NURSPRI0 S:(NURSCODE="AA")!(NURSCODE="BA")!(NURSCODE="MA")!(NURSCODE="PHD") NURSNBRA=NURSNBR
Q
FINDNURS ;
I '$D(NURSNBRN) S NURSNBRN=NURSNBR Q
S NURSPRI0=$P(^NURSF(212.1,NURSNBRN,0),"^",4),NURSPRI1=$P(^NURSF(212.1,NURSNBR,0),"^",4)
S:NURSPRI1>NURSPRI0 NURSNBRN=NURSNBR
Q
SETHIGH ; SETS THE HIGHEST ACADEMIC AND NURSING DEGREES
S:$D(NURSNBRA) $P(^NURSF(210,DA,17),"^",2)=NURSNBRA
S:$D(NURSNBRN) $P(^NURSF(210,DA,17),"^",1)=NURSNBRN
Q
QUIT ; KILLS LOCAL VARIABLES
K NURSNBR,NURSNBRA,NURSNBRN,NURSPRI0,NURSPRI1,NURSCODE,NURSNXT
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HNURAEDCK 1558 printed Oct 16, 2024@18:20:05 Page 2
NURAEDCK ;HIRMFO/RM-ROUTINE CALCULATES HIGHEST NURSING DEGREE ;SEPTEMBER 1986
+1 ;;4.0;NURSING SERVICE;;Apr 25, 1997
+2 ;CALLED FROM [NURS-I-STAFF4] INPUT TEMPLATE
+3 DO KILLA
DO KILLN
+4 if '$DATA(^NURSF(210,DA,6))
QUIT
+5 if ($PIECE(^NURSF(210,DA,6,0),"^",4)=0)!($PIECE(^NURSF(210,DA,6,0),"^",4)="")
QUIT
+6 FOR NURSNXT=0:0
SET NURSNXT=$ORDER(^NURSF(210,DA,6,NURSNXT))
if NURSNXT'>0
QUIT
SET NURSNBR=$PIECE(^NURSF(210,DA,6,NURSNXT,0),"^",1)
SET NURSCODE=$PIECE(^NURSF(212.1,NURSNBR,0),"^",3)
DO FINDHIGH
+7 DO SETHIGH
DO QUIT
+8 QUIT
KILLA ; KILLS HIGHEST ACADEMIC DEGREE
+1 SET $PIECE(^NURSF(210,DA,17),"^",2)=""
+2 QUIT
KILLN ; KILLS HIGHEST NURSING DEGREE
+1 if $DATA(^NURSF(210,DA,17))
SET $PIECE(^NURSF(210,DA,17),"^",1)=""
+2 QUIT
FINDHIGH ; FINDS HIGHEST ACADEMIC AND NURSING DEGREES
+1 DO FINDACAD
+2 if (NURSCODE="DIP")!(NURSCODE="AD")!(NURSCODE="BSN")!(NURSCODE="MSN")!(NURSCODE="DNSC")
DO FINDNURS
+3 QUIT
FINDACAD ;
+1 IF '$DATA(NURSNBRA)
SET NURSNBRA=NURSNBR
QUIT
+2 SET NURSPRI0=$PIECE(^NURSF(212.1,NURSNBRA,0),"^",4)
SET NURSPRI1=$PIECE(^NURSF(212.1,NURSNBR,0),"^",4)
+3 if NURSPRI1>NURSPRI0
SET NURSNBRA=NURSNBR
+4 IF NURSPRI1=NURSPRI0
if (NURSCODE="AA")!(NURSCODE="BA")!(NURSCODE="MA")!(NURSCODE="PHD")
SET NURSNBRA=NURSNBR
+5 QUIT
FINDNURS ;
+1 IF '$DATA(NURSNBRN)
SET NURSNBRN=NURSNBR
QUIT
+2 SET NURSPRI0=$PIECE(^NURSF(212.1,NURSNBRN,0),"^",4)
SET NURSPRI1=$PIECE(^NURSF(212.1,NURSNBR,0),"^",4)
+3 if NURSPRI1>NURSPRI0
SET NURSNBRN=NURSNBR
+4 QUIT
SETHIGH ; SETS THE HIGHEST ACADEMIC AND NURSING DEGREES
+1 if $DATA(NURSNBRA)
SET $PIECE(^NURSF(210,DA,17),"^",2)=NURSNBRA
+2 if $DATA(NURSNBRN)
SET $PIECE(^NURSF(210,DA,17),"^",1)=NURSNBRN
+3 QUIT
QUIT ; KILLS LOCAL VARIABLES
+1 KILL NURSNBR,NURSNBRA,NURSNBRN,NURSPRI0,NURSPRI1,NURSCODE,NURSNXT
+2 QUIT