PRCAAPI ;ALB-SBW - API for ASCD Project ;26/Mar/2007
;;4.5;Accounts Receivable;**250**;Mar 20, 1995;Build 2
;;Per VHA Directive 2004-038, this routine should not be modified.
GETDATA(BILL) ;Get AR Data
;Input:
; Bill Number
;Output:
;
; Original Amount (430;3) ^ Date Account Activated (430;60) ^
; Total Paid Principle (430;77) ^ Date Entered (433;19)
N OUT,BXREF,BILLIEN,IENS,PAYDATE,BILLOUT
S OUT=""
Q:$G(BILL)="" OUT
;Determine which cross reference to use.
; "B" xref contains Site-Bill Number
; "D" XREF contains Bill Number without the Station Number.
S BXREF=$S(BILL["-":"B",1:"D")
S BILLIEN=$O(^PRCA(430,BXREF,BILL,0))
Q:BILLIEN'>0 OUT
;
S IENS=BILLIEN_","
;Get file 430 values
D GETS^DIQ(430,IENS,"3;60;77","I","BILLOUT")
;Get file 433 values
S PAYDATE=$$DFP^RCXVUTIL(BILLIEN)
;
;Put data in OUT variable
S:$G(BILLOUT(430,IENS,3,"I"))]"" $P(OUT,U,1)=BILLOUT(430,IENS,3,"I")
S:$G(BILLOUT(430,IENS,60,"I"))]"" $P(OUT,U,2)=BILLOUT(430,IENS,60,"I")
S:$G(BILLOUT(430,IENS,77,"I"))]"" $P(OUT,U,3)=BILLOUT(430,IENS,77,"I")
S:PAYDATE]"" $P(OUT,U,4)=PAYDATE
Q OUT
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPRCAAPI 1139 printed Dec 13, 2024@01:38:53 Page 2
PRCAAPI ;ALB-SBW - API for ASCD Project ;26/Mar/2007
+1 ;;4.5;Accounts Receivable;**250**;Mar 20, 1995;Build 2
+2 ;;Per VHA Directive 2004-038, this routine should not be modified.
GETDATA(BILL) ;Get AR Data
+1 ;Input:
+2 ; Bill Number
+3 ;Output:
+4 ;
+5 ; Original Amount (430;3) ^ Date Account Activated (430;60) ^
+6 ; Total Paid Principle (430;77) ^ Date Entered (433;19)
+7 NEW OUT,BXREF,BILLIEN,IENS,PAYDATE,BILLOUT
+8 SET OUT=""
+9 if $GET(BILL)=""
QUIT OUT
+10 ;Determine which cross reference to use.
+11 ; "B" xref contains Site-Bill Number
+12 ; "D" XREF contains Bill Number without the Station Number.
+13 SET BXREF=$SELECT(BILL["-":"B",1:"D")
+14 SET BILLIEN=$ORDER(^PRCA(430,BXREF,BILL,0))
+15 if BILLIEN'>0
QUIT OUT
+16 ;
+17 SET IENS=BILLIEN_","
+18 ;Get file 430 values
+19 DO GETS^DIQ(430,IENS,"3;60;77","I","BILLOUT")
+20 ;Get file 433 values
+21 SET PAYDATE=$$DFP^RCXVUTIL(BILLIEN)
+22 ;
+23 ;Put data in OUT variable
+24 if $GET(BILLOUT(430,IENS,3,"I"))]""
SET $PIECE(OUT,U,1)=BILLOUT(430,IENS,3,"I")
+25 if $GET(BILLOUT(430,IENS,60,"I"))]""
SET $PIECE(OUT,U,2)=BILLOUT(430,IENS,60,"I")
+26 if $GET(BILLOUT(430,IENS,77,"I"))]""
SET $PIECE(OUT,U,3)=BILLOUT(430,IENS,77,"I")
+27 if PAYDATE]""
SET $PIECE(OUT,U,4)=PAYDATE
+28 QUIT OUT