NURSCEP1 ;HIRMFO/JH/MH-LIST STAFF (#210) FILE DISCREPANCIES - CONT. ;7/15/97
;;4.0;NURSING SERVICE;**6**;Apr 25, 1997
S (NURSDA,NURTYPE)=0
F S NURSDA=$O(^TMP("NURS",$J,"L",NURSDA)) Q:NURSDA'>0!(NUROUT) S NAME="" F S NAME=$O(^TMP("NURS",$J,"L",NURSDA,NAME)) Q:NAME="" S NUM=^(NAME) D:'NSW1!($Y>(IOSL-6)) HDR Q:$G(NUROUT) W !,NURSDA,?10,NAME D WRT Q:$G(NUROUT) W !
I $E(IOST)="C",$D(^TMP("NURS",$J)) D ENDPG^NURSUT1 Q:$G(NUROUT)
S (NSW1,NAM)=0,NURTYPE=1
F S NAM=$O(^TMP("NURP",$J,NAM)) Q:NAM'>0!(NUROUT) S NOD=0 F S NOD=$O(^TMP("NURP",$J,NAM,NOD)) Q:NOD'>0 S NDA=0 F S NDA=$O(^TMP("NURP",$J,NAM,NOD,NDA)) Q:NDA'>0 S NURX=^TMP("NURP",$J,NAM,NOD,NDA) D PRINT Q:$G(NUROUT)
I $E(IOST)="C",$D(^TMP("NURP",$J)) D ENDPG^NURSUT1 Q:$G(NUROUT)
S (NSW1,NAM)=0,NURTYPE=2
F S NAM=$O(^TMP("NOSTAFF",$J,NAM)) Q:NAM'>0!(NUROUT) S NOD=0 F S NOD=$O(^TMP("NOSTAFF",$J,NAM,NOD)) Q:NOD'>0 S NDA=0 F S NDA=$O(^TMP("NOSTAFF",$J,NAM,NOD,NDA)) Q:NDA'>0 S NURX=^(NDA) D PRINT Q:$G(NUROUT)
I $E(IOST)="C",$D(^TMP("NOSTAFF",$J)) D ENDPG^NURSUT1 Q:$G(NUROUT)
S (NSW1,NAM)=0,NURTYPE=3
F S NAM=$O(^TMP("INACT",$J,NAM)) Q:NAM'>0!(NUROUT) S NOD=0 F S NOD=$O(^TMP("INACT",$J,NAM,NOD)) Q:NOD'>0 S NDA=0 F S NDA=$O(^TMP("INACT",$J,NAM,NOD,NDA)) Q:NDA'>0 S NURX=^(NDA) D PRINT Q:$G(NUROUT)
Q
WRT ;
I $Y>(IOSL-6) D HDR Q:$G(NUROUT)
S SW=0 F S SW=$O(^TMP("NURS",$J,"L1",NUM,SW)) Q:SW'>0 D
. I SW=1 W !?6,"STAFF RECORD HAS NO CORRESPONDING NEW PERSON (#200) FILE ENTRY."
. I SW=2 W !?6,"STAFF RECORD CONTAINS MISSING/INVALID DATA IN NAME FIELD."
. I SW=3 W !?6,"STAFF RECORD CONTAINS MISSING/INVALID STATUS DATA."
. I SW=4 W !?6,"STAFF RECORD MISSING THE `B' INDEX ENTRY."
. I SW=5 W !?6,"STAFF RECORD HAS ACTIVE STATUS AND NO CURRENT FILE 211.8 ASSIGNMENT(S)."
. I SW=6 W !?6,"STAFF RECORD HAS `B' INDEX ENTRY AND NO DATA ON ZEROTH NODE."
. Q
Q
PRINT ; WRITE POSITION CONTROL REPORT DETAIL LINE
I 'NSW1!($Y>(IOSL-6)) D HDR Q:$G(NUROUT)
W:'(NURTYPE=3) !,NOD_",1,"_NDA_",0)" W:$G(NURTYPE)=3 !,$P($G(^VA(200,+NAM,0)),U) W:'(NURTYPE=3) ?15,$P($G(^VA(200,+NAM,0)),U) W ?40,$P(NURX,U),?53,$E($P(NURX,U,2),1,10),?65,$P(NURX,U,3),?72,$P(NURX,U,4)
Q
STAT(NOD) ; DETERMINE IF THE NURSING LOCATION IS ACTIVE BASED ON A NURS
; POSITION CONTROL FILE POINTER (NOD)
N NURSTAT
S NURSTAT=0,NPWARD=+$G(^NURSF(211.8,NOD,0)) D EN7^NURSAUTL Q:$G(NPWARD)=""
S NURLOC="NUR "_NPWARD,SCDA=$O(^SC("B",NURLOC,0)),NURDA=$O(^NURSF(211.4,"B",+SCDA,0))
I $G(^NURSF(211.4,+NURDA,"I"))="I" S NURSTAT=1
Q NURSTAT
HDR I NSW1,'NURQUEUE,'$G(NUROUT),$E(IOST)="C" D ENDPG^NURSUT1 I $G(NUROUT) Q
S NURPAGE=(NURPAGE+1) W:$E(IOST)="C"!(NURPAGE>1) @IOF
W "NURS POSITION CONTROL/NURS STAFF File Integrity Report " S X="T" D ^%DT D:+Y D^DIQ W ?57,Y,?71," PAGE: ",NURPAGE
I NURTYPE=0 W !,"RECORD#",?12,"NAME",!,?6,"DISCREPANCY"
I NURTYPE=1!(NURTYPE=2)!(NURTYPE=3) W:NURTYPE=1!(NURTYPE=2) !,"GLOBAL REF." W:NURTYPE=3 !,"NAME" W:'(NURTYPE=3) ?15,"NAME" W ?40,"POSITION",?53,"UNIT",?64,"FTEE",?70,"START DATE"
W !,$$REPEAT^XLFSTR("-",80)
I NURTYPE=1 W !!,"The following assignments are duplicates in the NURS Position Control (211.8)",!,"File. To deactivate a specific assignment use the global root ^NURSF(211.8,",!,"and the global reference indicated for that assignment:",!!
I NURTYPE=2 W !!,"The following assignments have no corresponding Nurs Staff (#210) File entry.",!,"To remove the assignment use the global root ^NURSF(211.8, and the global",!,"reference indicated for that assignment:",!!
I NURTYPE=3 W !!,"The following active employees are assigned to inactive nursing locations.",!,"To deactivate or edit a specific assignment use the Status and Position Option",!,"[NURAED-STF-STAT/POS] of the Staff Record Edit",!!
S NSW1=1
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HNURSCEP1 3776 printed Dec 13, 2024@02:21:44 Page 2
NURSCEP1 ;HIRMFO/JH/MH-LIST STAFF (#210) FILE DISCREPANCIES - CONT. ;7/15/97
+1 ;;4.0;NURSING SERVICE;**6**;Apr 25, 1997
+2 SET (NURSDA,NURTYPE)=0
+3 FOR
SET NURSDA=$ORDER(^TMP("NURS",$JOB,"L",NURSDA))
if NURSDA'>0!(NUROUT)
QUIT
SET NAME=""
FOR
SET NAME=$ORDER(^TMP("NURS",$JOB,"L",NURSDA,NAME))
if NAME=""
QUIT
SET NUM=^(NAME)
if 'NSW1!($Y>(IOSL-6))
DO HDR
if $GET(NUROUT)
QUIT
WRITE !,NURSDA,?10,NAME
DO WRT
if $GET(NUROUT)
QUIT
WRITE !
+4 IF $EXTRACT(IOST)="C"
IF $DATA(^TMP("NURS",$JOB))
DO ENDPG^NURSUT1
if $GET(NUROUT)
QUIT
+5 SET (NSW1,NAM)=0
SET NURTYPE=1
+6 FOR
SET NAM=$ORDER(^TMP("NURP",$JOB,NAM))
if NAM'>0!(NUROUT)
QUIT
SET NOD=0
FOR
SET NOD=$ORDER(^TMP("NURP",$JOB,NAM,NOD))
if NOD'>0
QUIT
SET NDA=0
FOR
SET NDA=$ORDER(^TMP("NURP",$JOB,NAM,NOD,NDA))
if NDA'>0
QUIT
SET NURX=^TMP("NURP",$JOB,NAM,NOD,NDA)
DO PRINT
if $GET(NUROUT)
QUIT
+7 IF $EXTRACT(IOST)="C"
IF $DATA(^TMP("NURP",$JOB))
DO ENDPG^NURSUT1
if $GET(NUROUT)
QUIT
+8 SET (NSW1,NAM)=0
SET NURTYPE=2
+9 FOR
SET NAM=$ORDER(^TMP("NOSTAFF",$JOB,NAM))
if NAM'>0!(NUROUT)
QUIT
SET NOD=0
FOR
SET NOD=$ORDER(^TMP("NOSTAFF",$JOB,NAM,NOD))
if NOD'>0
QUIT
SET NDA=0
FOR
SET NDA=$ORDER(^TMP("NOSTAFF",$JOB,NAM,NOD,NDA))
if NDA'>0
QUIT
SET NURX=^(NDA)
DO PRINT
if $GET(NUROUT)
QUIT
+10 IF $EXTRACT(IOST)="C"
IF $DATA(^TMP("NOSTAFF",$JOB))
DO ENDPG^NURSUT1
if $GET(NUROUT)
QUIT
+11 SET (NSW1,NAM)=0
SET NURTYPE=3
+12 FOR
SET NAM=$ORDER(^TMP("INACT",$JOB,NAM))
if NAM'>0!(NUROUT)
QUIT
SET NOD=0
FOR
SET NOD=$ORDER(^TMP("INACT",$JOB,NAM,NOD))
if NOD'>0
QUIT
SET NDA=0
FOR
SET NDA=$ORDER(^TMP("INACT",$JOB,NAM,NOD,NDA))
if NDA'>0
QUIT
SET NURX=^(NDA)
DO PRINT
if $GET(NUROUT)
QUIT
+13 QUIT
WRT ;
+1 IF $Y>(IOSL-6)
DO HDR
if $GET(NUROUT)
QUIT
+2 SET SW=0
FOR
SET SW=$ORDER(^TMP("NURS",$JOB,"L1",NUM,SW))
if SW'>0
QUIT
Begin DoDot:1
+3 IF SW=1
WRITE !?6,"STAFF RECORD HAS NO CORRESPONDING NEW PERSON (#200) FILE ENTRY."
+4 IF SW=2
WRITE !?6,"STAFF RECORD CONTAINS MISSING/INVALID DATA IN NAME FIELD."
+5 IF SW=3
WRITE !?6,"STAFF RECORD CONTAINS MISSING/INVALID STATUS DATA."
+6 IF SW=4
WRITE !?6,"STAFF RECORD MISSING THE `B' INDEX ENTRY."
+7 IF SW=5
WRITE !?6,"STAFF RECORD HAS ACTIVE STATUS AND NO CURRENT FILE 211.8 ASSIGNMENT(S)."
+8 IF SW=6
WRITE !?6,"STAFF RECORD HAS `B' INDEX ENTRY AND NO DATA ON ZEROTH NODE."
+9 QUIT
End DoDot:1
+10 QUIT
PRINT ; WRITE POSITION CONTROL REPORT DETAIL LINE
+1 IF 'NSW1!($Y>(IOSL-6))
DO HDR
if $GET(NUROUT)
QUIT
+2 if '(NURTYPE=3)
WRITE !,NOD_",1,"_NDA_",0)"
if $GET(NURTYPE)=3
WRITE !,$PIECE($GET(^VA(200,+NAM,0)),U)
if '(NURTYPE=3)
WRITE ?15,$PIECE($GET(^VA(200,+NAM,0)),U)
WRITE ?40,$PIECE(NURX,U),?53,$EXTRACT($PIECE(NURX,U,2),1,10),?65,$PIECE(NURX,U,3),?72,$PIECE(NURX,U,4)
+3 QUIT
STAT(NOD) ; DETERMINE IF THE NURSING LOCATION IS ACTIVE BASED ON A NURS
+1 ; POSITION CONTROL FILE POINTER (NOD)
+2 NEW NURSTAT
+3 SET NURSTAT=0
SET NPWARD=+$GET(^NURSF(211.8,NOD,0))
DO EN7^NURSAUTL
if $GET(NPWARD)=""
QUIT
+4 SET NURLOC="NUR "_NPWARD
SET SCDA=$ORDER(^SC("B",NURLOC,0))
SET NURDA=$ORDER(^NURSF(211.4,"B",+SCDA,0))
+5 IF $GET(^NURSF(211.4,+NURDA,"I"))="I"
SET NURSTAT=1
+6 QUIT NURSTAT
HDR IF NSW1
IF 'NURQUEUE
IF '$GET(NUROUT)
IF $EXTRACT(IOST)="C"
DO ENDPG^NURSUT1
IF $GET(NUROUT)
QUIT
+1 SET NURPAGE=(NURPAGE+1)
if $EXTRACT(IOST)="C"!(NURPAGE>1)
WRITE @IOF
+2 WRITE "NURS POSITION CONTROL/NURS STAFF File Integrity Report "
SET X="T"
DO ^%DT
if +Y
DO D^DIQ
WRITE ?57,Y,?71," PAGE: ",NURPAGE
+3 IF NURTYPE=0
WRITE !,"RECORD#",?12,"NAME",!,?6,"DISCREPANCY"
+4 IF NURTYPE=1!(NURTYPE=2)!(NURTYPE=3)
if NURTYPE=1!(NURTYPE=2)
WRITE !,"GLOBAL REF."
if NURTYPE=3
WRITE !,"NAME"
if '(NURTYPE=3)
WRITE ?15,"NAME"
WRITE ?40,"POSITION",?53,"UNIT",?64,"FTEE",?70,"START DATE"
+5 WRITE !,$$REPEAT^XLFSTR("-",80)
+6 IF NURTYPE=1
WRITE !!,"The following assignments are duplicates in the NURS Position Control (211.8)",!,"File. To deactivate a specific assignment use the global root ^NURSF(211.8,",!,"and the global reference indicated for that assignment:",!!
+7 IF NURTYPE=2
WRITE !!,"The following assignments have no corresponding Nurs Staff (#210) File entry.",!,"To remove the assignment use the global root ^NURSF(211.8, and the global",!,"reference indicated for that assignment:",!!
+8 IF NURTYPE=3
WRITE !!,"The following active employees are assigned to inactive nursing locations.",!,"To deactivate or edit a specific assignment use the Status and Position Option",!,"[NURAED-STF-STAT/POS] of the Staff Record Edit",!!
+9 SET NSW1=1
+10 QUIT