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

IBJTU3.m

Go to the documentation of this file.
  1. IBJTU3 ;ALB/ARH - TPI UTILITIES - INS ADDRESS ; 2/14/95
  1. ;;2.0;INTEGRATED BILLING;**39,80,592**;21-MAR-94;Build 58
  1. ;;Per VA Directive 6402, this routine should not be modified.
  1. ;
  1. BADD(IBIFN) ; returns mailing address for bill
  1. ; returns: COMPANY NAME ^ PHONE NUMBER ^ STR 1 ^ STR 2 ^ STR 3 ^ CITY ^ STATE ^ ZIP ^ ^ FAX #
  1. N DFN,IBX,IBCNS,IBCDFN,IBTYP
  1. ;
  1. S IBX="",DFN=$G(^DGCR(399,+$G(IBIFN),0))
  1. S IBTYP=$P(DFN,U,5),DFN=+$P(DFN,U,2) I 'DFN G BADDQ
  1. S IBCNS=$G(^DGCR(399,+IBIFN,"MP")) I 'IBCNS G BADDQ
  1. S IBCDFN=$P(IBCNS,U,2) I +IBCDFN S IBCNS=+$G(^DPT(DFN,.312,+IBCDFN,0))
  1. ;
  1. ; -- if send to employer and state defined, return employer address
  1. I +IBCDFN S IBCDFN=$G(^DPT(DFN,.312,+IBCDFN,2)) I +IBCDFN,+$P(IBCDFN,U,6) D G BADDQ
  1. . S IBX=$P(IBCDFN,U,9)_U_$P(IBCDFN,U,8)_U_$P(IBCDFN,U,2,7)
  1. ;
  1. S IBTYP=$S(IBTYP<3:"INP",1:"OPT")
  1. S IBX=$$INSADD(+IBCNS,IBTYP)
  1. ;
  1. BADDQ Q IBX
  1. ;
  1. ;
  1. INSADD(IBCNS,IBATYP) ; returns specific type of address/phone # for an insurance company, follows ptrs to company responsible
  1. ; returns: COMPANY NAME ^ PHONE NUMBER ^ STR 1 ^ STR 2 ^ STR 3 ^ CITY ^ STATE ^ ZIP ^ ^ FAX #
  1. ; if type does not have an address or phone number then main mailing addr/ph # is returned
  1. ;
  1. N IBD0,IBD13,IBADD,IBNM,IBPH,IBDN,IBCNT,IBAGAIN
  1. S (IBADD,IBNM,IBPH)=""
  1. ;
  1. MAIN ; -- determine address for company for type bill
  1. ;
  1. S IBD0=$G(^DIC(36,+$G(IBCNS),0)) I IBD0="" G MAINQ
  1. S IBD13=$G(^DIC(36,IBCNS,.13))
  1. ;
  1. ; -- get name, main address, phone number
  1. S IBNM=$P(IBD0,U,1),IBPH=$P(IBD13,U,1),IBADD=$G(^DIC(36,+IBCNS,.11))
  1. ;
  1. ; -- if process the same co. more than once you are in an infinate loop
  1. I $D(IBCNT(IBCNS)) G MAINQ ;already processed this company use main add
  1. S IBCNT(IBCNS)=""
  1. ;
  1. ; -- type of bill
  1. I $G(IBATYP)'="",$T(@IBATYP)'="" D @IBATYP I $D(IBAGAIN) K IBAGAIN G MAIN
  1. ;
  1. ; -- return address
  1. MAINQ S IBNM=IBNM_U_IBPH_U_IBADD
  1. Q IBNM
  1. ;
  1. VER ; -- verification phone number
  1. I $P(IBD13,U,4)'="" S IBPH=$P(IBD13,U,4)
  1. Q
  1. ;
  1. BILL ; -- billing phone number
  1. I $P(IBD13,U,2)'="" S IBPH=$P(IBD13,U,2)
  1. Q
  1. ;
  1. PCERT ; -- precertification phone number
  1. I $P(IBD13,U,3)'="" S IBPH=$P(IBD13,U,3)
  1. ;
  1. ; -- if other company processes precerts start again
  1. I $P(IBD13,"^",9) S IBCNS=$P(IBD13,"^",9) S IBAGAIN=1
  1. Q
  1. ;
  1. INP ; -- inpatient phone number
  1. I $P(IBD13,U,5)'="" S IBPH=$P(IBD13,U,5)
  1. ;
  1. ; -- see if there is an inpatient address, use if state is there
  1. S IBDN=$G(^DIC(36,+IBCNS,.12)) I $P(IBDN,"^",5) S IBADD=IBDN
  1. ;
  1. ; -- if other company processes claims start again
  1. I $P(IBDN,"^",7) S IBCNS=$P(IBDN,"^",7) S IBAGAIN=1
  1. Q
  1. ;
  1. OPT ; -- outpatient phone number
  1. ;JWS;IB*2.0*592;Dental Insurance mailing address
  1. ;IA# 5292
  1. I $$FT^IBCEF(IBIFN)=7 D Q
  1. . I $P($G(^DIC(36,+IBCNS,.19)),"^",11)'="" S IBPH=$P(^(.19),"^",11)
  1. . I $P($G(^DIC(36,+IBCNS,.19)),"^",5) S IBADD=$P(^(.19),"^",1,6)
  1. . I $P($G(^DIC(36,+IBCNS,.19)),"^",7) S IBCNS=$P(^(.19),"^",7) S IBAGAIN=1
  1. I $P(IBD13,U,6)'="" S IBPH=$P(IBD13,U,6)
  1. ;
  1. ; -- see if there is an outpatient address, use if state is there
  1. S IBDN=$G(^DIC(36,+IBCNS,.16)) I $P(IBDN,"^",5) S IBADD=IBDN
  1. ;
  1. ; -- if other company processes claims start again
  1. I $P(IBDN,"^",7) S IBCNS=$P(IBDN,"^",7) S IBAGAIN=1
  1. Q
  1. ;
  1. RX ; -- prescription phone number
  1. I $P(IBD13,U,11)'="" S IBPH=$P(IBD13,U,11)
  1. ;
  1. ; -- see if there is an prescription address, use if state is there
  1. S IBDN=$G(^DIC(36,+IBCNS,.18)) I $P(IBDN,"^",5) S IBADD=IBDN
  1. ;
  1. ; -- if other company processes claims start again
  1. I $P(IBDN,"^",7) S IBCNS=$P(IBDN,"^",7) S IBAGAIN=1
  1. Q
  1. ;
  1. APL ; -- appeals phone number
  1. I $P(IBD13,U,7)'="" S IBPH=$P(IBD13,U,7)
  1. ;
  1. ; -- see if there is an appeals address, use if state is there
  1. S IBDN=$G(^DIC(36,+IBCNS,.14)) I $P(IBDN,"^",5) S IBADD=IBDN
  1. ;
  1. ; -- if other company processes claims start again
  1. I $P(IBDN,"^",7) S IBCNS=$P(IBDN,"^",7) S IBAGAIN=1
  1. Q
  1. ;
  1. INQ ; -- inquiry phone number
  1. I $P(IBD13,U,8)'="" S IBPH=$P(IBD13,U,8)
  1. ;
  1. ; -- see if there is an outpatient address, use if state is there
  1. S IBDN=$G(^DIC(36,+IBCNS,.15)) I $P(IBDN,"^",5) S IBADD=IBDN
  1. ;
  1. ; -- if other company processes claims start again
  1. I $P(IBDN,"^",7) S IBCNS=$P(IBDN,"^",7) S IBAGAIN=1
  1. Q