FBUTL9 ;WIOFO/SAB - FEE BASIS UTILITY FOR USER AUDIT ;6/18/2014
;;3.5;FEE BASIS;**154**;JAN 30, 1995;Build 12
;;Per VA Directive 6402, this routine should not be modified.
Q
ADDUA(FBFILE,FBIENS,FBTXT) ; Add record to User Audit multiple
; input
; FBFILE - file being edited
; FBIENS - internal entry number of record being edited in file
; FBTXT - (optional) text describing nature of edit, max 60 char
; returns 1 if record added, 0 if record not added
;
N FBAFILE,FBAIENS,FBRET
S FBRET=0
;
S FBFILE=$G(FBFILE)
I FBFILE=161.01 S FBAFILE=161.192
I FBFILE=162.2 S FBAFILE=162.292
I FBFILE=162.4 S FBAFILE=162.492
I FBFILE=162.7 S FBAFILE=162.792
;
I $G(FBIENS)]"" S FBAIENS="+1,"_FBIENS
;
I $G(FBAFILE)]"",$G(FBAIENS)]"" D
. N FBFDA,DIERR
. S FBFDA(FBAFILE,FBAIENS,.01)=$$NOW^XLFDT ; DATE/TIME EDITED
. S FBFDA(FBAFILE,FBAIENS,1)=DUZ ; EDITED BY
. S:$G(FBTXT)]"" FBFDA(FBAFILE,FBAIENS,2)=$E(FBTXT,1,60) ; COMMENTS
. D UPDATE^DIE("","FBFDA")
. I $G(DIERR)="" S FBRET=1
Q FBRET
;
UOKPAY(FBDFN,FBAUTHP,FBUSR) ; User OK to Pay
; inputs
; FBDFN = Patient IEN (file 161 and file 2)
; FBAUTHP = Authorization IEN (sub-file 161.01)
; FBUSR = (Optional) User IEN (file 200), defaults to DUZ
; return
; = 1 if OK for user to enter payment associated with authorization
; = 0^message if not OK for user to enter payment
;
N FBRET
S FBRET=1
I $G(FBUSR)="" S FBUSR=$G(DUZ)
;
I $G(FBDFN),$G(FBAUTHP) D
. N FB583,FB7078,FBX
. ; check file 161
. I $O(^FBAAA(FBDFN,1,FBAUTHP,"LOG1","AU",FBUSR,0)) S FBRET="0^authorization edited" Q
. ;
. S FBX=$P($G(^FBAAA(FBDFN,1,FBAUTHP,0)),"^",9) ; ASSOCIATED 7078/583
. I FBX[";FB7078(" S FB7078=+FBX
. I FBX[";FB583(" S FB583=+FBX
. ;
. I $G(FB7078) D Q:FBRET'>0
. . N FBNR
. . ; check file 162.4 when 7078
. . I $O(^FB7078(FB7078,"LOG1","AU",FBUSR,0)) S FBRET="0^7078 edited" Q
. . ; check file 162.2 if notification/request exists for 7078
. . S FBNR=$O(^FBAA(162.2,"AM",FB7078,0))
. . I FBNR,$O(^FBAA(162.2,FBNR,"LOG1","AU",FBUSR,0)) S FBRET="0^CH notification/request edited"
. ;
. ; check file 162.7 when unauthorized claim
. I $G(FB583),$O(^FB583(FB583,"LOG1","AU",FBUSR,0)) S FBRET="0^unauthorized claim edited" Q
;
Q FBRET
;
;FBUTL9
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HFBUTL9 2316 printed Oct 16, 2024@18:01:40 Page 2
FBUTL9 ;WIOFO/SAB - FEE BASIS UTILITY FOR USER AUDIT ;6/18/2014
+1 ;;3.5;FEE BASIS;**154**;JAN 30, 1995;Build 12
+2 ;;Per VA Directive 6402, this routine should not be modified.
+3 QUIT
ADDUA(FBFILE,FBIENS,FBTXT) ; Add record to User Audit multiple
+1 ; input
+2 ; FBFILE - file being edited
+3 ; FBIENS - internal entry number of record being edited in file
+4 ; FBTXT - (optional) text describing nature of edit, max 60 char
+5 ; returns 1 if record added, 0 if record not added
+6 ;
+7 NEW FBAFILE,FBAIENS,FBRET
+8 SET FBRET=0
+9 ;
+10 SET FBFILE=$GET(FBFILE)
+11 IF FBFILE=161.01
SET FBAFILE=161.192
+12 IF FBFILE=162.2
SET FBAFILE=162.292
+13 IF FBFILE=162.4
SET FBAFILE=162.492
+14 IF FBFILE=162.7
SET FBAFILE=162.792
+15 ;
+16 IF $GET(FBIENS)]""
SET FBAIENS="+1,"_FBIENS
+17 ;
+18 IF $GET(FBAFILE)]""
IF $GET(FBAIENS)]""
Begin DoDot:1
+19 NEW FBFDA,DIERR
+20 ; DATE/TIME EDITED
SET FBFDA(FBAFILE,FBAIENS,.01)=$$NOW^XLFDT
+21 ; EDITED BY
SET FBFDA(FBAFILE,FBAIENS,1)=DUZ
+22 ; COMMENTS
if $GET(FBTXT)]""
SET FBFDA(FBAFILE,FBAIENS,2)=$EXTRACT(FBTXT,1,60)
+23 DO UPDATE^DIE("","FBFDA")
+24 IF $GET(DIERR)=""
SET FBRET=1
End DoDot:1
+25 QUIT FBRET
+26 ;
UOKPAY(FBDFN,FBAUTHP,FBUSR) ; User OK to Pay
+1 ; inputs
+2 ; FBDFN = Patient IEN (file 161 and file 2)
+3 ; FBAUTHP = Authorization IEN (sub-file 161.01)
+4 ; FBUSR = (Optional) User IEN (file 200), defaults to DUZ
+5 ; return
+6 ; = 1 if OK for user to enter payment associated with authorization
+7 ; = 0^message if not OK for user to enter payment
+8 ;
+9 NEW FBRET
+10 SET FBRET=1
+11 IF $GET(FBUSR)=""
SET FBUSR=$GET(DUZ)
+12 ;
+13 IF $GET(FBDFN)
IF $GET(FBAUTHP)
Begin DoDot:1
+14 NEW FB583,FB7078,FBX
+15 ; check file 161
+16 IF $ORDER(^FBAAA(FBDFN,1,FBAUTHP,"LOG1","AU",FBUSR,0))
SET FBRET="0^authorization edited"
QUIT
+17 ;
+18 ; ASSOCIATED 7078/583
SET FBX=$PIECE($GET(^FBAAA(FBDFN,1,FBAUTHP,0)),"^",9)
+19 IF FBX[";FB7078("
SET FB7078=+FBX
+20 IF FBX[";FB583("
SET FB583=+FBX
+21 ;
+22 IF $GET(FB7078)
Begin DoDot:2
+23 NEW FBNR
+24 ; check file 162.4 when 7078
+25 IF $ORDER(^FB7078(FB7078,"LOG1","AU",FBUSR,0))
SET FBRET="0^7078 edited"
QUIT
+26 ; check file 162.2 if notification/request exists for 7078
+27 SET FBNR=$ORDER(^FBAA(162.2,"AM",FB7078,0))
+28 IF FBNR
IF $ORDER(^FBAA(162.2,FBNR,"LOG1","AU",FBUSR,0))
SET FBRET="0^CH notification/request edited"
End DoDot:2
if FBRET'>0
QUIT
+29 ;
+30 ; check file 162.7 when unauthorized claim
+31 IF $GET(FB583)
IF $ORDER(^FB583(FB583,"LOG1","AU",FBUSR,0))
SET FBRET="0^unauthorized claim edited"
QUIT
End DoDot:1
+32 ;
+33 QUIT FBRET
+34 ;
+35 ;FBUTL9