FBCHVP ;AISC/CMR - VOID & CANCEL VOIDED INPATIENT PAYMENT ;5/16/14 16:17
;;3.5;FEE BASIS;**55,69,154**;JAN 30, 1995;Build 12
;;Per VA Directive 6402, this routine should not be modified.
;Variable 'FBVOID' is set if cancelling a voided payment.
;Variable 'FBTYPE' is set to 6 for CH or 7 for CNH.
D DT^DICRW
RDP ;Get veteran if they have an inpatient invoice (DFN).
K ^TMP($J) W !! S DIC=161,DIC(0)="AEMZ",DIC("S")="I $D(^FBAAI(""AK"",+Y))" D ^DIC K DIC G Q:X=""!($D(DTOUT))!($D(DUOUT)),RDP:Y<0 S DFN=+Y
RDV ;Get vendor if an inpatient provider for this patient (FBV).
W !! S DIC=161.2,DIC(0)="AEMZ",DIC("S")="I $D(^FBAAI(""AK"",DFN,+Y))" D ^DIC K DIC G Q:X=""!($D(DTOUT))!($D(DUOUT)),RDV:Y<0 S FBV=+Y
D EN1
I FBCTR=0 W !!?12,*7,"Vendor has no",$S($D(FBVOID):" VOIDED",1:"")," finalized payments ",$S('$D(FBVOID):"to VOID",1:""),!?12,"for this patient under the ",$S(FBTYPE=6:"CIVIL HOSPITAL",1:"COMMUNITY NURSING HOME")," program." G RDV
W !!,"Which payment item(s) would you like to ",$S($D(FBVOID):"Cancel the void on",1:"Void")," ? " S DIR(0)="L^1:"_FBCTR D ^DIR G RDV:$D(DIRUT) S FBX=Y W @IOF D HED
F A=1:1:FBCTR S X=$P(FBX,",",A) Q:X="" S FBI=+FBI(X),FBINV=^TMP($J,"FBCHVP",FBI),FBVD=$P(FBINV,"^",14) W ! D WRT1 S ^TMP($J,"FBCHVP","VOID",FBI)=""
W ! S DIR(0)="Y",DIR("A")="Are you sure you want to "_$S($D(FBVOID):"Cancel the void on",1:"Void")_" the payment(s)",DIR("B")="No" D ^DIR K DIR G RDP:$D(DIRUT)!'Y
S FBI=0 F S FBI=$O(^TMP($J,"FBCHVP","VOID",FBI)) Q:FBI'>0 D SETR,CONF W !,?5,".... Done.",!
Q K DFN,FBV,FBI,FBTYPE,FBVOID,FBCTR,FBAMTC,FBAMTP,FBBAT,FBDRG,FBFDT,FBINV,FBNUM,FBREIM,FBTDT,FBVD,Q,FBX,VP,^TMP($J,"FBCHVP"),Y,DIE,DR,FBVR,DA
Q
EN1 ;Find finalized payments that match FBTYPE and store in ^TMP.
S (FBI,FBCTR)=0,Q="-",$P(Q,"-",80)="-"
S IOP=$S($D(ION):ION,1:"HOME") D ^%ZIS K IOP
F S FBI=$O(^FBAAI("AK",DFN,FBV,FBI)) Q:FBI'>0 I $D(^FBAAI(FBI,0)),'$D(^("FBREJ")) S FBINV=^(0),FBVD=$P(FBINV,"^",14) I $P(FBINV,"^",16)'=""&($P(FBINV,"^",12)=FBTYPE)&($S($D(FBVOID):(FBVD="VP"),1:(FBVD=""))) D WRT
Q
WRT N FBX,FBY2,FBY3,FBCDAYS,FBSCID,FBFPPSC,FBFPPSL,FBADJLR,FBRRMKL
S FBX=$$ADJLRA^FBCHFA(FBI_",")
S FBY2=$G(^FBAAI(FBI,2))
S FBY3=$G(^FBAAI(FBI,3))
S FBCDAYS=$P(FBY2,U,10) ; covered days
S FBSCID=$P(FBY2,U,11) ; patient control number
S FBFPPSC=$P(FBY3,U) ; fpps claim id
S FBFPPSL=$P(FBY3,U,2) ; fpps line item
S FBRRMKL=$$RRL^FBCHFR(FBI_",") ; remit remarks
S FBADJLR=$P(FBX,U) ; adjustment reason
S ^TMP($J,"FBCHVP",FBI)=FBINV
S ^TMP($J,"FBCHVP",FBI,"FBMR")=FBCDAYS_U_FBADJLR_U_FBRRMKL_U_FBSCID_U_FBFPPSC_U_FBFPPSL
I FBCTR=0!($Y+5>IOSL) W @IOF D HED
S FBCTR=FBCTR+1,FBI(FBCTR)=FBI
W !,FBCTR_") " D WRT1 I $D(FBVOID)&($D(^FBAAI(FBI,"R"))) W !?3,"Reason:",!?10,^("R"),!
Q
WRT1 N FBMRVP S FBMRVP=^TMP($J,"FBCHVP",FBI,"FBMR")
S FBREIM=$P(FBINV,"^",13),FBFDT=$P(FBINV,"^",6),FBTDT=$P(FBINV,"^",7),FBDRG=$P(FBINV,"^",24),FBAMTC=$P(FBINV,"^",8),FBAMTP=$P(FBINV,"^",9),FBNUM=+FBINV,FBBAT=$P(FBINV,"^",17)
D FBCKI^FBAACCB1(FBI)
W $S(FBREIM="R":"*",1:""),$S(FBVD="VP":"#",1:""),?3,$$DATX^FBAAUTL(FBFDT),?16,$$DATX^FBAAUTL(FBTDT)
W ?26,$S($G(FBDRG):$J($$ICD^FBCSV1(FBDRG,$G(FBFDT)),4),1:""),?35,$J($FN(FBAMTC,",",2),8),?48,$J($FN(FBAMTP,",",2),8),?62,$J(FBNUM,5),?72,$J($P($G(^FBAA(161.7,+FBBAT,0)),"^"),6)
W !,?5,$P(FBMRVP,U),?19,$P(FBMRVP,U,2),?34,$P(FBMRVP,U,3),?54,$P(FBMRVP,U,4)
I $P(FBMRVP,U,5)]"" W !,?5,"FPPS Claim ID: ",$P(FBMRVP,U,5),?33,"FPPS Line Item: ",$P(FBMRVP,U,6)
N A2 S A2=+FBAMTP D PMNT^FBAACCB2
Q
HED W !,"Patient Name: ",$P(^DPT(DFN,0),"^"),?50,"Pt.ID ",$$SSN^FBAAUTL(DFN),!!,?2,"VENDOR: ",$P(^FBAAV(FBV,0),"^"),!,?10,"('*' Represents Reimbursement to Patient)",!,?10,"('#' Represents a Voided Payment)"
W !," FROM DATE",?16,"TO DATE",?26,"DRG",?33,"AMT CLAIMED",?48,"AMT PAID",?60,"INVOICE #",?72,"BATCH #"
W !,?5,"COV.DAYS",?19,"ADJ CODE",?34,"REMIT REMARKS",?55,"PATIENT CONTROL #"
W !,Q,!
Q
SETR ;Set/delete void node on record.
S DA=FBI,VP=$S($D(FBVOID):"",1:"VOID")
I $D(FBVOID) S DR="16///@;16.5///@;17///@"
I '$D(FBVOID) S DR="16///^S X=VP;17////^S X=DUZ"_$S($D(FBVR):";16.5////^S X=FBVR",1:";16.5R;S FBVR=X")
S DIE="^FBAAI(",DIDEL=162.5 D ^DIE K DIDEL
Q
CONF ;Print void/cancel void confirmation.
W !,?10,$S($D(FBVOID):"Cancel Voided",1:"Void")," payment for ",$$NAME^FBCHREQ2(DFN),!,*7,"You must adjust control point accordingly through IFCAP!"
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HFBCHVP 4415 printed Nov 22, 2024@17:08:14 Page 2
FBCHVP ;AISC/CMR - VOID & CANCEL VOIDED INPATIENT PAYMENT ;5/16/14 16:17
+1 ;;3.5;FEE BASIS;**55,69,154**;JAN 30, 1995;Build 12
+2 ;;Per VA Directive 6402, this routine should not be modified.
+3 ;Variable 'FBVOID' is set if cancelling a voided payment.
+4 ;Variable 'FBTYPE' is set to 6 for CH or 7 for CNH.
+5 DO DT^DICRW
RDP ;Get veteran if they have an inpatient invoice (DFN).
+1 KILL ^TMP($JOB)
WRITE !!
SET DIC=161
SET DIC(0)="AEMZ"
SET DIC("S")="I $D(^FBAAI(""AK"",+Y))"
DO ^DIC
KILL DIC
if X=""!($DATA(DTOUT))!($DATA(DUOUT))
GOTO Q
if Y<0
GOTO RDP
SET DFN=+Y
RDV ;Get vendor if an inpatient provider for this patient (FBV).
+1 WRITE !!
SET DIC=161.2
SET DIC(0)="AEMZ"
SET DIC("S")="I $D(^FBAAI(""AK"",DFN,+Y))"
DO ^DIC
KILL DIC
if X=""!($DATA(DTOUT))!($DATA(DUOUT))
GOTO Q
if Y<0
GOTO RDV
SET FBV=+Y
+2 DO EN1
+3 IF FBCTR=0
WRITE !!?12,*7,"Vendor has no",$SELECT($DATA(FBVOID):" VOIDED",1:"")," finalized payments ",$SELECT('$DATA(FBVOID):"to VOID",1:""),!?12,"for this patient under the ",$SELECT(FBTYPE=6:"CIVIL HOSPITAL",1:"COMMUNITY NURSING HOME")," program."
GOTO RDV
+4 WRITE !!,"Which payment item(s) would you like to ",$SELECT($DATA(FBVOID):"Cancel the void on",1:"Void")," ? "
SET DIR(0)="L^1:"_FBCTR
DO ^DIR
if $DATA(DIRUT)
GOTO RDV
SET FBX=Y
WRITE @IOF
DO HED
+5 FOR A=1:1:FBCTR
SET X=$PIECE(FBX,",",A)
if X=""
QUIT
SET FBI=+FBI(X)
SET FBINV=^TMP($JOB,"FBCHVP",FBI)
SET FBVD=$PIECE(FBINV,"^",14)
WRITE !
DO WRT1
SET ^TMP($JOB,"FBCHVP","VOID",FBI)=""
+6 WRITE !
SET DIR(0)="Y"
SET DIR("A")="Are you sure you want to "_$SELECT($DATA(FBVOID):"Cancel the void on",1:"Void")_" the payment(s)"
SET DIR("B")="No"
DO ^DIR
KILL DIR
if $DATA(DIRUT)!'Y
GOTO RDP
+7 SET FBI=0
FOR
SET FBI=$ORDER(^TMP($JOB,"FBCHVP","VOID",FBI))
if FBI'>0
QUIT
DO SETR
DO CONF
WRITE !,?5,".... Done.",!
Q KILL DFN,FBV,FBI,FBTYPE,FBVOID,FBCTR,FBAMTC,FBAMTP,FBBAT,FBDRG,FBFDT,FBINV,FBNUM,FBREIM,FBTDT,FBVD,Q,FBX,VP,^TMP($JOB,"FBCHVP"),Y,DIE,DR,FBVR,DA
+1 QUIT
EN1 ;Find finalized payments that match FBTYPE and store in ^TMP.
+1 SET (FBI,FBCTR)=0
SET Q="-"
SET $PIECE(Q,"-",80)="-"
+2 SET IOP=$SELECT($DATA(ION):ION,1:"HOME")
DO ^%ZIS
KILL IOP
+3 FOR
SET FBI=$ORDER(^FBAAI("AK",DFN,FBV,FBI))
if FBI'>0
QUIT
IF $DATA(^FBAAI(FBI,0))
IF '$DATA(^("FBREJ"))
SET FBINV=^(0)
SET FBVD=$PIECE(FBINV,"^",14)
IF $PIECE(FBINV,"^",16)'=""&($PIECE(FBINV,"^",12)=FBTYPE)&($SELECT($DATA(FBVOID):(FBVD="VP"),1:(FBVD="")))
DO WRT
+4 QUIT
WRT NEW FBX,FBY2,FBY3,FBCDAYS,FBSCID,FBFPPSC,FBFPPSL,FBADJLR,FBRRMKL
+1 SET FBX=$$ADJLRA^FBCHFA(FBI_",")
+2 SET FBY2=$GET(^FBAAI(FBI,2))
+3 SET FBY3=$GET(^FBAAI(FBI,3))
+4 ; covered days
SET FBCDAYS=$PIECE(FBY2,U,10)
+5 ; patient control number
SET FBSCID=$PIECE(FBY2,U,11)
+6 ; fpps claim id
SET FBFPPSC=$PIECE(FBY3,U)
+7 ; fpps line item
SET FBFPPSL=$PIECE(FBY3,U,2)
+8 ; remit remarks
SET FBRRMKL=$$RRL^FBCHFR(FBI_",")
+9 ; adjustment reason
SET FBADJLR=$PIECE(FBX,U)
+10 SET ^TMP($JOB,"FBCHVP",FBI)=FBINV
+11 SET ^TMP($JOB,"FBCHVP",FBI,"FBMR")=FBCDAYS_U_FBADJLR_U_FBRRMKL_U_FBSCID_U_FBFPPSC_U_FBFPPSL
+12 IF FBCTR=0!($Y+5>IOSL)
WRITE @IOF
DO HED
+13 SET FBCTR=FBCTR+1
SET FBI(FBCTR)=FBI
+14 WRITE !,FBCTR_") "
DO WRT1
IF $DATA(FBVOID)&($DATA(^FBAAI(FBI,"R")))
WRITE !?3,"Reason:",!?10,^("R"),!
+15 QUIT
WRT1 NEW FBMRVP
SET FBMRVP=^TMP($JOB,"FBCHVP",FBI,"FBMR")
+1 SET FBREIM=$PIECE(FBINV,"^",13)
SET FBFDT=$PIECE(FBINV,"^",6)
SET FBTDT=$PIECE(FBINV,"^",7)
SET FBDRG=$PIECE(FBINV,"^",24)
SET FBAMTC=$PIECE(FBINV,"^",8)
SET FBAMTP=$PIECE(FBINV,"^",9)
SET FBNUM=+FBINV
SET FBBAT=$PIECE(FBINV,"^",17)
+2 DO FBCKI^FBAACCB1(FBI)
+3 WRITE $SELECT(FBREIM="R":"*",1:""),$SELECT(FBVD="VP":"#",1:""),?3,$$DATX^FBAAUTL(FBFDT),?16,$$DATX^FBAAUTL(FBTDT)
+4 WRITE ?26,$SELECT($GET(FBDRG):$JUSTIFY($$ICD^FBCSV1(FBDRG,$GET(FBFDT)),4),1:""),?35,$JUSTIFY($FNUMBER(FBAMTC,",",2),8),?48,$JUSTIFY($FNUMBER(FBAMTP,",",2),8),?62,$JUSTIFY(FBNUM,5),?72,$JUSTIFY($PIECE($GET(^FBAA(161.7,+FBBAT,0)),"^"),6)
+5 WRITE !,?5,$PIECE(FBMRVP,U),?19,$PIECE(FBMRVP,U,2),?34,$PIECE(FBMRVP,U,3),?54,$PIECE(FBMRVP,U,4)
+6 IF $PIECE(FBMRVP,U,5)]""
WRITE !,?5,"FPPS Claim ID: ",$PIECE(FBMRVP,U,5),?33,"FPPS Line Item: ",$PIECE(FBMRVP,U,6)
+7 NEW A2
SET A2=+FBAMTP
DO PMNT^FBAACCB2
+8 QUIT
HED WRITE !,"Patient Name: ",$PIECE(^DPT(DFN,0),"^"),?50,"Pt.ID ",$$SSN^FBAAUTL(DFN),!!,?2,"VENDOR: ",$PIECE(^FBAAV(FBV,0),"^"),!,?10,"('*' Represents Reimbursement to Patient)",!,?10,"('#' Represents a Voided Payment)"
+1 WRITE !," FROM DATE",?16,"TO DATE",?26,"DRG",?33,"AMT CLAIMED",?48,"AMT PAID",?60,"INVOICE #",?72,"BATCH #"
+2 WRITE !,?5,"COV.DAYS",?19,"ADJ CODE",?34,"REMIT REMARKS",?55,"PATIENT CONTROL #"
+3 WRITE !,Q,!
+4 QUIT
SETR ;Set/delete void node on record.
+1 SET DA=FBI
SET VP=$SELECT($DATA(FBVOID):"",1:"VOID")
+2 IF $DATA(FBVOID)
SET DR="16///@;16.5///@;17///@"
+3 IF '$DATA(FBVOID)
SET DR="16///^S X=VP;17////^S X=DUZ"_$SELECT($DATA(FBVR):";16.5////^S X=FBVR",1:";16.5R;S FBVR=X")
+4 SET DIE="^FBAAI("
SET DIDEL=162.5
DO ^DIE
KILL DIDEL
+5 QUIT
CONF ;Print void/cancel void confirmation.
+1 WRITE !,?10,$SELECT($DATA(FBVOID):"Cancel Voided",1:"Void")," payment for ",$$NAME^FBCHREQ2(DFN),!,*7,"You must adjust control point accordingly through IFCAP!"
+2 QUIT