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

BPSSCR05.m

Go to the documentation of this file.
  1. BPSSCR05 ;BHAM ISC/BNT - ECME USR SCREEN UTILITIES ;05-APR-05
  1. ;;1.0;E CLAIMS MGMT ENGINE;**7,23**;JUN 2004;Build 44
  1. ;;Per VA Directive 6402, this routine should not be modified.
  1. Q
  1. ;Filter Eligibility of Veteran, Tricare, or ChampVA (ChampVA is reserved for future use)
  1. ;input:
  1. ;BP59 - ptr to #59
  1. ;BPARR - array with user's preferences
  1. ;returns :
  1. ;1 -okay, leave in the list
  1. ;0 -not okay, exclude from the list
  1. FLTELIG(BP59,BPARR) ;
  1. Q:$G(BPARR(2.01))="A" 1
  1. I $G(BPARR(2.01))="" S BPARR(2.01)="V"
  1. I $G(BPARR(2.01))[$$ELIGCODE(BP59) Q 1
  1. Q 0
  1. ;Filter Submission Type of Billing Requests or Reversals
  1. ;input:
  1. ;BP59 - ptr to #59
  1. ;BPARR - array with user's preferences
  1. ;returns :
  1. ;1 -okay, leave in the list
  1. ;0 -not okay, exclude from the list
  1. FLTSUBTP(BP59,BPARR) ;
  1. N BPSCLM,BPTRCD
  1. Q:$G(BPARR(2.03))="A" 1
  1. Q:$G(BPARR(2.03))="" 1
  1. ; Get the claim IEN
  1. S BPSCLM=$S($P($G(^BPST(BP59,4)),U)>0:$P($G(^BPST(BP59,4)),U),1:$P($G(^BPST(BP59,0)),U,4))
  1. Q:BPSCLM="" 0
  1. ; Get the Transaction Code from BPS CLAIMS
  1. S BPTRCD=$$TRNSCODE(BPSCLM)
  1. Q:BPTRCD="" 0
  1. ; Transaction Code B1 = Billing Request, B2 = Reversal
  1. Q $S((BPTRCD="B1")&($G(BPARR(2.03))="B"):1,(BPTRCD="B2")&($G(BPARR(2.03))="R"):1,1:0)
  1. ;
  1. ;Filter Insurance companies
  1. ;input:
  1. ;BP59 - ptr to #59
  1. ;BPARR - array with user's preferences
  1. ;returns :
  1. ;1 -okay, leave in the list
  1. ;0 -not okay, exclude from the list
  1. FLTINS(BP59,BPARR) ;
  1. Q:$G(BPARR(1.11))="A" 1
  1. Q:$G(BPARR(2.04))="" 1
  1. N BPINS,BPJ,BPINSIEN,I
  1. S BPINSIEN=$P($G(^BPST(BP59,10,+$G(^BPST(BP59,9)),0)),U)
  1. S BPINS=0
  1. F I=2:1 S BPJ=$P(BPARR(2.04),";",I) Q:BPJ="" D Q:BPINS
  1. . S BPINS=$S($$INSPL^IBNCPDPI(BPINSIEN)=BPJ:1,1:0)
  1. Q BPINS
  1. ;
  1. ;/**
  1. ;Returns the Eligibility Code for the entry in file 59
  1. ;input:
  1. ;BP59 - ptr to file 59
  1. ;returns:
  1. ;V=Veteran, T=Tricare, C=ChampVA, or null
  1. ELIGCODE(BP59) ; **/
  1. Q $P($G(^BPST(BP59,9)),U,4)
  1. ;
  1. ;Returns the Transaction Code for a claim
  1. ;input:
  1. ;BP02 - ptr to BPS CLAIMS file
  1. ;returns:
  1. ;Internal value of TRANSACTION CODE field
  1. ;B1 = Billing, B2 = Reversal, B3 = Rebill, etc.
  1. TRNSCODE(BP02) ;
  1. Q $P($G(^BPSC(BP02,100)),U,3)
  1. ;
  1. ;MKNEWARR is called by CLOSE^BPSSCRCL to create an array
  1. ;of BP59 records for use by the Close Claims option.
  1. ;
  1. MKNEWARR(BPARR,BPNEWARR,BPINSARR) ;
  1. N BP59,BPREJ,BPREJCNT,BPRELCNT,BPREL,BPINS,BPCLST,BPDFN
  1. S BPREJCNT=0,BPRELCNT=0
  1. S BPINS=0
  1. S BP59="" F S BP59=$O(BPARR(BP59)) Q:BP59="" D
  1. . S BPREJ=0
  1. . S BPDFN=+$P($G(^BPST(BP59,0)),U,6)
  1. . S BPCLST=$$CLAIMST^BPSSCRU3(BP59)
  1. . S BPREJ=$S($P(BPCLST,U)="E REJECTED":1,$P(BPCLST,U)="E REVERSAL ACCEPTED":1,1:0)
  1. . S:BPREJ BPREJCNT=BPREJCNT+1
  1. . S BPREL=$S($$RXAPI1^BPSUTIL1(+$P($$RXREF^BPSSCRU2(BP59),U),106,"I"):1,1:0)
  1. . S:BPREL BPRELCNT=BPRELCNT+1
  1. . S BPNEWARR(BPDFN,BP59)=BPARR(BP59)_U_BPREJ_U_BPREL
  1. . S BPINS=$P($$GETINSUR^BPSSCRU2(BP59),U,2)
  1. . I BPREJ=1,$L(BPINS)>0 S BPINSARR(BPDFN,BPINS,BP59)=BPARR(BP59)
  1. Q BPREJCNT_U_BPRELCNT
  1. ;