FBUCAUD ;WCIOFO/SAB - FEE BASIS 162.7 DATA AUDIT ;5/19/2014
;;3.5;FEE BASIS;**151**;JAN 30, 1995;Build 14
;;Per VA Directive 6402, this routine should not be modified.
Q
;
AUD(FBSET) ; audit of selected fields in file 162.7
;called by set and kill logic of AUD mumps x-ref on file 162.7
; input
; FBSET = 0 or 1, =true if set logic and =false if kill logic
; also variables from FileMan x-ref
; DA = IEN of record in file 162.7
; X1(#) = old values of cross-referenced fields
; X2(#) = new values of cross-referenced fields
N FBDT,FBI,FBFDA,FBFIELDL
; list of cross-referenced fields in order number
S FBFIELDL="24^10^.01^19.6^7^11^21^50^51^52^53^54^55"
S FBDT=$$NOW^XLFDT()
;
; if kill logic and new value of .01 field null then record was deleted
; and no need to proceed since audit multiple is stored in record
I 'FBSET,X2(3)="" Q
;
; if old and new field values are different then save change in audit
; loop thru audited fields
F FBI=1:1:13 D
. ; if kill logic and value was deleted then save audit
. I 'FBSET,X1(FBI)'=X2(FBI),X2(FBI)="" D SAVE
. ; if set logic and value was entered or changed then save audit
. I FBSET,X1(FBI)'=X2(FBI),X2(FBI)'="" D SAVE
Q
;
SAVE ;
N FBFDA,FBIENS
S FBIENS="+1,"_DA_","
S FBFDA(162.793,FBIENS,.01)=FBDT ; CHANGED DATE/TIME
S FBFDA(162.793,FBIENS,1)=$P(FBFIELDL,"^",FBI) ; FIELD
S FBFDA(162.793,FBIENS,2)=X1(FBI) ; OLD VALUE
S FBFDA(162.793,FBIENS,3)=X2(FBI) ; NEW VALUE
S FBFDA(162.793,FBIENS,4)=DUZ ; CHANGED BY
D UPDATE^DIE("","FBFDA")
Q
;
OUTX ; output transform
; called by OLD VALUE and NEW VALUE fields in the DATA AUDIT multiple
; of the FEE BASIS UNAUTHORIZED CLAIMS (#162.7) file.
; input
; Y = value to transform
; D0 = required internal entry number, top level
; D1 = optional internal entry number, one level below
; DIC = optional file/sub-file root
; output
; Y = external value for Y when available, else the input value
;
Q:'$G(D0) ; must have at least one IEN
Q:$G(Y)="" ; must have internal value to transform
;
N FBFLD,FBNODE,FBY
;
; determine 0-node of entry in DATA AUDIT
S FBNODE=""
I $G(D1) S FBNODE="^FB583("_D0_",""LOG2"","_D1_",0)"
I '$G(D1),$E($G(DIC))="^" S FBNODE=DIC_D0_",0)"
Q:FBNODE=""
;
; obtain value of FIELD
S FBFLD=$P($G(@FBNODE),"^",2)
Q:FBFLD=""
;
; obtain external value of Y for the field
S FBY=$$EXTERNAL^DILFD(162.7,FBFLD,"",Y)
S:FBY]"" Y=FBY ; return external value in Y
Q
;
LTRDT(FBSET) ; trigger on DATE LETTER SENT field in file 162.7
; called by set and kill logic on AILT cross-reference
; populates DATE REQ INFO SENT field when status order is 10
; input
; FBSET = 0 or 1, =true if set logic and =false if kill logic
; also variables from FileMan x-ref
; DA = IEN of record in file 162.7
; X1(1) = old values of cross-referenced field
; X2(1) = new values of cross-referenced field
;
N FBFDA,FBVAL
; quit if status order not 10 (i.e. not incomplete unauthorized claim)
Q:$$ORDER^FBUCUTL($P($G(^FB583(DA,0)),"^",24))'=10
;
S FBVAL=""
; if kill logic and value was deleted then delete value
I 'FBSET,X1(1)'=X2(1),X2(1)="" S FBVAL="@"
; if set logic and value was entered or changed then copy date
I FBSET,X1(1)'=X2(1),X2(1)'="" S FBVAL=X2(1)
;
I FBVAL]"" D
. S FBFDA(162.7,DA_",",19.6)=FBVAL ; DATE REQ INFO SENT
. D FILE^DIE("","FBFDA")
;
Q
;FBUCAUD
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HFBUCAUD 3486 printed Dec 13, 2024@02:00:02 Page 2
FBUCAUD ;WCIOFO/SAB - FEE BASIS 162.7 DATA AUDIT ;5/19/2014
+1 ;;3.5;FEE BASIS;**151**;JAN 30, 1995;Build 14
+2 ;;Per VA Directive 6402, this routine should not be modified.
+3 QUIT
+4 ;
AUD(FBSET) ; audit of selected fields in file 162.7
+1 ;called by set and kill logic of AUD mumps x-ref on file 162.7
+2 ; input
+3 ; FBSET = 0 or 1, =true if set logic and =false if kill logic
+4 ; also variables from FileMan x-ref
+5 ; DA = IEN of record in file 162.7
+6 ; X1(#) = old values of cross-referenced fields
+7 ; X2(#) = new values of cross-referenced fields
+8 NEW FBDT,FBI,FBFDA,FBFIELDL
+9 ; list of cross-referenced fields in order number
+10 SET FBFIELDL="24^10^.01^19.6^7^11^21^50^51^52^53^54^55"
+11 SET FBDT=$$NOW^XLFDT()
+12 ;
+13 ; if kill logic and new value of .01 field null then record was deleted
+14 ; and no need to proceed since audit multiple is stored in record
+15 IF 'FBSET
IF X2(3)=""
QUIT
+16 ;
+17 ; if old and new field values are different then save change in audit
+18 ; loop thru audited fields
+19 FOR FBI=1:1:13
Begin DoDot:1
+20 ; if kill logic and value was deleted then save audit
+21 IF 'FBSET
IF X1(FBI)'=X2(FBI)
IF X2(FBI)=""
DO SAVE
+22 ; if set logic and value was entered or changed then save audit
+23 IF FBSET
IF X1(FBI)'=X2(FBI)
IF X2(FBI)'=""
DO SAVE
End DoDot:1
+24 QUIT
+25 ;
SAVE ;
+1 NEW FBFDA,FBIENS
+2 SET FBIENS="+1,"_DA_","
+3 ; CHANGED DATE/TIME
SET FBFDA(162.793,FBIENS,.01)=FBDT
+4 ; FIELD
SET FBFDA(162.793,FBIENS,1)=$PIECE(FBFIELDL,"^",FBI)
+5 ; OLD VALUE
SET FBFDA(162.793,FBIENS,2)=X1(FBI)
+6 ; NEW VALUE
SET FBFDA(162.793,FBIENS,3)=X2(FBI)
+7 ; CHANGED BY
SET FBFDA(162.793,FBIENS,4)=DUZ
+8 DO UPDATE^DIE("","FBFDA")
+9 QUIT
+10 ;
OUTX ; output transform
+1 ; called by OLD VALUE and NEW VALUE fields in the DATA AUDIT multiple
+2 ; of the FEE BASIS UNAUTHORIZED CLAIMS (#162.7) file.
+3 ; input
+4 ; Y = value to transform
+5 ; D0 = required internal entry number, top level
+6 ; D1 = optional internal entry number, one level below
+7 ; DIC = optional file/sub-file root
+8 ; output
+9 ; Y = external value for Y when available, else the input value
+10 ;
+11 ; must have at least one IEN
if '$GET(D0)
QUIT
+12 ; must have internal value to transform
if $GET(Y)=""
QUIT
+13 ;
+14 NEW FBFLD,FBNODE,FBY
+15 ;
+16 ; determine 0-node of entry in DATA AUDIT
+17 SET FBNODE=""
+18 IF $GET(D1)
SET FBNODE="^FB583("_D0_",""LOG2"","_D1_",0)"
+19 IF '$GET(D1)
IF $EXTRACT($GET(DIC))="^"
SET FBNODE=DIC_D0_",0)"
+20 if FBNODE=""
QUIT
+21 ;
+22 ; obtain value of FIELD
+23 SET FBFLD=$PIECE($GET(@FBNODE),"^",2)
+24 if FBFLD=""
QUIT
+25 ;
+26 ; obtain external value of Y for the field
+27 SET FBY=$$EXTERNAL^DILFD(162.7,FBFLD,"",Y)
+28 ; return external value in Y
if FBY]""
SET Y=FBY
+29 QUIT
+30 ;
LTRDT(FBSET) ; trigger on DATE LETTER SENT field in file 162.7
+1 ; called by set and kill logic on AILT cross-reference
+2 ; populates DATE REQ INFO SENT field when status order is 10
+3 ; input
+4 ; FBSET = 0 or 1, =true if set logic and =false if kill logic
+5 ; also variables from FileMan x-ref
+6 ; DA = IEN of record in file 162.7
+7 ; X1(1) = old values of cross-referenced field
+8 ; X2(1) = new values of cross-referenced field
+9 ;
+10 NEW FBFDA,FBVAL
+11 ; quit if status order not 10 (i.e. not incomplete unauthorized claim)
+12 if $$ORDER^FBUCUTL($PIECE($GET(^FB583(DA,0)),"^",24))'=10
QUIT
+13 ;
+14 SET FBVAL=""
+15 ; if kill logic and value was deleted then delete value
+16 IF 'FBSET
IF X1(1)'=X2(1)
IF X2(1)=""
SET FBVAL="@"
+17 ; if set logic and value was entered or changed then copy date
+18 IF FBSET
IF X1(1)'=X2(1)
IF X2(1)'=""
SET FBVAL=X2(1)
+19 ;
+20 IF FBVAL]""
Begin DoDot:1
+21 ; DATE REQ INFO SENT
SET FBFDA(162.7,DA_",",19.6)=FBVAL
+22 DO FILE^DIE("","FBFDA")
End DoDot:1
+23 ;
+24 QUIT
+25 ;FBUCAUD