OOPSXV27 ;WIOFO/LLH-POST INIT ROUTINE, FILL FIELD 331 ;11/26/04
;;2.0;ASISTS;**7**;Jun 03, 2002
; Patch 7 - auto populate index "AF" from 1/1/2004 to date
;
ENT ;
N IEN,FILE,FLD4,FLD88
S FILE=2260,IEN=0
D BMES^XPDUTL("Updating new index for OSHA 300 Log for cases created in 2004") H 1
D MES^XPDUTL(" ")
S FLD4=3040100
F S FLD4=$O(^OOPS(FILE,"AD",FLD4)) Q:FLD4'>0 D
.S IEN=0 F S IEN=$O(^OOPS(FILE,"AD",FLD4,IEN)) Q:IEN'>0 D
..S FLD88=$$GET1^DIQ(FILE,IEN,88,"I")
..I $G(FLD88)'="" S ^OOPS(FILE,"AF",FLD4,FLD88,IEN)=""
D BMES^XPDUTL("Update Complete") H 1
D MES^XPDUTL(" ")
;
; now update Type of Incident (FILE 2161.2)
D BMES^XPDUTL("Updating ASISTS CRITICAL TRACKING ISSUES File (#2261.2)") H 1
D MES^XPDUTL(" ")
I $P(^OOPS(2261.2,15,0),U)'="Non Patient Care" D Q
.D BMES^XPDUTL("File not found as expected, update table manually")
.D MES^XPDUTL(" ")
I $P(^OOPS(2261.2,15,0),U)="Non Patient Care" D
.S $P(^OOPS(2261.2,15,0),U)="Lifting (Non Patient Care)"
.K ^OOPS(2261.2,"B","Non Patient Care",15)
.S ^OOPS(2261.2,"B","Lifting (Non Patient Care)",15)=""
.K ^OOPS(2261.2,"D","NON PATIENT CARE",15)
.S ^OOPS(2261.2,"D","LIFTING (NON PATIENT CARE)",15)=""
D BMES^XPDUTL("Table Update Complete"),MES^XPDUTL(" ")
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HOOPSXV27 1277 printed Nov 22, 2024@16:50:14 Page 2
OOPSXV27 ;WIOFO/LLH-POST INIT ROUTINE, FILL FIELD 331 ;11/26/04
+1 ;;2.0;ASISTS;**7**;Jun 03, 2002
+2 ; Patch 7 - auto populate index "AF" from 1/1/2004 to date
+3 ;
ENT ;
+1 NEW IEN,FILE,FLD4,FLD88
+2 SET FILE=2260
SET IEN=0
+3 DO BMES^XPDUTL("Updating new index for OSHA 300 Log for cases created in 2004")
HANG 1
+4 DO MES^XPDUTL(" ")
+5 SET FLD4=3040100
+6 FOR
SET FLD4=$ORDER(^OOPS(FILE,"AD",FLD4))
if FLD4'>0
QUIT
Begin DoDot:1
+7 SET IEN=0
FOR
SET IEN=$ORDER(^OOPS(FILE,"AD",FLD4,IEN))
if IEN'>0
QUIT
Begin DoDot:2
+8 SET FLD88=$$GET1^DIQ(FILE,IEN,88,"I")
+9 IF $GET(FLD88)'=""
SET ^OOPS(FILE,"AF",FLD4,FLD88,IEN)=""
End DoDot:2
End DoDot:1
+10 DO BMES^XPDUTL("Update Complete")
HANG 1
+11 DO MES^XPDUTL(" ")
+12 ;
+13 ; now update Type of Incident (FILE 2161.2)
+14 DO BMES^XPDUTL("Updating ASISTS CRITICAL TRACKING ISSUES File (#2261.2)")
HANG 1
+15 DO MES^XPDUTL(" ")
+16 IF $PIECE(^OOPS(2261.2,15,0),U)'="Non Patient Care"
Begin DoDot:1
+17 DO BMES^XPDUTL("File not found as expected, update table manually")
+18 DO MES^XPDUTL(" ")
End DoDot:1
QUIT
+19 IF $PIECE(^OOPS(2261.2,15,0),U)="Non Patient Care"
Begin DoDot:1
+20 SET $PIECE(^OOPS(2261.2,15,0),U)="Lifting (Non Patient Care)"
+21 KILL ^OOPS(2261.2,"B","Non Patient Care",15)
+22 SET ^OOPS(2261.2,"B","Lifting (Non Patient Care)",15)=""
+23 KILL ^OOPS(2261.2,"D","NON PATIENT CARE",15)
+24 SET ^OOPS(2261.2,"D","LIFTING (NON PATIENT CARE)",15)=""
End DoDot:1
+25 DO BMES^XPDUTL("Table Update Complete")
DO MES^XPDUTL(" ")
+26 QUIT