NURACUIT ;HIRMFO/MD-ROUTINE TO REPAIR FUTURE ACUITY DATA FROM ERRONEOUS BATCH RUN
;;4.0;NURSING SERVICE;;Apr 25, 1997
; This routine should be run in the event the Nursing AMIS Acuity
; Separation/Activation batch job erroneously creates future data
; entries in the NURS AMIS Daily Exception Report (#213.5), NURS AMIS
; 1106 Manhours (#213.4) and NURS Parameters (#213.9) files.
;
D EN1,EN2,EN3
W !,"Done"
KILL ;
K DA,DIK,NURSX,RUNDATE,X,Y
Q
EN1 ; Remove future date entries from the unclassified report (#213.5) file.
; There should be no unclassified report file entries later than T-1.
;
W !,"Removing future date entries from the NURS AMIS Daily Exception Report",!,"(#213.5) file"
S X="T-1" D ^%DT S RUNDATE=Y
I +$G(RUNDATE) S NURSX=0,DIK="^NURSA(213.5," F S NURSX=$O(^NURSA(213.5,"B",NURSX)) Q:NURSX'>0 I NURSX>RUNDATE S DA=0 F S DA=$O(^NURSA(213.5,"B",NURSX,DA)) Q:'DA D ^DIK W "."
G KILL
EN2 ; Remove acuity data from future date entries in manhours file (#213.4).
;
W !,"Removing acuity data from future date entries in the NURS AMIS 1106 Manhours",!,"file (#213.4)"
S NURSX=DT_"A"
I $G(NURSX)'="" F S NURSX=$O(^NURSA(213.4,"B",NURSX)) Q:NURSX="" S DA(1)=0 F S DA(1)=$O(^NURSA(213.4,"B",NURSX,DA(1))) Q:DA(1)'>0 D
.S DA=0 F S DA=$O(^NURSA(213.4,DA(1),1,DA)) Q:DA'>0 D
..S DIK="^NURSA(213.4,DA(1),1,"
..D ^DIK W "."
..Q
.Q
G KILL
EN3 ; Reset Date node in site parameter file to current date if date is
; in the future.
;
W !,"Resetting ^DIC(213.9,1,""DATE"") to today's date if it is a future date."
I +$G(^DIC(213.9,1,"DATE"))>DT S $P(^DIC(213.9,1,"DATE"),"^")=DT
G KILL
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HNURACUIT 1660 printed Nov 22, 2024@17:29:10 Page 2
NURACUIT ;HIRMFO/MD-ROUTINE TO REPAIR FUTURE ACUITY DATA FROM ERRONEOUS BATCH RUN
+1 ;;4.0;NURSING SERVICE;;Apr 25, 1997
+2 ; This routine should be run in the event the Nursing AMIS Acuity
+3 ; Separation/Activation batch job erroneously creates future data
+4 ; entries in the NURS AMIS Daily Exception Report (#213.5), NURS AMIS
+5 ; 1106 Manhours (#213.4) and NURS Parameters (#213.9) files.
+6 ;
+7 DO EN1
DO EN2
DO EN3
+8 WRITE !,"Done"
KILL ;
+1 KILL DA,DIK,NURSX,RUNDATE,X,Y
+2 QUIT
EN1 ; Remove future date entries from the unclassified report (#213.5) file.
+1 ; There should be no unclassified report file entries later than T-1.
+2 ;
+3 WRITE !,"Removing future date entries from the NURS AMIS Daily Exception Report",!,"(#213.5) file"
+4 SET X="T-1"
DO ^%DT
SET RUNDATE=Y
+5 IF +$GET(RUNDATE)
SET NURSX=0
SET DIK="^NURSA(213.5,"
FOR
SET NURSX=$ORDER(^NURSA(213.5,"B",NURSX))
if NURSX'>0
QUIT
IF NURSX>RUNDATE
SET DA=0
FOR
SET DA=$ORDER(^NURSA(213.5,"B",NURSX,DA))
if 'DA
QUIT
DO ^DIK
WRITE "."
+6 GOTO KILL
EN2 ; Remove acuity data from future date entries in manhours file (#213.4).
+1 ;
+2 WRITE !,"Removing acuity data from future date entries in the NURS AMIS 1106 Manhours",!,"file (#213.4)"
+3 SET NURSX=DT_"A"
+4 IF $GET(NURSX)'=""
FOR
SET NURSX=$ORDER(^NURSA(213.4,"B",NURSX))
if NURSX=""
QUIT
SET DA(1)=0
FOR
SET DA(1)=$ORDER(^NURSA(213.4,"B",NURSX,DA(1)))
if DA(1)'>0
QUIT
Begin DoDot:1
+5 SET DA=0
FOR
SET DA=$ORDER(^NURSA(213.4,DA(1),1,DA))
if DA'>0
QUIT
Begin DoDot:2
+6 SET DIK="^NURSA(213.4,DA(1),1,"
+7 DO ^DIK
WRITE "."
+8 QUIT
End DoDot:2
+9 QUIT
End DoDot:1
+10 GOTO KILL
EN3 ; Reset Date node in site parameter file to current date if date is
+1 ; in the future.
+2 ;
+3 WRITE !,"Resetting ^DIC(213.9,1,""DATE"") to today's date if it is a future date."
+4 IF +$GET(^DIC(213.9,1,"DATE"))>DT
SET $PIECE(^DIC(213.9,1,"DATE"),"^")=DT
+5 GOTO KILL