IBARXMR ;LL/ELZ - PHARMCAY COPAY CAP RPC STUFF ;17-NOV-2000
;;2.0;INTEGRATED BILLING;**150,158,156,308**;21-MAR-94
;;Per VHA Directive 10-93-142, this routine should not be modified.
;
RQUERY(IBR,IBICN,IBM) ; remote query call
; called from rpc IBARXM QUERY ONLY
N DFN
S DFN=$$DFN^IBARXMU(IBICN) I 'DFN S IBY(0)=0 Q
D QUERY(.IBR,DFN,IBM)
S IBR=$NA(IBY)
Q
;
QUERY(IBR,DFN,IBM) ; call for querying data
; IBR = where results are returned
; IBM = month/year for query
N IBX,IBZ,IBS,IBC
K IBR
;
S IBS=+$P($$SITE^IBARXMU,"^",3)
S (IBX,IBC)=0 F S IBX=$O(^IBAM(354.71,"AD",DFN,IBM,IBX)) Q:IBX<1 D
. S IBZ=^IBAM(354.71,IBX,0) Q:(+IBZ)'=IBS
. S IBC=IBC+1
. D SENDF^IBARXMU(.IBZ)
. S IBR(IBC)=IBZ
S IBR(0)=IBC
Q
;
TRANS(IBR,IBICN,IBD) ; remote procedure call for receiving transaction data (new or updated)
; called from rpc IBARXM TRANS DATA
; IBICN = the patient's ICN
; IBR = return acceptance response
; IBD = data being received on a transaction
N DFN,IBA
S DFN=$$DFN^IBARXMU(IBICN)
S IBR=$S(DFN>0:$$ADD^IBARXMN(DFN,IBD),1:0)
Q
;
BILL(IBR,IBICN,IBT,IBB) ; remote procedure call to indicate a bill should be
; billed after all, this occurs when a copay bill was cancelled and
; the patient had previously reached his cap and the bill indicated was
; not billed.
; called from rpc IBARXM TRANS BILL
; IBR = return acceptance response
; IBICN = patient's icn
; IBT = 354.71 transaction number to bill
; IBB = amount to bill
N DFN
S DFN=$$DFN^IBARXMU(IBICN) I 'DFN S IBR="-1^Patient not found" Q
;
; if PFSS/IDX transaction call VDEF and quit
I $$SWSTAT^IBBAPI,$P($G(^IBAM(354.71,+^IBAM(354.71,"B",IBT,0),0)),"^",20) S IBR=$$QUEUE^VDEFQM("DFT^P03","SUBTYPE=CPBL^IEN="_IBT_":"_IBB,,"PFSS OUTBOUND") Q
;
D BILL^IBARXMB(IBT,IBB)
S IBR=1
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HIBARXMR 1834 printed Oct 16, 2024@18:08:20 Page 2
IBARXMR ;LL/ELZ - PHARMCAY COPAY CAP RPC STUFF ;17-NOV-2000
+1 ;;2.0;INTEGRATED BILLING;**150,158,156,308**;21-MAR-94
+2 ;;Per VHA Directive 10-93-142, this routine should not be modified.
+3 ;
RQUERY(IBR,IBICN,IBM) ; remote query call
+1 ; called from rpc IBARXM QUERY ONLY
+2 NEW DFN
+3 SET DFN=$$DFN^IBARXMU(IBICN)
IF 'DFN
SET IBY(0)=0
QUIT
+4 DO QUERY(.IBR,DFN,IBM)
+5 SET IBR=$NAME(IBY)
+6 QUIT
+7 ;
QUERY(IBR,DFN,IBM) ; call for querying data
+1 ; IBR = where results are returned
+2 ; IBM = month/year for query
+3 NEW IBX,IBZ,IBS,IBC
+4 KILL IBR
+5 ;
+6 SET IBS=+$PIECE($$SITE^IBARXMU,"^",3)
+7 SET (IBX,IBC)=0
FOR
SET IBX=$ORDER(^IBAM(354.71,"AD",DFN,IBM,IBX))
if IBX<1
QUIT
Begin DoDot:1
+8 SET IBZ=^IBAM(354.71,IBX,0)
if (+IBZ)'=IBS
QUIT
+9 SET IBC=IBC+1
+10 DO SENDF^IBARXMU(.IBZ)
+11 SET IBR(IBC)=IBZ
End DoDot:1
+12 SET IBR(0)=IBC
+13 QUIT
+14 ;
TRANS(IBR,IBICN,IBD) ; remote procedure call for receiving transaction data (new or updated)
+1 ; called from rpc IBARXM TRANS DATA
+2 ; IBICN = the patient's ICN
+3 ; IBR = return acceptance response
+4 ; IBD = data being received on a transaction
+5 NEW DFN,IBA
+6 SET DFN=$$DFN^IBARXMU(IBICN)
+7 SET IBR=$SELECT(DFN>0:$$ADD^IBARXMN(DFN,IBD),1:0)
+8 QUIT
+9 ;
BILL(IBR,IBICN,IBT,IBB) ; remote procedure call to indicate a bill should be
+1 ; billed after all, this occurs when a copay bill was cancelled and
+2 ; the patient had previously reached his cap and the bill indicated was
+3 ; not billed.
+4 ; called from rpc IBARXM TRANS BILL
+5 ; IBR = return acceptance response
+6 ; IBICN = patient's icn
+7 ; IBT = 354.71 transaction number to bill
+8 ; IBB = amount to bill
+9 NEW DFN
+10 SET DFN=$$DFN^IBARXMU(IBICN)
IF 'DFN
SET IBR="-1^Patient not found"
QUIT
+11 ;
+12 ; if PFSS/IDX transaction call VDEF and quit
+13 IF $$SWSTAT^IBBAPI
IF $PIECE($GET(^IBAM(354.71,+^IBAM(354.71,"B",IBT,0),0)),"^",20)
SET IBR=$$QUEUE^VDEFQM("DFT^P03","SUBTYPE=CPBL^IEN="_IBT_":"_IBB,,"PFSS OUTBOUND")
QUIT
+14 ;
+15 DO BILL^IBARXMB(IBT,IBB)
+16 SET IBR=1
+17 QUIT