Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: FBUCAUD

FBUCAUD.m

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