FBAAIARB ;ALB/ESG - FEE IPAC Vendor Payment Report (Detail) ;2/4/2014
;;3.5;FEE BASIS;**123**;JAN 30, 1995;Build 51
;;Per VA Directive 6402, this routine should not be modified.
;
Q
;
EN ; main report entry point
;
N FBIAVEN,FBIABEG,FBIAEND,FBIATYPE,FBIAEXCEL,FBIAADJ,FBIAIGNORE
P1 I '$$VENDSEL(.FBIAVEN) G EX ; vendor
P2 I '$$DATES(.FBIABEG,.FBIAEND) G EX:$$STOP,P1 ; begin and end dates
P3 I '$$TYPESEL(.FBIATYPE) G EX:$$STOP,P2 ; type of invoice
P4 I '$$SUSPADJ(.FBIAADJ) G EX:$$STOP,P3 ; only include suspended/adjusted payments?
P5 I '$$IGNCV(.FBIAIGNORE) G EX:$$STOP,P4 ; ignore cancelled/voided payment lines?
P6 I '$$FORMAT(.FBIAEXCEL) G EX:$$STOP,P5 ; format (standard or CSV)
P7 I '$$DEVICE() G EX:$$STOP,P6 ; device
;
EX ; main report exit point
Q
;
STOP() ; Determine if user wants to exit out of the option entirely
; 1=yes, get out entirely
; 0=no, just go back to the previous question
;
N DIR,X,Y,DTOUT,DUOUT,DIRUT,DIROUT
;
S DIR(0)="Y"
S DIR("A")="Do you want to exit out of this option entirely"
S DIR("B")="YES"
S DIR("?",1)=" Enter YES to immediately exit out of this option."
S DIR("?")=" Enter NO to return to the previous question."
W ! D ^DIR K DIR
I $D(DIRUT) S Y=1
Q Y
;
VENDSEL(FBIAVEN) ; user selection function for IPAC vendors
; FBIAVEN is an output array, pass by reference
; FBIAVEN(vendor ien) = vendor name selected
; Function value is 1 if at least 1 vendor was selected, 0 otherwise
;
N DIC,RET,VAUTSTR,VAUTNI,VAUTVB,V,X,Y
K FBIAVEN
S RET=1 ; default to 1 indicating all OK
;
W @IOF,!,"IPAC Vendor Payment Report"
W !!,"This report will display detail information on paid line items by the"
W !,"invoice type, DoD invoice number, and date of service."
W !
;
S DIC="^FBAAV("
S DIC("S")="I +$O(^FBAA(161.95,""V"",Y,0))"
S VAUTSTR="IPAC Vendor",VAUTNI=2,VAUTVB="FBIAVEN"
D FIRST^VAUTOMA ; DBIA# 4398
I FBIAVEN S V=0 F S V=$O(^FBAA(161.95,"V",V)) Q:'V S FBIAVEN(V)=$P($G(^FBAAV(V,0)),U,1) ; all IPAC vendors selected
I '$O(FBIAVEN(0)) S RET=0 W $C(7) ; no vendors found/selected
Q RET
;
DATES(FBIABEG,FBIAEND) ; capture the start date and end date from the user
; both are output parameters, pass by reference
; function value is 0/1 indicating if valid dates were selected
;
N RET,DIR,X,Y,DTOUT,DUOUT,DIRUT,DIROUT
S RET=1
S (FBIABEG,FBIAEND)=""
;
S DIR(0)="D^:DT:EX"
S DIR("A")="Enter the Start Date"
S DIR("B")=$$FMTE^XLFDT($$FMADD^XLFDT(DT,-30),"5DZ") ; default date is T-30
S DIR("?",1)="The start and end dates for this report refer to the date that the"
S DIR("?",2)="associated batch and payment line items are finalized (certified)"
S DIR("?")="in VistA Fee through the ""Finalize a Batch"" menu option."
W ! D ^DIR K DIR
I $D(DIRUT)!'Y S RET=0 W $C(7) G DATEX
S FBIABEG=Y
;
S DIR(0)="D^"_FBIABEG_":DT:EX"
S DIR("A")="Enter the End Date"
S DIR("B")=$$FMTE^XLFDT(DT,"5DZ") ; default date is Today
S DIR("?",1)="The start and end dates for this report refer to the date that the"
S DIR("?",2)="associated batch and payment line items are finalized (certified)"
S DIR("?")="in VistA Fee through the ""Finalize a Batch"" menu option."
W ! D ^DIR K DIR
I $D(DIRUT)!'Y S RET=0 W $C(7) G DATEX
S FBIAEND=Y
DATEX ;
Q RET
;
TYPESEL(FBIATYPE) ; function for user selection of the types of invoices to search
; FBIATYPE is an output array, pass by reference
; FBIATYPE(type)="" where type can be OUT,RX,INP,ANC
; Function value is 1 if at least 1 invoice type was selected, 0 otherwise
;
N RET,DIR,X,Y,DTOUT,DUOUT,DIRUT,DIROUT,FD,G
K FBIATYPE
S RET=1 ; default to 1 indicating all OK
;
F D Q:Y="ALL"!$D(DIRUT)!(Y="")
. S DIR(0)="SO"
. S FD="OUT:"_$$LJ^XLFSTR("Outpatient",27)_$S($D(FBIATYPE("OUT")):"SELECTED",1:"")
. S FD=FD_";RX:"_$$LJ^XLFSTR("Pharmacy",27)_$S($D(FBIATYPE("RX")):"SELECTED",1:"")
. S FD=FD_";INP:"_$$LJ^XLFSTR("Civil Hospital",27)_$S($D(FBIATYPE("INP")):"SELECTED",1:"")
. S FD=FD_";ANC:"_$$LJ^XLFSTR("Civil Hospital Ancillary",27)_$S($D(FBIATYPE("ANC")):"SELECTED",1:"")
. S FD=FD_";ALL:All"
. S $P(DIR(0),U,2)=FD
. ;
. I '$D(FBIATYPE) S DIR("A")="Select an Invoice Type",DIR("B")="ALL"
. E S DIR("A")="Select Another Invoice Type" K DIR("B")
. W ! D ^DIR K DIR
. ;
. I Y="ALL" D Q ; user selected all types, so set them and get out
.. F G="OUT","RX","INP","ANC" S FBIATYPE(G)=""
. ;
. I $D(DIRUT)!(Y="") Q
. I $D(FBIATYPE(Y)) K FBIATYPE(Y) Q ; if already selected, toggle the selection off then quit
. S FBIATYPE(Y)="" ; toggle selection on
. Q
;
I $D(DUOUT)!$D(DTOUT) S RET=0 ; exit via up-arrow or time-out should get out
I '$D(FBIATYPE) S RET=0 W $C(7)
Q RET
;
SUSPADJ(FBIAADJ) ; capture only suspended payments?
; FBIAADJ=0 meaning NO user wants to include all payment lines
; FBIAADJ=1 meaning YES only include payments where Amount Paid is less than Amount Claimed
; pass parameter by reference
;
N RET,DIR,X,Y,DTOUT,DUOUT,DIRUT,DIROUT
S FBIAADJ=0,RET=1
S DIR(0)="Y"
S DIR("A")="Only Include Suspended Payments (not paid in full)"
S DIR("B")="NO"
S DIR("?",1)="Enter NO if you want to include all payment lines regardless of amount"
S DIR("?",2)="claimed, paid, or suspended/adjusted."
S DIR("?",3)=" "
S DIR("?",4)="Enter YES if you only want to include payments that are not paid in full."
S DIR("?",5)="This means that the amount the VA paid is less than the vendor's claimed"
S DIR("?")="amount. The remaining balance has been suspended or adjusted."
W ! D ^DIR K DIR
I $D(DIRUT) S RET=0 W $C(7)
S FBIAADJ=Y
Q RET
;
FORMAT(FBIAEXCEL) ; capture the report format from the user (normal or CSV output)
; FBIAEXCEL=0 for normal output
; FBIAEXCEL=1 for CSV (comma separated values) for Excel output
; pass parameter by reference
;
N RET,DIR,X,Y,DTOUT,DUOUT,DIRUT,DIROUT
S FBIAEXCEL=0,RET=1
S DIR(0)="Y"
S DIR("A")="Do you want to capture the output in a CSV format"
S DIR("B")="NO"
S DIR("?",1)="If you want to capture the output from this report in a comma-separated"
S DIR("?",2)="values (CSV) format, then answer YES here. A CSV format is something that"
S DIR("?",3)="could be easily imported into a spreadsheet program like Excel."
S DIR("?",4)=" "
S DIR("?")="If you just want a normal report output, then answer NO here."
W ! D ^DIR K DIR
I $D(DIRUT) S RET=0 W $C(7)
S FBIAEXCEL=Y
Q RET
;
IGNCV(FBIAIGNORE) ; should we ignore cancelled, voided, or rejected line items?
; FBIAIGNORE=0 means don't ignore, include everything
; FBIAIGNORE=1 means yes ignore cancelled/voided/rejected line items
; pass parameter by reference
;
N RET,DIR,X,Y,DTOUT,DUOUT,DIRUT,DIROUT
S FBIAIGNORE=1,RET=1
S DIR(0)="Y"
S DIR("A")="Ignore Cancelled or Voided Payments"
S DIR("B")="YES"
S DIR("?",1)="Enter YES if you want to ignore any payment line items that have been"
S DIR("?",2)="cancelled, voided, or rejected so these items will not show up on the report."
S DIR("?",3)=" "
S DIR("?",4)="Enter NO if you would like to include cancelled, voided, or rejected line"
S DIR("?",5)="items so they will show up on the report. For such payment line items, an"
S DIR("?")="indicator will be displayed on the report."
W ! D ^DIR K DIR
I $D(DIRUT) S RET=0 W $C(7)
S FBIAIGNORE=Y
Q RET
;
DEVICE() ; Device Selection
N ZTRTN,ZTDESC,ZTSAVE,POP,RET,ZTSK,DIR,X,Y
S RET=1
I 'FBIAEXCEL W !!,"This report is 132 characters wide. Please choose an appropriate device.",!
I FBIAEXCEL D
. W !!,"For CSV output, turn logging or capture on now."
. W !,"To avoid undesired wrapping of the data saved to the file,"
. W !,"please enter ""0;256;99999"" at the ""DEVICE:"" prompt.",!
;
S ZTRTN="COMPILE^FBAAIARC"
S ZTDESC="Fee Basis IPAC Vendor Payment Report"
S ZTSAVE("FBIAVEN(")=""
S ZTSAVE("FBIABEG")=""
S ZTSAVE("FBIAEND")=""
S ZTSAVE("FBIATYPE(")=""
S ZTSAVE("FBIAADJ")=""
S ZTSAVE("FBIAEXCEL")=""
S ZTSAVE("FBIAIGNORE")=""
D EN^XUTMDEVQ(ZTRTN,ZTDESC,.ZTSAVE,"QM",1)
I POP S RET=0
I $G(ZTSK) W !!,"Report compilation has started with task# ",ZTSK,".",! S DIR(0)="E" D ^DIR
Q RET
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HFBAAIARB 8376 printed Dec 13, 2024@01:55:38 Page 2
FBAAIARB ;ALB/ESG - FEE IPAC Vendor Payment Report (Detail) ;2/4/2014
+1 ;;3.5;FEE BASIS;**123**;JAN 30, 1995;Build 51
+2 ;;Per VA Directive 6402, this routine should not be modified.
+3 ;
+4 QUIT
+5 ;
EN ; main report entry point
+1 ;
+2 NEW FBIAVEN,FBIABEG,FBIAEND,FBIATYPE,FBIAEXCEL,FBIAADJ,FBIAIGNORE
P1 ; vendor
IF '$$VENDSEL(.FBIAVEN)
GOTO EX
P2 ; begin and end dates
IF '$$DATES(.FBIABEG,.FBIAEND)
if $$STOP
GOTO EX
GOTO P1
P3 ; type of invoice
IF '$$TYPESEL(.FBIATYPE)
if $$STOP
GOTO EX
GOTO P2
P4 ; only include suspended/adjusted payments?
IF '$$SUSPADJ(.FBIAADJ)
if $$STOP
GOTO EX
GOTO P3
P5 ; ignore cancelled/voided payment lines?
IF '$$IGNCV(.FBIAIGNORE)
if $$STOP
GOTO EX
GOTO P4
P6 ; format (standard or CSV)
IF '$$FORMAT(.FBIAEXCEL)
if $$STOP
GOTO EX
GOTO P5
P7 ; device
IF '$$DEVICE()
if $$STOP
GOTO EX
GOTO P6
+1 ;
EX ; main report exit point
+1 QUIT
+2 ;
STOP() ; Determine if user wants to exit out of the option entirely
+1 ; 1=yes, get out entirely
+2 ; 0=no, just go back to the previous question
+3 ;
+4 NEW DIR,X,Y,DTOUT,DUOUT,DIRUT,DIROUT
+5 ;
+6 SET DIR(0)="Y"
+7 SET DIR("A")="Do you want to exit out of this option entirely"
+8 SET DIR("B")="YES"
+9 SET DIR("?",1)=" Enter YES to immediately exit out of this option."
+10 SET DIR("?")=" Enter NO to return to the previous question."
+11 WRITE !
DO ^DIR
KILL DIR
+12 IF $DATA(DIRUT)
SET Y=1
+13 QUIT Y
+14 ;
VENDSEL(FBIAVEN) ; user selection function for IPAC vendors
+1 ; FBIAVEN is an output array, pass by reference
+2 ; FBIAVEN(vendor ien) = vendor name selected
+3 ; Function value is 1 if at least 1 vendor was selected, 0 otherwise
+4 ;
+5 NEW DIC,RET,VAUTSTR,VAUTNI,VAUTVB,V,X,Y
+6 KILL FBIAVEN
+7 ; default to 1 indicating all OK
SET RET=1
+8 ;
+9 WRITE @IOF,!,"IPAC Vendor Payment Report"
+10 WRITE !!,"This report will display detail information on paid line items by the"
+11 WRITE !,"invoice type, DoD invoice number, and date of service."
+12 WRITE !
+13 ;
+14 SET DIC="^FBAAV("
+15 SET DIC("S")="I +$O(^FBAA(161.95,""V"",Y,0))"
+16 SET VAUTSTR="IPAC Vendor"
SET VAUTNI=2
SET VAUTVB="FBIAVEN"
+17 ; DBIA# 4398
DO FIRST^VAUTOMA
+18 ; all IPAC vendors selected
IF FBIAVEN
SET V=0
FOR
SET V=$ORDER(^FBAA(161.95,"V",V))
if 'V
QUIT
SET FBIAVEN(V)=$PIECE($GET(^FBAAV(V,0)),U,1)
+19 ; no vendors found/selected
IF '$ORDER(FBIAVEN(0))
SET RET=0
WRITE $CHAR(7)
+20 QUIT RET
+21 ;
DATES(FBIABEG,FBIAEND) ; capture the start date and end date from the user
+1 ; both are output parameters, pass by reference
+2 ; function value is 0/1 indicating if valid dates were selected
+3 ;
+4 NEW RET,DIR,X,Y,DTOUT,DUOUT,DIRUT,DIROUT
+5 SET RET=1
+6 SET (FBIABEG,FBIAEND)=""
+7 ;
+8 SET DIR(0)="D^:DT:EX"
+9 SET DIR("A")="Enter the Start Date"
+10 ; default date is T-30
SET DIR("B")=$$FMTE^XLFDT($$FMADD^XLFDT(DT,-30),"5DZ")
+11 SET DIR("?",1)="The start and end dates for this report refer to the date that the"
+12 SET DIR("?",2)="associated batch and payment line items are finalized (certified)"
+13 SET DIR("?")="in VistA Fee through the ""Finalize a Batch"" menu option."
+14 WRITE !
DO ^DIR
KILL DIR
+15 IF $DATA(DIRUT)!'Y
SET RET=0
WRITE $CHAR(7)
GOTO DATEX
+16 SET FBIABEG=Y
+17 ;
+18 SET DIR(0)="D^"_FBIABEG_":DT:EX"
+19 SET DIR("A")="Enter the End Date"
+20 ; default date is Today
SET DIR("B")=$$FMTE^XLFDT(DT,"5DZ")
+21 SET DIR("?",1)="The start and end dates for this report refer to the date that the"
+22 SET DIR("?",2)="associated batch and payment line items are finalized (certified)"
+23 SET DIR("?")="in VistA Fee through the ""Finalize a Batch"" menu option."
+24 WRITE !
DO ^DIR
KILL DIR
+25 IF $DATA(DIRUT)!'Y
SET RET=0
WRITE $CHAR(7)
GOTO DATEX
+26 SET FBIAEND=Y
DATEX ;
+1 QUIT RET
+2 ;
TYPESEL(FBIATYPE) ; function for user selection of the types of invoices to search
+1 ; FBIATYPE is an output array, pass by reference
+2 ; FBIATYPE(type)="" where type can be OUT,RX,INP,ANC
+3 ; Function value is 1 if at least 1 invoice type was selected, 0 otherwise
+4 ;
+5 NEW RET,DIR,X,Y,DTOUT,DUOUT,DIRUT,DIROUT,FD,G
+6 KILL FBIATYPE
+7 ; default to 1 indicating all OK
SET RET=1
+8 ;
+9 FOR
Begin DoDot:1
+10 SET DIR(0)="SO"
+11 SET FD="OUT:"_$$LJ^XLFSTR("Outpatient",27)_$SELECT($DATA(FBIATYPE("OUT")):"SELECTED",1:"")
+12 SET FD=FD_";RX:"_$$LJ^XLFSTR("Pharmacy",27)_$SELECT($DATA(FBIATYPE("RX")):"SELECTED",1:"")
+13 SET FD=FD_";INP:"_$$LJ^XLFSTR("Civil Hospital",27)_$SELECT($DATA(FBIATYPE("INP")):"SELECTED",1:"")
+14 SET FD=FD_";ANC:"_$$LJ^XLFSTR("Civil Hospital Ancillary",27)_$SELECT($DATA(FBIATYPE("ANC")):"SELECTED",1:"")
+15 SET FD=FD_";ALL:All"
+16 SET $PIECE(DIR(0),U,2)=FD
+17 ;
+18 IF '$DATA(FBIATYPE)
SET DIR("A")="Select an Invoice Type"
SET DIR("B")="ALL"
+19 IF '$TEST
SET DIR("A")="Select Another Invoice Type"
KILL DIR("B")
+20 WRITE !
DO ^DIR
KILL DIR
+21 ;
+22 ; user selected all types, so set them and get out
IF Y="ALL"
Begin DoDot:2
+23 FOR G="OUT","RX","INP","ANC"
SET FBIATYPE(G)=""
End DoDot:2
QUIT
+24 ;
+25 IF $DATA(DIRUT)!(Y="")
QUIT
+26 ; if already selected, toggle the selection off then quit
IF $DATA(FBIATYPE(Y))
KILL FBIATYPE(Y)
QUIT
+27 ; toggle selection on
SET FBIATYPE(Y)=""
+28 QUIT
End DoDot:1
if Y="ALL"!$DATA(DIRUT)!(Y="")
QUIT
+29 ;
+30 ; exit via up-arrow or time-out should get out
IF $DATA(DUOUT)!$DATA(DTOUT)
SET RET=0
+31 IF '$DATA(FBIATYPE)
SET RET=0
WRITE $CHAR(7)
+32 QUIT RET
+33 ;
SUSPADJ(FBIAADJ) ; capture only suspended payments?
+1 ; FBIAADJ=0 meaning NO user wants to include all payment lines
+2 ; FBIAADJ=1 meaning YES only include payments where Amount Paid is less than Amount Claimed
+3 ; pass parameter by reference
+4 ;
+5 NEW RET,DIR,X,Y,DTOUT,DUOUT,DIRUT,DIROUT
+6 SET FBIAADJ=0
SET RET=1
+7 SET DIR(0)="Y"
+8 SET DIR("A")="Only Include Suspended Payments (not paid in full)"
+9 SET DIR("B")="NO"
+10 SET DIR("?",1)="Enter NO if you want to include all payment lines regardless of amount"
+11 SET DIR("?",2)="claimed, paid, or suspended/adjusted."
+12 SET DIR("?",3)=" "
+13 SET DIR("?",4)="Enter YES if you only want to include payments that are not paid in full."
+14 SET DIR("?",5)="This means that the amount the VA paid is less than the vendor's claimed"
+15 SET DIR("?")="amount. The remaining balance has been suspended or adjusted."
+16 WRITE !
DO ^DIR
KILL DIR
+17 IF $DATA(DIRUT)
SET RET=0
WRITE $CHAR(7)
+18 SET FBIAADJ=Y
+19 QUIT RET
+20 ;
FORMAT(FBIAEXCEL) ; capture the report format from the user (normal or CSV output)
+1 ; FBIAEXCEL=0 for normal output
+2 ; FBIAEXCEL=1 for CSV (comma separated values) for Excel output
+3 ; pass parameter by reference
+4 ;
+5 NEW RET,DIR,X,Y,DTOUT,DUOUT,DIRUT,DIROUT
+6 SET FBIAEXCEL=0
SET RET=1
+7 SET DIR(0)="Y"
+8 SET DIR("A")="Do you want to capture the output in a CSV format"
+9 SET DIR("B")="NO"
+10 SET DIR("?",1)="If you want to capture the output from this report in a comma-separated"
+11 SET DIR("?",2)="values (CSV) format, then answer YES here. A CSV format is something that"
+12 SET DIR("?",3)="could be easily imported into a spreadsheet program like Excel."
+13 SET DIR("?",4)=" "
+14 SET DIR("?")="If you just want a normal report output, then answer NO here."
+15 WRITE !
DO ^DIR
KILL DIR
+16 IF $DATA(DIRUT)
SET RET=0
WRITE $CHAR(7)
+17 SET FBIAEXCEL=Y
+18 QUIT RET
+19 ;
IGNCV(FBIAIGNORE) ; should we ignore cancelled, voided, or rejected line items?
+1 ; FBIAIGNORE=0 means don't ignore, include everything
+2 ; FBIAIGNORE=1 means yes ignore cancelled/voided/rejected line items
+3 ; pass parameter by reference
+4 ;
+5 NEW RET,DIR,X,Y,DTOUT,DUOUT,DIRUT,DIROUT
+6 SET FBIAIGNORE=1
SET RET=1
+7 SET DIR(0)="Y"
+8 SET DIR("A")="Ignore Cancelled or Voided Payments"
+9 SET DIR("B")="YES"
+10 SET DIR("?",1)="Enter YES if you want to ignore any payment line items that have been"
+11 SET DIR("?",2)="cancelled, voided, or rejected so these items will not show up on the report."
+12 SET DIR("?",3)=" "
+13 SET DIR("?",4)="Enter NO if you would like to include cancelled, voided, or rejected line"
+14 SET DIR("?",5)="items so they will show up on the report. For such payment line items, an"
+15 SET DIR("?")="indicator will be displayed on the report."
+16 WRITE !
DO ^DIR
KILL DIR
+17 IF $DATA(DIRUT)
SET RET=0
WRITE $CHAR(7)
+18 SET FBIAIGNORE=Y
+19 QUIT RET
+20 ;
DEVICE() ; Device Selection
+1 NEW ZTRTN,ZTDESC,ZTSAVE,POP,RET,ZTSK,DIR,X,Y
+2 SET RET=1
+3 IF 'FBIAEXCEL
WRITE !!,"This report is 132 characters wide. Please choose an appropriate device.",!
+4 IF FBIAEXCEL
Begin DoDot:1
+5 WRITE !!,"For CSV output, turn logging or capture on now."
+6 WRITE !,"To avoid undesired wrapping of the data saved to the file,"
+7 WRITE !,"please enter ""0;256;99999"" at the ""DEVICE:"" prompt.",!
End DoDot:1
+8 ;
+9 SET ZTRTN="COMPILE^FBAAIARC"
+10 SET ZTDESC="Fee Basis IPAC Vendor Payment Report"
+11 SET ZTSAVE("FBIAVEN(")=""
+12 SET ZTSAVE("FBIABEG")=""
+13 SET ZTSAVE("FBIAEND")=""
+14 SET ZTSAVE("FBIATYPE(")=""
+15 SET ZTSAVE("FBIAADJ")=""
+16 SET ZTSAVE("FBIAEXCEL")=""
+17 SET ZTSAVE("FBIAIGNORE")=""
+18 DO EN^XUTMDEVQ(ZTRTN,ZTDESC,.ZTSAVE,"QM",1)
+19 IF POP
SET RET=0
+20 IF $GET(ZTSK)
WRITE !!,"Report compilation has started with task# ",ZTSK,".",!
SET DIR(0)="E"
DO ^DIR
+21 QUIT RET
+22 ;