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

IBCEPTC1.m

Go to the documentation of this file.
  1. IBCEPTC1 ;ALB/TMK - EDI PREV TRANSMITTED CLAIMS REPORT OUTPUT ;01/20/05
  1. ;;2.0;INTEGRATED BILLING;**296,320,547,592**;21-MAR-94;Build 58
  1. ;;Per VA Directive 6402, this routine should not be modified.
  1. ;
  1. RPT(IBSORT,IBDT1,IBDT2) ; Output transmitted claims report
  1. ; global ^TMP("IB_PREV_CLAIM",$J,srt1,srt2,ien of entry file 364)=""
  1. ; IB*2.0*547 Variable IBLOC is pre-defined (in IBCEPTC)
  1. N IBDA,IBIFN,IBPAGE,IBSTOP,IBHDR,IBS1,IBS2,Z,IBZ,IBREP
  1. S (IBPAGE,IBSTOP)=0,IBPAGE(0)="",IBPAGE(1)="",IBREP="R"
  1. ; IB*2.0*547 adds ability for locally printed as well as transmitted claims
  1. S IBHDR=$S(IBLOC:"Printed",1:"Transmitted")_" Claims Report for period covering "_$$FMTE^XLFDT(IBDT1,1)_" thru "_$$FMTE^XLFDT(IBDT2,1)_$J("",14)_$$HTE^XLFDT($H,"1M"),IBHDR=IBHDR_$J("",124-$L(IBHDR))_"Page"
  1. S IBS1="" F S IBS1=$O(^TMP("IB_PREV_CLAIM",$J,IBS1)) Q:IBS1="" D Q:IBSTOP
  1. . ; First level sort
  1. . D:($Y+6)>IOSL!'IBPAGE HDR(IBHDR,IBSORT,.IBPAGE,.IBSTOP) Q:IBSTOP
  1. . S IBPAGE(1)=IBS1,IBPAGE(0)="" ; Hold data for hdr repeated on new pg
  1. . D HDR1(IBSORT,IBS1,.IBPAGE,.IBSTOP) Q:IBSTOP
  1. . ;
  1. . S IBPAGE(0)=1
  1. . S IBS2="" F S IBS2=$O(^TMP("IB_PREV_CLAIM",$J,IBS1,IBS2)) Q:IBS2=""!IBSTOP S IBDA=0 F S IBDA=$O(^TMP("IB_PREV_CLAIM",$J,IBS1,IBS2,IBDA)) Q:'IBDA!IBSTOP D
  1. .. S IBIFN=$S(IBLOC:+IBDA,1:+$G(^IBA(364,+IBDA,0)))
  1. .. ;
  1. .. D:($Y+5)>IOSL!'IBPAGE HDR(IBHDR,IBSORT,.IBPAGE,.IBSTOP) Q:IBSTOP
  1. .. D WRT^IBCEPTC2(IBS1,IBS2,IBDA,IBIFN,IBSORT,IBREP,"",.IBPAGE,.IBSTOP) Q:IBSTOP
  1. . S IBPAGE(0)=""
  1. ;
  1. G:IBSTOP STOP
  1. I 'IBPAGE D WRT^IBCEPTC2("NO PREVIOUSLY "_$S(IBLOC:"PRINTED",1:"TRANSMITTED")_" CLAIMS EXIST TO MATCH THE SEARCH CRITERIA SELECTED","",0,0,IBSORT,IBREP,IBHDR,0,0)
  1. ;
  1. I $E(IOST,1,2)["C-" K DIR S DIR(0)="E" D ^DIR K DIR
  1. ;
  1. STOP I $D(ZTQUEUED) S ZTREQ="@"
  1. I '$D(ZTQUEUED) W ! D ^%ZISC
  1. ;
  1. Q
  1. ;
  1. HDR1(IBSORT,IBDATA,IBPAGE,IBSTOP) ; First level report sort headers
  1. ; IBSORT = sort type
  1. ; IBDATA = data at the 1st sort level
  1. I ($Y+11)>IOSL D HDR(IBHDR,IBSORT,.IBPAGE,.IBSTOP) Q:IBSTOP
  1. N Z,X,Y,Q
  1. I IBSORT=1 D
  1. . S Q=$S(IBLOC:"",1:"Batch Number: ")_$P(IBDATA,U,2)_$S('$P(IBDATA,U,4):"",1:" ** This batch was rejected **")_$S('$P(IBDATA,U,3):"",1:" ** This batch was a test batch **")
  1. . W !!,Q W:$G(IBPAGE(0)) $J("",120-$L(Q)),"(Continued)" W !,"Date Last "_$S(IBLOC:"Printed: ",1:"Transmitted: "),$$FMTE^XLFDT(99999999-IBDATA,1)
  1. . S Z="",$P(Z,"=",133)="" W !,Z
  1. . ;JWS;IB*2.0*592 - move Type column header over 1 char
  1. . W !,"Claim # Form Type Seq Status A/R Current Payer",$J("",13),"Payer Address",$J("",17),"Other Payer(s) Patient Name",!
  1. ;
  1. I IBSORT=2 D
  1. . N IBZ,IBIFN
  1. . S IBIFN=""
  1. . I IBDATA'="" S IBIFN=+$G(^TMP("IB_PREV_CLAIM",$J,IBDATA))
  1. . S Q="Current Payer: "_$P(IBDATA,U)
  1. . D F^IBCEF("N-CURR INS CO FULL ADDRESS","IBZ",,IBIFN)
  1. . S Q=Q_" "_$G(IBZ(1))_$S($G(IBZ(1))'="":",",1:"")_" "_$G(IBZ(4))_$S($G(IBZ(4))'="":",",1:"")_" "_$P($G(^DIC(5,+$G(IBZ(5)),0)),U,2)
  1. . W !!,Q
  1. . I $G(IBPAGE(0)) D
  1. .. I $L(Q)>119 S Q="" W !
  1. .. W $J("",120-$L(Q)),"(Continued)"
  1. . S Z="",$P(Z,"=",133)="" W !,Z
  1. . ;JWS;IB*2.0*592; move Type column header over 1 char
  1. . W !,"Claim # Form Type Seq Status A/R Other Payer(s)",$J("",6),"Patient Name",$J("",10),"Last "_$S(IBLOC:"Printed",1:"Transmit Batch Number"),!
  1. ;
  1. Q
  1. ;
  1. HDR(IBHDR,IBSORT,IBPAGE,IBSTOP) ; Report header
  1. ;
  1. N Z,DIR,X,Y
  1. I IBPAGE D Q:IBSTOP
  1. . I $E(IOST,1,2)["C-" K DIR S DIR(0)="E" D ^DIR K DIR S IBSTOP=('Y) Q:IBSTOP
  1. . W @IOF
  1. S IBPAGE=IBPAGE+1,Z=IBHDR_$J(IBPAGE,4)
  1. W !,Z
  1. W:IBLOC'=1 !,"** A claim may appear on this report multiple times if it has been transmitted more than once. **"
  1. I IBSORT=2,IBLOC'=1 D
  1. . W !,"** T indicates the claim was transmitted as a test claim prior to turning on EDI live for the payer. **"
  1. . W !,"** R indicates that the batch was rejected. **"
  1. I IBPAGE>1,$G(IBPAGE(0)) D HDR1(IBSORT,IBPAGE(1),.IBPAGE,.IBSTOP)
  1. Q
  1. ;