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

FBCHEP.m

Go to the documentation of this file.
  1. FBCHEP ;AISC/DMK - ENTER PAYMENT FOR CONTRACT HOSPITAL ;10/1/2004
  1. ;;3.5;FEE BASIS;**4,61,77,82,122,108,124,135,139,123,154**;JAN 30, 1995;Build 12
  1. ;;Per VA Directive 6402, this routine should not be modified.
  1. S FBAAPTC="V",FBAAOUT=0
  1. RD K FBAAID,FBAAVID S FBRESUB="" D GETVET^FBAAUTL1 G:DFN']"" Q
  1. S FBPROG="I $P(^(0),U,3)=6,($P(^(0),U,9)'[""FB583"")" D GETAUTH^FBAAUTL1 G RD:$D(DUOUT),RD:FTP']""
  1. ;W !!,?25,"< ASSOCIATED 7078 >",!!
  1. ;S DIC="^FB7078(",DA=FB7078,DR="0;1" D EN^DIQ
  1. I FB7078="" W !,*7,"No 7078 on file for this authorization." G RD
  1. S FBI7078=FB7078_";FB7078("
  1. ;
  1. I '$$UOKPAY^FBUTL9(DFN,FTP) D G RD
  1. . W !!,"You cannot process a payment associated with authorization ",DFN,"-",FTP
  1. . W !,"due to separation of duties."
  1. ;
  1. I $D(^FBAAI("E",FBI7078)) S FBAAIN=$O(^FBAAI("E",FBI7078,0)) G OUT
  1. SETINV S FBZ(0)=^FB7078(FB7078,0),FBVET=$P(FBZ(0),"^",3),FBVEN=$P(FBZ(0),"^",2),FBVEN=$P(FBVEN,";",1)
  1. ;
  1. EN583 ;Entry from 583 enter payment
  1. I FBAAPTC="R" D ^FBAACO0
  1. S DA=FBVEN D EN1^FBAAVD
  1. I $P($G(^FBAAV(FBVEN,"ADEL")),U)="Y" W !!,*7,"Vendor is flagged for Austin deletion!" G Q
  1. D SITEP^FBAAUTL G Q:FBPOP
  1. S FBAAMPI=$P(FBSITE("FBNUM"),U,4)
  1. ;
  1. RDV S FBVE="" S:$D(^FBAAV(FBVEN,"AMS")) FBVE=$P(^("AMS"),"^",2) S:$G(FBVE)'="Y" FBVE="N"
  1. I FBVE="Y" W *7,!!,"Vendor is listed as 'exempt from the pricer'." S DIR(0)="Y",DIR("A")="Do you wish to keep this invoice exempt from the pricer",DIR("B")="Yes" D ^DIR K DIR G Q:$D(DIRUT) S FBVE=$S(Y=1:"Y",1:"N")
  1. I $G(FBVE)'="Y",($P($G(^FBAAV(FBVEN,0)),"^",17)']"") W !!,*7,"Medicare ID Number is needed for this Vendor!" S DIE="^FBAAV(",DR=22 D ^DIE K DIE G Q:$D(DTOUT)!('$L(X))
  1. ;
  1. BAT S DIC="^FBAA(161.7,",DIC(0)="AEQMZ",DIC("S")="I $P(^(0),U,3)=""B9""&($P(^(0),U,5)=DUZ)&($P(^(0),U,15)=""Y"")&($G(^(""ST""))=""O"")&(FBAAMPI>$P(^(0),U,10))" W ! D ^DIC K DIC
  1. G Q:X="^"!(X=""),BAT:Y<0 S FBAABE=+Y,FBY(0)=Y(0),Z1=$P(FBY(0),"^",11),BO=$P(FBY(0),"^",2),Z2=$P(FBY(0),"^",10),FBSTN=$P(FBY(0),"^",8),FBCHOB=FBSTN_"-"_$P(FBY(0),"^",2),FBEXMPT=$P(FBY(0),"^",18) S FBAAOUT=0 D CHK I FBAAOUT K Y,Y(0),FBAABE G BAT
  1. I FBI7078["FB7078(",BO'=$P($P(FBZ(0),U),".") W !,*7,"Obligation number on batch does not match 1358.",!,"Obligation number on batch must be ",$P($P(FBZ(0),U),"."),".",! G BAT
  1. S FBINC=$S($P(FBY(0),"^",10)="":0,1:$P(FBY(0),"^",10)),FBLN=$S($P(FBY(0),"^",11)="":0,1:$P(FBY(0),"^",11))
  1. GETNXI D GETNXI^FBAAUTL
  1. W !!,"Invoice # ",FBAAIN," assigned to this Invoice"
  1. RIN S CALLERID="FBCHEP" D GETINDT^FBAACO1 K CALLERID G Q:$G(FBAAOUT)
  1. ;
  1. ; FB*3.5*123 - check for IPAC agreement for Federal vendor and capture DoD invoice number (both req'd if IPAC)
  1. S FBDODINV=""
  1. S FBIA=$$IPAC^FBAAMP($G(FBVEN)) I FBIA=-1 G Q
  1. I FBIA,'$$IPACINV^FBAAMP(.FBDODINV) G Q
  1. ;
  1. ; ask patient control number
  1. S FBCSID=$$ASKPCN^FBUTL5() I FBCSID="^" G Q
  1. ; if U/C then get FPPS Claim ID else ask user
  1. I $D(FB583) S FBFPPSC=$P($G(^FB583(FB583,5)),U) W !,"FPPS CLAIM ID: ",$S(FBFPPSC="":"N/A",1:FBFPPSC)
  1. E S FBFPPSC=$$FPPSC^FBUTL5() I FBFPPSC=-1 G Q
  1. ; Get Unique Claim ID ; FB*3.5*135
  1. S FBUCI135=$$ENTINPAT^FBUTL136($G(FBSTN),1,,"I",$G(FBFPPSC),$G(FBVEN)) I FBUCI135<1 G Q
  1. ; if EDI claim then ask FPPS line item
  1. I FBFPPSC]"" S FBFPPSL=$$FPPSL^FBUTL5(,1) I FBFPPSL=-1 G Q
  1. ; compute default Covered Days
  1. S FBCDAYS=$$FMDIFF^XLFDT(FBAAEDT,FBAABDT)
  1. I FBCDAYS=0 S FBCDAYS=1
  1. S FBAAMM=$S(FBAAPTC="R":"",$D(FB583):"",1:1) D PPT^FBAACO1()
  1. DIC S DIC="^FBAAI(",DIC(0)="LQ",DLAYGO=162.5,X=FBAAIN D ^DIC G Q:Y<0
  1. S DA=+Y,DIE=DIC,DR="[FBCH ENTER PAYMENT]",DIE("NO^")=""
  1. D
  1. . ; JAS - 12/18/13 - PATCH 139 - Modified original code for ICD-10--date of interest must be Auth. To date, if available.
  1. . N ICDVDT S ICDVDT=$G(FBAAEDT)
  1. . I ICDVDT="" S ICDVDT=$G(FBAABDT)
  1. . D ^DIE
  1. . ; End 139
  1. ; file adjustment reasons
  1. D FILEADJ^FBCHFA(DA_",",.FBADJ)
  1. ; file remittance remarks
  1. D FILERR^FBCHFR(DA_",",.FBRRMK)
  1. ; file Line Item Rendering providers
  1. D FILERP^FBUTL8(DA_",",.FBPROV) ;FB*3.5*122
  1. K DIE,DIC,D,DA,DR
  1. S $P(FBY(0),"^",10)=FBINC+1,$P(FBY(0),"^",11)=FBLN+1,$P(FBY(0),"^",18)=FBEXMPT,^FBAA(161.7,FBAABE,0)=FBY(0) ;D:'$D(FBNOPTF) PTF G Q:$D(FB583),RD
  1. D
  1. . N FBX
  1. . S FBX=FBAAMPI-(FBINC+1)
  1. . I FBX<6 W !,$C(7),"Warning, you can only enter ",FBX," more invoices in this batch!",!
  1. D:'$D(FBNOPTF) PTF
  1. G Q:$D(FB583),RD
  1. OUT W !!,*7,?3,"Invoice number ",FBAAIN," has already been entered for this authorization.",!,?3,"Use the Contract Hospital 'Invoice Edit' option if needed.",!
  1. ;check if user wants to add a second invoice for this 7078
  1. W ! S DIR("A")="Want to add another invoice for this episode of care",DIR("B")="No",DIR(0)="Y" D ^DIR K DIR I Y S (FBNOPTF,FBRESUB)=1 G SETINV
  1. Q K BO,CNT,D,DA,DAT,DIC,DIE,DLAYGO,DR,FB7078,FBAABDT,FBAABE,FBAAEDT,FBAAID,FBAAIN,FBAAOUT,FBAAPTC,FBDX,FBTT,FBTYPE,FBVEN,FBVET,FBXX,FTP,I,J,FBK,PI,FBPOP,PTYPE,S,FBZ,Z1,FBI,FBPROG,FBRR,FBSW,FBPOV,FBPT,FBY,T,Y,Z1,Z2,ZZ,FBPSA,A,FBI7078
  1. K FBCHOB,FBAUT,FBSEQ,X,FBSITE,F,FBSTN,FBASSOC,FBLOC,DUOUT,PSA,FBCOUNTY,DFN,FBNOPTF,DIRUT,FBVE,FBAAOUT,FBEXMPT,FBAAPN,FBAMTC,FBDEL,FBINC,FBLN,FBRESUB
  1. K FBD1,FBFDC,FBMST,FBTTYPE,FB583,FBUCI135
  1. K FBCSID,FBFPPSC,FBFPPSL,FBCDAYS,FBAMTP,FBADJ,FBRRMK,FBAAMPI,FBV,FBIA,FBDODINV
  1. D GETAUTHK^FBAAUTL1
  1. Q
  1. PTF I $G(FBVET),$G(FBI7078)["FB583" S:'$G(DFN) DFN=FBVET D PTFC^FBUTL6(DFN,$P(FBZ(0),"^",4))
  1. Q
  1. PRBT ;Entry point for patient reimbursement option
  1. ;
  1. S FBAAPTC="R"
  1. G RD
  1. CHK ;Check for vendor and batch being exempt from pricer
  1. I $G(FBVE)'="Y"&($G(FBVE)'="N") S FBVE="N"
  1. I $G(FBEXMPT)="Y" Q:FBVE="Y" G OPEN:FBVE="N"
  1. I $G(FBEXMPT)="N" Q:FBVE="N" G OPEN:FBVE="Y"
  1. I '$G(FBEXMPT)&($G(Z2)'>0) S FBEXMPT=FBVE Q
  1. I '$G(FBEXMPT)&($G(Z2)>0) S $P(^FBAA(161.7,FBAABE,0),"^",18)="N",FBEXMPT="N" G CHK
  1. Q
  1. OPEN W *7,!!,"This Invoice may not be added to Batch # ",+FBY(0),".",!,"***You may not add a ",$S(FBVE="Y":"pricer exempt",1:"non-exempt")," invoice to a ",$S(FBVE="Y":"non-exempt",1:"pricer exempt")," batch.***"
  1. S DIR(0)="Y",DIR("A")="Do you want to open a new batch at this time",DIR("B")="Y" D ^DIR K DIR S:$D(DIRUT)!('Y) FBAAOUT=1 Q:FBAAOUT D RCHOP^FBAAOB S FBEXMPT=FBVE D
  1. .S FBY(0)=$G(^FBAA(161.7,FBAABE,0)),Z1=$P(FBY(0),"^",11),BO=$P(FBY(0),"^",2),Z2=$P(FBY(0),"^",10),FBSTN=$P(FBY(0),"^",8),FBCHOB=FBSTN_"-"_$P(FBY(0),"^",2)
  1. Q