BARPSTU ; IHS/SD/LSL - PAYMENT TRANSACTION EXECUTION ; 06/09/2008
;;1.8;IHS ACCOUNTS RECEIVABLE;**3,4,6,21,23**;OCT 26, 2005
;** posting utilities
;
; IHS/SD/LSL - 09/23/02 - V1.6 Patch 3 - HIPAA
; Don't update files if Adjustment Category is PENDING or
; GENERAL INFORMATION
;
; IHS/SD/LSL - 10/17/02 - V1.7 - QAA-1200-130051
; Provide Q conditions if failed getting a new A/R transaction
;
; ********************************************************************
Q
;
AMT(X,BARMIN,BARMAX) ;EP - ** number function
;** quits with "^" to exit
;** quits with "?" for incorrect entry
I '$D(X) Q "^"
I X["^"!('$L(X)) Q "^"
S:X["$" X=$P(X,"$",2)
I X'?."-".N.1".".2N Q "?"
I $D(BARMIN),X'>BARMIN Q "?"
I $D(BARMAX),X'<BARMAX Q "?"
Q X
; *********************************************************************
;
COMHLP ;EP - help processor
N X,J
W $$EN^BARVDF("IOF"),!!
S X="Select Command Options"
W ?IOM-$L(X)\2,X
W !?IOM-$L(X)\2 F J=1:1:$L(X) W "-"
W !!
D:$D(BARHLP)<10 SETHLP
S J=""
F S J=$O(BARHLP(J)) Q:J="" W !?2,BARHLP(J)
W !!
Q
; *********************************************************************
;
SETHLP ;EP - sethelp
S BARHLP("A")="A or 2 = Adjustments (Write-Off, Deductible, Non-Covered, Non-Pay, Penalty)"
S BARHLP("C")="C = Itemized Charges - allows posting by line item"
S BARHLP("D")="D = Patient Demographics"
B S BARHLP("B")="B = Bill Inquire"
S BARHLP("E")="E = Edit a transaction not yet posted to A/R"
S BARHLP("I")="I = Insurer Demographics"
S BARHLP("H")="H = History of BIll Transactions ($ only)"
S BARHLP("M")="M = Message"
S BARHLP("P")="P or 1 = Payment"
S BARHLP("Q")="Q or 3 = Quit - Ends the data entry for this Patient and allows for posting to A/R"
S BARHLP("R")="R = Rollover"
S BARHLP("T")="T = Toggle Display - Current transaction list."
Q
; *********************************************************************
;
POSTTX ;EP - poster ;Heavily modified for BAR*1.8*4 DD 4.1.7.2
;CALLED BY PAY/ADJ/REF POSTING OPTIONS ;BAR*1.8*4 DD 4.1.7.2
;
;IHS/SD/TPF BAR*1.8*21 8/3/2011 HEAT20490
I $$NOTOPEN^BARUFUT(.DUZ,$G(UFMSESID)) Q ;IS SESSION STILL OPEN
W !!,"Please wait... Posting Transactions."
K DD,DO,BARBLV
N DA,DR,DIE,DIC,DIQ
N REVERSAL,REVSCHED ;BAR*1.8*3 UFMS
S BARLIN=0
F S BARLIN=$O(BARTR(BARLIN)) Q:'BARLIN D
.S BARBDFN=$O(^BARTMP($J,"B",BARLIN,""))
.S BARAC=$$GET1^DIQ(90050.01,BARBDFN,3,"I")
.S BARROLL(BARBDFN)=""
.S BARBLV(15)=$$GET1^DIQ(90050.01,BARBDFN,15,"I")
.D CKBAL(BARLIN,BARBLV(15)) ;BAR*1.8*4 DD 4.1.7.2
.Q:BARSTOP ;BAR*1.8*4 DD 4.1.7.2
.S (BARBTOT,BARJ)=0
.F S BARJ=$O(BARTR(BARLIN,BARJ)) Q:'BARJ D
..S BARREC=BARTR(BARLIN,BARJ)
..S BARTXT=$P(BARREC,U,1)
..S BARAMT=$P(BARREC,U,2)
..S BARBTOT=BARBTOT+BARAMT
..S BARCAT=$P(BARREC,U,3)
..S:BARTXT="P" BARTT=$O(^BARTBL("B","PAYMENT",""))
..S:BARTXT="A" BARTT=$O(^BARTBL("B","ADJUST ACCOUNT",""))
..S:BARTXT="R" BARTT=39 ;BAR*1.8*4 DD 4.1.7.2 ;change from 55 wrong account number
..S BARATYP=$P(BARREC,U,4)
..S REVERSAL=$P(BARREC,U,5) ;BAR*1.8*3 UFMS
..S REVSCHED=$P(BARREC,U,6) ;BAR*1.8*4 UFMS SCR56,SCR58
..;
..D P1
.K REVERSAL,REVSCHED ;BAR*1.8*4 UFMS SCR56,SCR58
.K BARTR(BARLIN),BARPMT,BARADJ,BARCAT,BARATYP,BARBTOT,BARBLV ;BAR*1.8*4 DD 4.1.7.2
;K ^BARTMP($J) ;BAR*1.8*4 DD 4.1.7.2
;K BARTR,BARPMT,BARADJ,BARCAT,BARATYP,BARBTOT,BARBLV ;BAR*1.8*4 DD 4.1.7.2
Q
CKBAL(BARL,BARB) ;EP; CHECK IF TX'S WILL CREATE NEGATIVE BALANCE
;BAR*1.8*4 DD 4.1.7.2
;ENTERS WITH BARL = LINE = BILL
; BARB = BILL BALANCE
S BARSTOP=0
Q:'$$IHS^BARUFUT(DUZ(2))
;;;Q:'$$IHSERA^BARUFUT(DUZ(2)) ;P.OTT
N BARTOT,BARJ,BARDIF,BARTAMT,BARPTOT,BARCAT
S (BARTOT,BARJ,BARPTOT)=0
F S BARJ=$O(BARTR(BARL,BARJ)) Q:'BARJ D
.S BARREC=BARTR(BARLIN,BARJ)
.S BARTYP=$P(BARREC,U)
.S BARTAMT=$P(BARREC,U,2)
.S BARCAT=$P(BARREC,U,3)
.I BARCAT'=21&(BARCAT'=22) D
..S BARTOT=BARTOT+BARTAMT
.S:BARTYP="P" BARPTOT=BARPTOT+BARTAMT
I BARB-BARTOT<0 D
.D STOP("BILL",BARB-BARTOT)
Q:'$G(BARCOL) ;NO COLLECTION BATCH TO CHECK
Q:$G(BARZZZZ) ;DON'T CHECK BATCH/ITEM WHEN ENTERED FROM PUC ;BAR*1.8*6 DD 4.2.5
D CKCOL
I +$G(BAREOB),(BAREOV(4)-BARPTOT)<0 D STOP("VISIT LOCATION",(BAREOV(4)-BARPTOT))
I (BARITV(19)-BARPTOT)<0 D STOP("COLLECTION ITEM",(BARITV(19)-BARPTOT))
I (BARCLV(17)-BARPTOT)<0 D STOP("COLLECTION BATCH",(BARCLV(17)-BARPTOT))
Q
;
STOP(TYPE,BARDIF) ;EP; BAR*1.8*4 DD 4.1.7.2
W !!,"THE TRANSACTION(S) YOU ARE ATTEMPTING TO POST WILL PUT"
W !,"THE ",TYPE," INTO A NEGATIVE BALANCE BY $"_-BARDIF
W !,"PLEASE CANCEL, OR USE 'M' FOR MORE TO EDIT YOUR TRANSACTION"
W !,"TO PREVENT THE NEGATIVE BALANCE"
S BARSTOP=1
D EOP^BARUTL(1)
Q
; *********************************************************************
P1 ;
S DIE="^BARTR(DUZ(2),"
S BARCR=$S(+BARAMT>0:BARAMT,1:"")
S BARDB=$S(+BARAMT<0:BARAMT,1:"")
S BARDB=-BARDB
S BARPT=+BARPAT
;Begin changes for BAR*1.8*4 DD 4.1.7.2
;S BARAC=$P(BARITM(0),U,7)
;S BARPAR=$P(BARCOL(0),U,8)
;S BARASFAC=$P(BARCOL(0),U,9)
;S BARSECT=$P(BARCOL(0),U,10)
;S BARSITE=$P(BARITM(0),U,8)
S:$G(BARITM(0)) BARAC=$P(BARITM(0),U,7)
S BARPAR=$P($G(BARCOL(0)),U,8)
S BARASFAC=$P($G(BARCOL(0)),U,9)
S BARSECT=$P($G(BARCOL(0)),U,10)
S BARSITE=$P($G(BARITM(0)),U,8)
S:$G(BAREOB) BARSITE=BAREOB
;End changes for BAR*1.8*4 DD 4.1.7.2
; -------------------------------
PX ;
S X=$$NEW^BARTR
S BARTRIEN=X
I X<1 D MSG^BARTR(BARBDFN) Q
K DIE,DIC,DR,DA
S DA=X,DIE=90050.03
S DR="2////^S X=BARCR"
S DR=DR_";3////^S X=BARDB"
S DR=DR_";4////^S X=BARBDFN"
S DR=DR_";5////^S X=BARPT"
S DR=DR_";6////^S X=BARAC"
S DR=DR_";8////^S X=BARPAR"
S DR=DR_";9////^S X=BARASFAC"
S DR=DR_";10////^S X=BARSECT"
S DR=DR_";11////^S X=BARSITE"
S DR=DR_";12////^S X=DT"
S DR=DR_";13////^S X=DUZ"
;S DR=DR_";14////^S X=BARCOL" ;BAR*1.8*4 DD 4.1.7.2
;S DR=DR_";15////^S X=$P(BARITM(0),U,1)" ;BAR*1.8*4 DD 4.1.7.2
S:$G(BARCOL) DR=DR_";14////^S X=BARCOL" ;BAR*1.8*4 DD 4.1.7.2
S:$G(BARITM(0)) DR=DR_";15////^S X=$P(BARITM(0),U,1)" ;BAR*1.8*4 DD 4.1.7.2
S DR=DR_";101////^S X=BARTT"
;I BARTXT="A" D ;BAR*1.8*4 DD 4.1.7.2
I "RA"[BARTXT D ;BAR*1.8*4 DD 4.1.7.2
. S DR=DR_";102////^S X=BARCAT"
. S DR=DR_";103////^S X=BARATYP"
S DR=DR_";10////^S X=$$VALI^XBDIQ1(200,DUZ,29)"
;S DR=DR_";110////^S X=REVERSAL" ;ISH/SD/TPF BAR*1.8*3 UFMS
I $G(REVERSAL) D
.S DR=DR_";110////^S X=REVERSAL" ;ISH/SD/TPF BAR*1.8*4 UFMS
.S DR=DR_";111////^S X=REVSCHED" ;ISH/SD/TPF BAR*1.8*4 UFMS SCR56,SCR58
S DIDEL=90050
D ^DIE
K DIDEL
I ",21,22,"[(","_BARCAT_",") Q
D TR^BARTDO(BARTRIEN)
W "."
DONE ;
Q
; ------------------------------------------
CKCOL ;EP; CHECK COLLECTION BATCH/ITEM BALANCES;BAR*1.8*4 DD 4.1.7.2
K BARCLV,BARITV,BAREOV
N DA,DIC,DIQ,DR
S DIC=90051.01
S DIQ="BARCLV("
S DR=17
S DA=+BARCOL
D EN^XBDIQ1
;
S DIC=90051.1101
S DIQ="BARITV("
S DR=19
S DA=+BARITM
S DA(1)=+BARCOL
D EN^XBDIQ1
;
I +$G(BAREOB) D
. S DIC=90051.1101601
. S DIQ="BAREOV("
. S DR=4
. S DA=+BAREOB
. S DA(2)=+BARCOL
. S DA(1)=+BARITM
. D EN^XBDIQ1
Q
BARPSTU ; IHS/SD/LSL - PAYMENT TRANSACTION EXECUTION ; 06/09/2008
+1 ;;1.8;IHS ACCOUNTS RECEIVABLE;**3,4,6,21,23**;OCT 26, 2005
+2 ;** posting utilities
+3 ;
+4 ; IHS/SD/LSL - 09/23/02 - V1.6 Patch 3 - HIPAA
+5 ; Don't update files if Adjustment Category is PENDING or
+6 ; GENERAL INFORMATION
+7 ;
+8 ; IHS/SD/LSL - 10/17/02 - V1.7 - QAA-1200-130051
+9 ; Provide Q conditions if failed getting a new A/R transaction
+10 ;
+11 ; ********************************************************************
+12 QUIT
+13 ;
AMT(X,BARMIN,BARMAX) ;EP - ** number function
+1 ;** quits with "^" to exit
+2 ;** quits with "?" for incorrect entry
+3 IF '$DATA(X)
QUIT "^"
+4 IF X["^"!('$LENGTH(X))
QUIT "^"
+5 IF X["$"
SET X=$PIECE(X,"$",2)
+6 IF X'?."-".N.1".".2N
QUIT "?"
+7 IF $DATA(BARMIN)
IF X'>BARMIN
QUIT "?"
+8 IF $DATA(BARMAX)
IF X'<BARMAX
QUIT "?"
+9 QUIT X
+10 ; *********************************************************************
+11 ;
COMHLP ;EP - help processor
+1 NEW X,J
+2 WRITE $$EN^BARVDF("IOF"),!!
+3 SET X="Select Command Options"
+4 WRITE ?IOM-$LENGTH(X)\2,X
+5 WRITE !?IOM-$LENGTH(X)\2
FOR J=1:1:$LENGTH(X)
WRITE "-"
+6 WRITE !!
+7 IF $DATA(BARHLP)<10
DO SETHLP
+8 SET J=""
+9 FOR
SET J=$ORDER(BARHLP(J))
IF J=""
QUIT
WRITE !?2,BARHLP(J)
+10 WRITE !!
+11 QUIT
+12 ; *********************************************************************
+13 ;
SETHLP ;EP - sethelp
+1 SET BARHLP("A")="A or 2 = Adjustments (Write-Off, Deductible, Non-Covered, Non-Pay, Penalty)"
+2 SET BARHLP("C")="C = Itemized Charges - allows posting by line item"
+3 SET BARHLP("D")="D = Patient Demographics"
B SET BARHLP("B")="B = Bill Inquire"
+1 SET BARHLP("E")="E = Edit a transaction not yet posted to A/R"
+2 SET BARHLP("I")="I = Insurer Demographics"
+3 SET BARHLP("H")="H = History of BIll Transactions ($ only)"
+4 SET BARHLP("M")="M = Message"
+5 SET BARHLP("P")="P or 1 = Payment"
+6 SET BARHLP("Q")="Q or 3 = Quit - Ends the data entry for this Patient and allows for posting to A/R"
+7 SET BARHLP("R")="R = Rollover"
+8 SET BARHLP("T")="T = Toggle Display - Current transaction list."
+9 QUIT
+10 ; *********************************************************************
+11 ;
POSTTX ;EP - poster ;Heavily modified for BAR*1.8*4 DD 4.1.7.2
+1 ;CALLED BY PAY/ADJ/REF POSTING OPTIONS ;BAR*1.8*4 DD 4.1.7.2
+2 ;
+3 ;IHS/SD/TPF BAR*1.8*21 8/3/2011 HEAT20490
+4 ;IS SESSION STILL OPEN
IF $$NOTOPEN^BARUFUT(.DUZ,$GET(UFMSESID))
QUIT
+5 WRITE !!,"Please wait... Posting Transactions."
+6 KILL DD,DO,BARBLV
+7 NEW DA,DR,DIE,DIC,DIQ
+8 ;BAR*1.8*3 UFMS
NEW REVERSAL,REVSCHED
+9 SET BARLIN=0
+10 FOR
SET BARLIN=$ORDER(BARTR(BARLIN))
IF 'BARLIN
QUIT
Begin DoDot:1
+11 SET BARBDFN=$ORDER(^BARTMP($JOB,"B",BARLIN,""))
+12 SET BARAC=$$GET1^DIQ(90050.01,BARBDFN,3,"I")
+13 SET BARROLL(BARBDFN)=""
+14 SET BARBLV(15)=$$GET1^DIQ(90050.01,BARBDFN,15,"I")
+15 ;BAR*1.8*4 DD 4.1.7.2
DO CKBAL(BARLIN,BARBLV(15))
+16 ;BAR*1.8*4 DD 4.1.7.2
IF BARSTOP
QUIT
+17 SET (BARBTOT,BARJ)=0
+18 FOR
SET BARJ=$ORDER(BARTR(BARLIN,BARJ))
IF 'BARJ
QUIT
Begin DoDot:2
+19 SET BARREC=BARTR(BARLIN,BARJ)
+20 SET BARTXT=$PIECE(BARREC,U,1)
+21 SET BARAMT=$PIECE(BARREC,U,2)
+22 SET BARBTOT=BARBTOT+BARAMT
+23 SET BARCAT=$PIECE(BARREC,U,3)
+24 IF BARTXT="P"
SET BARTT=$ORDER(^BARTBL("B","PAYMENT",""))
+25 IF BARTXT="A"
SET BARTT=$ORDER(^BARTBL("B","ADJUST ACCOUNT",""))
+26 ;BAR*1.8*4 DD 4.1.7.2 ;change from 55 wrong account number
IF BARTXT="R"
SET BARTT=39
+27 SET BARATYP=$PIECE(BARREC,U,4)
+28 ;BAR*1.8*3 UFMS
SET REVERSAL=$PIECE(BARREC,U,5)
+29 ;BAR*1.8*4 UFMS SCR56,SCR58
SET REVSCHED=$PIECE(BARREC,U,6)
+30 ;
+31 DO P1
End DoDot:2
+32 ;BAR*1.8*4 UFMS SCR56,SCR58
KILL REVERSAL,REVSCHED
+33 ;BAR*1.8*4 DD 4.1.7.2
KILL BARTR(BARLIN),BARPMT,BARADJ,BARCAT,BARATYP,BARBTOT,BARBLV
End DoDot:1
+34 ;K ^BARTMP($J) ;BAR*1.8*4 DD 4.1.7.2
+35 ;K BARTR,BARPMT,BARADJ,BARCAT,BARATYP,BARBTOT,BARBLV ;BAR*1.8*4 DD 4.1.7.2
+36 QUIT
CKBAL(BARL,BARB) ;EP; CHECK IF TX'S WILL CREATE NEGATIVE BALANCE
+1 ;BAR*1.8*4 DD 4.1.7.2
+2 ;ENTERS WITH BARL = LINE = BILL
+3 ; BARB = BILL BALANCE
+4 SET BARSTOP=0
+5 IF '$$IHS^BARUFUT(DUZ(2))
QUIT
+6 ;;;Q:'$$IHSERA^BARUFUT(DUZ(2)) ;P.OTT
+7 NEW BARTOT,BARJ,BARDIF,BARTAMT,BARPTOT,BARCAT
+8 SET (BARTOT,BARJ,BARPTOT)=0
+9 FOR
SET BARJ=$ORDER(BARTR(BARL,BARJ))
IF 'BARJ
QUIT
Begin DoDot:1
+10 SET BARREC=BARTR(BARLIN,BARJ)
+11 SET BARTYP=$PIECE(BARREC,U)
+12 SET BARTAMT=$PIECE(BARREC,U,2)
+13 SET BARCAT=$PIECE(BARREC,U,3)
+14 IF BARCAT'=21&(BARCAT'=22)
Begin DoDot:2
+15 SET BARTOT=BARTOT+BARTAMT
End DoDot:2
+16 IF BARTYP="P"
SET BARPTOT=BARPTOT+BARTAMT
End DoDot:1
+17 IF BARB-BARTOT<0
Begin DoDot:1
+18 DO STOP("BILL",BARB-BARTOT)
End DoDot:1
+19 ;NO COLLECTION BATCH TO CHECK
IF '$GET(BARCOL)
QUIT
+20 ;DON'T CHECK BATCH/ITEM WHEN ENTERED FROM PUC ;BAR*1.8*6 DD 4.2.5
IF $GET(BARZZZZ)
QUIT
+21 DO CKCOL
+22 IF +$GET(BAREOB)
IF (BAREOV(4)-BARPTOT)<0
DO STOP("VISIT LOCATION",(BAREOV(4)-BARPTOT))
+23 IF (BARITV(19)-BARPTOT)<0
DO STOP("COLLECTION ITEM",(BARITV(19)-BARPTOT))
+24 IF (BARCLV(17)-BARPTOT)<0
DO STOP("COLLECTION BATCH",(BARCLV(17)-BARPTOT))
+25 QUIT
+26 ;
STOP(TYPE,BARDIF) ;EP; BAR*1.8*4 DD 4.1.7.2
+1 WRITE !!,"THE TRANSACTION(S) YOU ARE ATTEMPTING TO POST WILL PUT"
+2 WRITE !,"THE ",TYPE," INTO A NEGATIVE BALANCE BY $"_-BARDIF
+3 WRITE !,"PLEASE CANCEL, OR USE 'M' FOR MORE TO EDIT YOUR TRANSACTION"
+4 WRITE !,"TO PREVENT THE NEGATIVE BALANCE"
+5 SET BARSTOP=1
+6 DO EOP^BARUTL(1)
+7 QUIT
+8 ; *********************************************************************
P1 ;
+1 SET DIE="^BARTR(DUZ(2),"
+2 SET BARCR=$SELECT(+BARAMT>0:BARAMT,1:"")
+3 SET BARDB=$SELECT(+BARAMT<0:BARAMT,1:"")
+4 SET BARDB=-BARDB
+5 SET BARPT=+BARPAT
+6 ;Begin changes for BAR*1.8*4 DD 4.1.7.2
+7 ;S BARAC=$P(BARITM(0),U,7)
+8 ;S BARPAR=$P(BARCOL(0),U,8)
+9 ;S BARASFAC=$P(BARCOL(0),U,9)
+10 ;S BARSECT=$P(BARCOL(0),U,10)
+11 ;S BARSITE=$P(BARITM(0),U,8)
+12 IF $GET(BARITM(0))
SET BARAC=$PIECE(BARITM(0),U,7)
+13 SET BARPAR=$PIECE($GET(BARCOL(0)),U,8)
+14 SET BARASFAC=$PIECE($GET(BARCOL(0)),U,9)
+15 SET BARSECT=$PIECE($GET(BARCOL(0)),U,10)
+16 SET BARSITE=$PIECE($GET(BARITM(0)),U,8)
+17 IF $GET(BAREOB)
SET BARSITE=BAREOB
+18 ;End changes for BAR*1.8*4 DD 4.1.7.2
+19 ; -------------------------------
PX ;
+1 SET X=$$NEW^BARTR
+2 SET BARTRIEN=X
+3 IF X<1
DO MSG^BARTR(BARBDFN)
QUIT
+4 KILL DIE,DIC,DR,DA
+5 SET DA=X
SET DIE=90050.03
+6 SET DR="2////^S X=BARCR"
+7 SET DR=DR_";3////^S X=BARDB"
+8 SET DR=DR_";4////^S X=BARBDFN"
+9 SET DR=DR_";5////^S X=BARPT"
+10 SET DR=DR_";6////^S X=BARAC"
+11 SET DR=DR_";8////^S X=BARPAR"
+12 SET DR=DR_";9////^S X=BARASFAC"
+13 SET DR=DR_";10////^S X=BARSECT"
+14 SET DR=DR_";11////^S X=BARSITE"
+15 SET DR=DR_";12////^S X=DT"
+16 SET DR=DR_";13////^S X=DUZ"
+17 ;S DR=DR_";14////^S X=BARCOL" ;BAR*1.8*4 DD 4.1.7.2
+18 ;S DR=DR_";15////^S X=$P(BARITM(0),U,1)" ;BAR*1.8*4 DD 4.1.7.2
+19 ;BAR*1.8*4 DD 4.1.7.2
IF $GET(BARCOL)
SET DR=DR_";14////^S X=BARCOL"
+20 ;BAR*1.8*4 DD 4.1.7.2
IF $GET(BARITM(0))
SET DR=DR_";15////^S X=$P(BARITM(0),U,1)"
+21 SET DR=DR_";101////^S X=BARTT"
+22 ;I BARTXT="A" D ;BAR*1.8*4 DD 4.1.7.2
+23 ;BAR*1.8*4 DD 4.1.7.2
IF "RA"[BARTXT
Begin DoDot:1
+24 SET DR=DR_";102////^S X=BARCAT"
+25 SET DR=DR_";103////^S X=BARATYP"
End DoDot:1
+26 SET DR=DR_";10////^S X=$$VALI^XBDIQ1(200,DUZ,29)"
+27 ;S DR=DR_";110////^S X=REVERSAL" ;ISH/SD/TPF BAR*1.8*3 UFMS
+28 IF $GET(REVERSAL)
Begin DoDot:1
+29 ;ISH/SD/TPF BAR*1.8*4 UFMS
SET DR=DR_";110////^S X=REVERSAL"
+30 ;ISH/SD/TPF BAR*1.8*4 UFMS SCR56,SCR58
SET DR=DR_";111////^S X=REVSCHED"
End DoDot:1
+31 SET DIDEL=90050
+32 DO ^DIE
+33 KILL DIDEL
+34 IF ",21,22,"[(","_BARCAT_",")
QUIT
+35 DO TR^BARTDO(BARTRIEN)
+36 WRITE "."
DONE ;
+1 QUIT
+2 ; ------------------------------------------
CKCOL ;EP; CHECK COLLECTION BATCH/ITEM BALANCES;BAR*1.8*4 DD 4.1.7.2
+1 KILL BARCLV,BARITV,BAREOV
+2 NEW DA,DIC,DIQ,DR
+3 SET DIC=90051.01
+4 SET DIQ="BARCLV("
+5 SET DR=17
+6 SET DA=+BARCOL
+7 DO EN^XBDIQ1
+8 ;
+9 SET DIC=90051.1101
+10 SET DIQ="BARITV("
+11 SET DR=19
+12 SET DA=+BARITM
+13 SET DA(1)=+BARCOL
+14 DO EN^XBDIQ1
+15 ;
+16 IF +$GET(BAREOB)
Begin DoDot:1
+17 SET DIC=90051.1101601
+18 SET DIQ="BAREOV("
+19 SET DR=4
+20 SET DA=+BAREOB
+21 SET DA(2)=+BARCOL
+22 SET DA(1)=+BARITM
+23 DO EN^XBDIQ1
End DoDot:1
+24 QUIT