FBCHFED ;WOIFO/SAB - FPPS DATA EDIT INPATIENT INVOICE ;5/15/14 18:25
;;3.5;FEE BASIS;**61,154**;JAN 30, 1995;Build 12
;;Per VA Directive 6402, this routine should not be modified.
;
S FBAAOUT=0
F D INVED Q:FBAAOUT
D CLEAN
Q
;
INVED ; Invoice Edit
;
ASKINV ; Select Invoice to Edit
W ! S DIC="^FBAAI(",DIC(0)="AEQZ"
S DIC("S")="I $P($G(^(3)),U)]""""" ; screen on EDI claim
D ^DIC K DIC I Y'>0 S FBAAOUT=1 Q
S FBDA=+Y
;
I $$CKFPPS^FBFHLL(FBDA)'=1 D G ASKINV
. W !?5,"Invoice ",FBDA," has not been transmitted to FPPS."
;
; save FPPS Claim ID and Line Item data prior to edit session
S (FBFPPSC,FBFPPSC(0))=$P($G(^FBAAI(FBDA,3)),U)
S (FBFPPSL,FBFPPSL(0))=$P($G(^FBAAI(FBDA,3)),U,2)
S FBINVCHG=0 ; initialize invoice changed flag
;
EDITFC ; edit FPPS CLAIM ID
S FBX=$$FPPSC^FBUTL5(1,FBFPPSC)
I FBX=-1 S FBAAOUT=1 G INVEDX
; need to verify if following restriction is appropriate
I FBX="" D G EDITFC
. W !,$C(7),"Can not change EDI from YES to NO on invoice that has been sent to FPPS!"
S FBFPPSC=FBX
;
; if FPPS CLAIM ID changed, then update file and audit log
I FBFPPSC'=FBFPPSC(0) D
. ; set invoice changed flag
. S FBINVCHG=1
. ;
. ; file data in 162.5
. K FBFDA
. S FBFDA(162.5,FBDA_",",56)=$S(FBFPPSC="":"@",1:FBFPPSC)
. I $D(FBFDA) D FILE^DIE("","FBFDA") D MSG^DIALOG()
. ;
. ; add record to audit log
. K FBFDA
. S FBFDA(163.7,"+1,",.01)=FBDA ; invoice number
. S FBFDA(163.7,"+1,",1)=$$NOW^XLFDT() ; date/time changed
. S FBFDA(163.7,"+1,",2)=162.5 ; file #
. S FBFDA(163.7,"+1,",3)=FBDA_"," ; iens
. S FBFDA(163.7,"+1,",4)=56 ; field #
. S FBFDA(163.7,"+1,",5)=FBFPPSC(0) ; old value
. S FBFDA(163.7,"+1,",6)=FBFPPSC ; new value
. S FBFDA(163.7,"+1,",7)=DUZ ; user
. I $D(FBFDA) D UPDATE^DIE("","FBFDA") D MSG^DIALOG()
;
;
EDITFL ; edit FPPS Line Item
W !
S FBX=$$FPPSL^FBUTL5(FBFPPSL,1)
I FBX=-1 S FBAAOUT=1 G INVEDX
S FBFPPSL=FBX
;
; if FPPS LINE ITEM changed, then update file and audit log
I FBFPPSL'=FBFPPSL(0) D
. ; set invoice changed flag
. S FBINVCHG=1
. ;
. ; file data in 162.5
. K FBFDA
. S FBFDA(162.5,FBDA_",",57)=FBFPPSL
. I $D(FBFDA) D FILE^DIE("","FBFDA") D MSG^DIALOG()
. ;
. ; add record to audit log
. K FBFDA
. S FBFDA(163.7,"+1,",.01)=FBDA ; invoice number
. S FBFDA(163.7,"+1,",1)=$$NOW^XLFDT() ; date/time changed
. S FBFDA(163.7,"+1,",2)=162.5 ; file #
. S FBFDA(163.7,"+1,",3)=FBDA_"," ; iens
. S FBFDA(163.7,"+1,",4)=57 ; field #
. S FBFDA(163.7,"+1,",5)=FBFPPSL(0) ; old value
. S FBFDA(163.7,"+1,",6)=FBFPPSL ; new value
. S FBFDA(163.7,"+1,",7)=DUZ ; user
. I $D(FBFDA) D UPDATE^DIE("","FBFDA") D MSG^DIALOG()
;
INVEDX ; Invoice Edit Exit
; if invoice changed then queue for retransmit to FPPS
I FBINVCHG D FILEQUE^FBFHLL(FBDA,9)
Q
;
CLEAN K DIC,DIR,DIROUT,DIRUT,DTOUT,DUOUT,X,Y
K FBAAOUT,FBDA,FBFDA,FBFPPSC,FBFPPSL,FBINVCHG,FBX
Q
;FBCHFED
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HFBCHFED 2958 printed Dec 13, 2024@01:57:44 Page 2
FBCHFED ;WOIFO/SAB - FPPS DATA EDIT INPATIENT INVOICE ;5/15/14 18:25
+1 ;;3.5;FEE BASIS;**61,154**;JAN 30, 1995;Build 12
+2 ;;Per VA Directive 6402, this routine should not be modified.
+3 ;
+4 SET FBAAOUT=0
+5 FOR
DO INVED
if FBAAOUT
QUIT
+6 DO CLEAN
+7 QUIT
+8 ;
INVED ; Invoice Edit
+1 ;
ASKINV ; Select Invoice to Edit
+1 WRITE !
SET DIC="^FBAAI("
SET DIC(0)="AEQZ"
+2 ; screen on EDI claim
SET DIC("S")="I $P($G(^(3)),U)]"""""
+3 DO ^DIC
KILL DIC
IF Y'>0
SET FBAAOUT=1
QUIT
+4 SET FBDA=+Y
+5 ;
+6 IF $$CKFPPS^FBFHLL(FBDA)'=1
Begin DoDot:1
+7 WRITE !?5,"Invoice ",FBDA," has not been transmitted to FPPS."
End DoDot:1
GOTO ASKINV
+8 ;
+9 ; save FPPS Claim ID and Line Item data prior to edit session
+10 SET (FBFPPSC,FBFPPSC(0))=$PIECE($GET(^FBAAI(FBDA,3)),U)
+11 SET (FBFPPSL,FBFPPSL(0))=$PIECE($GET(^FBAAI(FBDA,3)),U,2)
+12 ; initialize invoice changed flag
SET FBINVCHG=0
+13 ;
EDITFC ; edit FPPS CLAIM ID
+1 SET FBX=$$FPPSC^FBUTL5(1,FBFPPSC)
+2 IF FBX=-1
SET FBAAOUT=1
GOTO INVEDX
+3 ; need to verify if following restriction is appropriate
+4 IF FBX=""
Begin DoDot:1
+5 WRITE !,$CHAR(7),"Can not change EDI from YES to NO on invoice that has been sent to FPPS!"
End DoDot:1
GOTO EDITFC
+6 SET FBFPPSC=FBX
+7 ;
+8 ; if FPPS CLAIM ID changed, then update file and audit log
+9 IF FBFPPSC'=FBFPPSC(0)
Begin DoDot:1
+10 ; set invoice changed flag
+11 SET FBINVCHG=1
+12 ;
+13 ; file data in 162.5
+14 KILL FBFDA
+15 SET FBFDA(162.5,FBDA_",",56)=$SELECT(FBFPPSC="":"@",1:FBFPPSC)
+16 IF $DATA(FBFDA)
DO FILE^DIE("","FBFDA")
DO MSG^DIALOG()
+17 ;
+18 ; add record to audit log
+19 KILL FBFDA
+20 ; invoice number
SET FBFDA(163.7,"+1,",.01)=FBDA
+21 ; date/time changed
SET FBFDA(163.7,"+1,",1)=$$NOW^XLFDT()
+22 ; file #
SET FBFDA(163.7,"+1,",2)=162.5
+23 ; iens
SET FBFDA(163.7,"+1,",3)=FBDA_","
+24 ; field #
SET FBFDA(163.7,"+1,",4)=56
+25 ; old value
SET FBFDA(163.7,"+1,",5)=FBFPPSC(0)
+26 ; new value
SET FBFDA(163.7,"+1,",6)=FBFPPSC
+27 ; user
SET FBFDA(163.7,"+1,",7)=DUZ
+28 IF $DATA(FBFDA)
DO UPDATE^DIE("","FBFDA")
DO MSG^DIALOG()
End DoDot:1
+29 ;
+30 ;
EDITFL ; edit FPPS Line Item
+1 WRITE !
+2 SET FBX=$$FPPSL^FBUTL5(FBFPPSL,1)
+3 IF FBX=-1
SET FBAAOUT=1
GOTO INVEDX
+4 SET FBFPPSL=FBX
+5 ;
+6 ; if FPPS LINE ITEM changed, then update file and audit log
+7 IF FBFPPSL'=FBFPPSL(0)
Begin DoDot:1
+8 ; set invoice changed flag
+9 SET FBINVCHG=1
+10 ;
+11 ; file data in 162.5
+12 KILL FBFDA
+13 SET FBFDA(162.5,FBDA_",",57)=FBFPPSL
+14 IF $DATA(FBFDA)
DO FILE^DIE("","FBFDA")
DO MSG^DIALOG()
+15 ;
+16 ; add record to audit log
+17 KILL FBFDA
+18 ; invoice number
SET FBFDA(163.7,"+1,",.01)=FBDA
+19 ; date/time changed
SET FBFDA(163.7,"+1,",1)=$$NOW^XLFDT()
+20 ; file #
SET FBFDA(163.7,"+1,",2)=162.5
+21 ; iens
SET FBFDA(163.7,"+1,",3)=FBDA_","
+22 ; field #
SET FBFDA(163.7,"+1,",4)=57
+23 ; old value
SET FBFDA(163.7,"+1,",5)=FBFPPSL(0)
+24 ; new value
SET FBFDA(163.7,"+1,",6)=FBFPPSL
+25 ; user
SET FBFDA(163.7,"+1,",7)=DUZ
+26 IF $DATA(FBFDA)
DO UPDATE^DIE("","FBFDA")
DO MSG^DIALOG()
End DoDot:1
+27 ;
INVEDX ; Invoice Edit Exit
+1 ; if invoice changed then queue for retransmit to FPPS
+2 IF FBINVCHG
DO FILEQUE^FBFHLL(FBDA,9)
+3 QUIT
+4 ;
CLEAN KILL DIC,DIR,DIROUT,DIRUT,DTOUT,DUOUT,X,Y
+1 KILL FBAAOUT,FBDA,FBFDA,FBFPPSC,FBFPPSL,FBINVCHG,FBX
+2 QUIT
+3 ;FBCHFED