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

BAR50P8A.m

Go to the documentation of this file.
BAR50P8A ; IHS/SD/LSL - POST HIPAA CLAIMS ; 12/01/2008
 ;;1.8;IHS ACCOUNTS RECEIVABLE;**20,21,24**;OCT 26,2005;Build 69
 ; split from BAR50P08
 ; IHS/SD/POT HEAT148388 1/10/2014 ACCEPT REVERSALS FOR TYPE= 1 IF NEG PAYMENT BAR*1.8*24
 Q
PAY ;EP  ;PULL CLAIM INFO AND POST PYMT (IF ANY)
 K BARCR,CLM,DR
 K BARREV,BARSCHED  ;BAR*1.8*4 SCR56,SCR58
 K BARTO,BARFROM  ;TPF BAR*1.8*6 SCR119
 ;D ENP^XBDIQ1(90056.0205,"IMPDA,CLMDA",".01;.05;1.01;.02;.04","CLM(")
 ;D ENP^XBDIQ1(90056.0205,"IMPDA,CLMDA",".01;.05;1.01;.02;.04;.11;.12;301","CLM(")  ;BAR*1.8*4 SCR56,SCR58
 D ENP^XBDIQ1(90056.0205,"IMPDA,CLMDA",".01;.05;1.01;.02;.04;.11;.12;301;501;601;602","CLM(")  ;BAR*1.8*5 INCLUDE 'POST THIS CLAIM AS TYPE' FIELD
 ;start old bar*1.8*20 REQ6
 ;W !!,"Claim: ",CLM(.01)," <> ",CLM(1.01)
 ;W !?5,"Billed: ",CLM(.05),?25,"Payment: ",CLM(.04)
 ;end new bar*1.8*20 REQ6
 ;BAR*1.8*4 SCR56,SCR58
 S CLM(.12)=$P($G(^BAREDI("I",DUZ(2),IMPDA,30,CLMDA,0)),U,12)  ;REVERSAL DATE FORM CLAIMS SUBFILE
 I $G(CLM(301))="" S CLM(301)=$P($G(^BAREDI("I",DUZ(2),IMPDA,30,CLMDA,3)),U)  ;SCHEDULE #/IPAC FROM CLAIMS SUBFILE
 ;I +$G(CLM(.11))=22 D  ;IF E-CLAIM STATUS CODE = REVERSAL old code
 I $$ISREV(CLMDA,IMPDA) D  ;new code HEAT148388
 .S Y=CLM(.12) X ^DD("DD")
 .W !?5,"Reversal Date: ",Y
 .W !?5,"Treasury Deposit Number/IPAC: ",CLM(301)
 .S BARREV=CLM(.12)
 .S BARSCHED=CLM(301)
 ;END BAR*1.8*4
 Q:CLM(.04)=0  ;IF E-PYMT 0 DON'T POST
 S BARCR=CLM(.04)
 S BARTRAN=40
 ;BAR*1.8*5 TPF 6/17/2008
 I CLM(501)'="" D
 .S BARTRAN=$P($G(^BAREDI("I",DUZ(2),IMPDA,30,CLMDA,5)),U)  ;CLM(501) GIVES EXTERNAL VALUE
 I CLM(601)'="" D
  S BARTO=$P($G(^BAREDI("I",DUZ(2),IMPDA,30,CLMDA,6)),U)
 I CLM(602)'="" D
 .S BARFROM=$P($G(^BAREDI("I",DUZ(2),IMPDA,30,CLMDA,6)),U,2)
 ;END
 S DR="2////^S X=BARCR"  ;Credit ($)
 S DR=DR_";14////^S X=$G(BARCOL)"  ;IEN to A/R COLLECTION BATCH
 S DR=DR_";15////^S X=$G(BARITM)"  ;IEN to ITEM mult in A/R COL
 ;BAR*1.8*4 SCR56,SCR58
 I $G(BARREV) D
 .S DR=DR_";110////^S X=$G(BARREV)"
 .S DR=DR_";111////^S X=$G(BARSCHED)"
 ;END BAR*1.8*4
 D DR^BAR50P08
 S BARDR=DR
 K DR
 D POSTRAN^BAR50P08
 Q
 ; ******************
ADJMULT ;EP  ;POST ADJUSTMENTS
 K BARTO,BARFROM  ;TPF BAR*1.8*6 SCR119
 K ADJ,DR,BARDR
 ;D ENPM^XBDIQ1(90056.0208,"IMPDA,CLMDA,0",".02;.04;.05","ADJ(","I")
 D ENPM^XBDIQ1(90056.0208,"IMPDA,CLMDA,0",".02;.03;.04;.05","ADJ(","I")  ;BAR*1.8*1 SRS ADDENDUM
 Q:'$D(ADJ)
 S BARTRAN=43
 S DR="2////^S X=BARCR"  ;Credit $$
 S DR=DR_";102////^S X=BARCAT"
 S DR=DR_";103////^S X=BARREA"
 S DR=DR_";109////^S X=BARSTREA"  ;BAR*1.8*1 SRS ADDENDUM STND REASON
 I +$G(BARCOL)>0 S DR=DR_";14////^S X=$G(BARCOL)" ;Collct btch if know ;bar*1.8*19*ADD*TMM
 I +$G(BARITM)>0 S DR=DR_";15////^S X=$G(BARITM)" ;Item if known ;bar*1.8*19*ADD*TMM
 D DR^BAR50P08
 S BARDR=DR
 K DR
 S ADJDA=0
 F  S ADJDA=$O(ADJ(ADJDA)) Q:ADJDA'>0  D
 .S BARCR=ADJ(ADJDA,.02,"I")
 .S BARSTREA=ADJ(ADJDA,.03,"I")  ;BAR*1.8*1 SRS ADDENDUM GRAB STANDARD CLAIM ADJ REASON
 .S BARCAT=ADJ(ADJDA,.04,"I")
 .S BARREA=ADJ(ADJDA,.05,"I")
 .D POSTRAN^BAR50P08
 .K ADJP
 .;D ENP^XBDIQ1(90056.0208,"IMPDA,CLMDA,ADJDA",".02;.04;.05","ADJP(")
 .D ENP^XBDIQ1(90056.0208,"IMPDA,CLMDA,ADJDA",".02;.03;.04;.05","ADJP(")  ;BAR*1.8*1 SRS ADDENDUM
 .;start old bar*1.8*20 REQ6
 .;W !?5,"ADJ: ",ADJP(.02),?25,ADJP(.04),?45,ADJP(.05)
 .;W !?5,"STND REAS: ",ADJP(.03)  ;BAR*1.8*1 SRS ADDENDUM
 .;end old start new REQ6
 .W !?7,"ADJ: ",ADJP(.02),?25,ADJP(.04),?45,ADJP(.05)
 .W !?7,"STND REAS: ",ADJP(.03)
 .;end new REQ6
 Q
RMKCD ;  POST REMARK CODES
 K BARTO,BARFROM    ;TPF BAR*1.8*6 SCR119
 K RMK,DR,BARDR
 D ENPM^XBDIQ1(90056.0211,"IMPDA,CLMDA,0",".03","RMK(","I")
 Q:'$D(RMK)
 S BARTRAN=505
 S DR=""
 D DR^BAR50P08
 S DR=$E(DR,2,9999)  ;Strip leading ";"
 I +$G(BARCOL)>0 S DR=DR_";14////^S X=$G(BARCOL)"  ;Collct btch if know
 I +$G(BARITM)>0 S DR=DR_";15////^S X=$G(BARITM)"  ;Item if known
 S DR=DR_";107////^S X=BARMKCD"  ;Remark Code ptr
 S BARDR=DR
 K DR
 S RMKDA=0
 F  S RMKDA=$O(RMK(RMKDA)) Q:'+RMKDA  D
 .S BARMKCD=RMK(RMKDA,.03,"I")
 .Q:BARMKCD=""
 .D POSTRAN^BAR50P08
 .K RMKP
 .D ENP^XBDIQ1(90056.0211,"IMPDA,CLMDA,RMKDA",".02;.03","RMKP(")
 .;W !?5,"REMARK CODE: ",RMKP(.03),?25,$E($P(RMKP(.02)," ",3,99),1,50)  ;bar*1.8*20 REQ6
 .W !?7,"REMARK CODE: ",RMKP(.03),?25,$E($P(RMKP(.02)," ",3,99),1,50)  ;bar*1.8*20 REQ6
 Q
ISREV(CLMDA,IMPDA) ;P.OTT 1/10/2014 HEAT148388 BAR*1.8*24
 I +$$GET1^DIQ(90056.0205,CLMDA_","_IMPDA_",",.11)=22 Q 1
 Q 0
 ;----------------