ABMUMISS ; IHS/SD/SDR - 3PB/UFMS Cashiering Options
;;2.6;IHS 3P BILLING SYSTEM;;NOV 12, 2009
;
; New routine - abm*2.6
; Check for bills that were missed in session
UFMSCK ;
W !!,"Will now check for any ""missing"" claims/bills..."
;
;ABMFD contains open date/time of session; start there and
;go thru approved bills looking for this user
;
S ABMPAR=0
S ABMPFLG=0
F S ABMPAR=$O(^BAR(90052.05,ABMPAR)) Q:'ABMPAR D Q:ABMPFLG=1
.I $D(^BAR(90052.05,ABMPAR,DUZ(2))) D
..Q:$P($G(^BAR(90052.05,ABMPAR,DUZ(2),0)),U,3)'=ABMPAR
..S ABMPFLG=1 ;set flag to stop looking; this is our parent
S ABMSITE=0
F S ABMSITE=$O(^BAR(90052.05,ABMPAR,ABMSITE)) Q:'ABMSITE D
.I $D(^BAR(90052.05,ABMPAR,ABMSITE)) D
..Q:$P($G(^BAR(90052.05,ABMPAR,ABMSITE,0)),U,3)'=ABMPAR
..I ABMPAR=ABMSITE S ABMPARNT=ABMPAR
..S ABMP("SATS",ABMSITE)=""
;
S ABMFFLG=0
S ABMHOLD=DUZ(2)
S DUZ(2)=0
F S DUZ(2)=$O(ABMP("SATS",DUZ(2))) Q:'DUZ(2) D
.Q:$P($G(^ABMDPARM(DUZ(2),1,4)),U,15)'=1
.K ABMLOC
.S ABMASDT=(ABMFD-.000001)
.F S ABMASDT=$O(^ABMDBILL(DUZ(2),"AP",ABMASDT)) Q:'ABMASDT D
..S ABMP("BDFN")=0
..F S ABMP("BDFN")=$O(^ABMDBILL(DUZ(2),"AP",ABMASDT,ABMP("BDFN"))) Q:'ABMP("BDFN") D
...I $P($G(^ABMDBILL(DUZ(2),ABMP("BDFN"),1)),U,4)'=DUZ Q
...I $P($G(^ABMDBILL(DUZ(2),ABMP("BDFN"),0)),U,7)=901 Q ;don't add if POS claim
...D ADDBENTR^ABMUCUTL("ABILL",ABMP("BDFN"))
...I ($P(Y,U,3)'="") D
....W !?5,"Bill number: ",$P($G(^ABMDBILL(DUZ(2),ABMP("BDFN"),0)),U)," added to session"
....S ABMFFLG=1
I ABMFFLG=0 W !,"No ""missing"" bills found"
S DUZ(2)=ABMHOLD
W !!
K ABMPARNT,ABMP("SATS")
Q
ABMUMISS ; IHS/SD/SDR - 3PB/UFMS Cashiering Options
+1 ;;2.6;IHS 3P BILLING SYSTEM;;NOV 12, 2009
+2 ;
+3 ; New routine - abm*2.6
+4 ; Check for bills that were missed in session
UFMSCK ;
+1 WRITE !!,"Will now check for any ""missing"" claims/bills..."
+2 ;
+3 ;ABMFD contains open date/time of session; start there and
+4 ;go thru approved bills looking for this user
+5 ;
+6 SET ABMPAR=0
+7 SET ABMPFLG=0
+8 FOR
SET ABMPAR=$ORDER(^BAR(90052.05,ABMPAR))
IF 'ABMPAR
QUIT
Begin DoDot:1
+9 IF $DATA(^BAR(90052.05,ABMPAR,DUZ(2)))
Begin DoDot:2
+10 IF $PIECE($GET(^BAR(90052.05,ABMPAR,DUZ(2),0)),U,3)'=ABMPAR
QUIT
+11 ;set flag to stop looking; this is our parent
SET ABMPFLG=1
End DoDot:2
End DoDot:1
IF ABMPFLG=1
QUIT
+12 SET ABMSITE=0
+13 FOR
SET ABMSITE=$ORDER(^BAR(90052.05,ABMPAR,ABMSITE))
IF 'ABMSITE
QUIT
Begin DoDot:1
+14 IF $DATA(^BAR(90052.05,ABMPAR,ABMSITE))
Begin DoDot:2
+15 IF $PIECE($GET(^BAR(90052.05,ABMPAR,ABMSITE,0)),U,3)'=ABMPAR
QUIT
+16 IF ABMPAR=ABMSITE
SET ABMPARNT=ABMPAR
+17 SET ABMP("SATS",ABMSITE)=""
End DoDot:2
End DoDot:1
+18 ;
+19 SET ABMFFLG=0
+20 SET ABMHOLD=DUZ(2)
+21 SET DUZ(2)=0
+22 FOR
SET DUZ(2)=$ORDER(ABMP("SATS",DUZ(2)))
IF 'DUZ(2)
QUIT
Begin DoDot:1
+23 IF $PIECE($GET(^ABMDPARM(DUZ(2),1,4)),U,15)'=1
QUIT
+24 KILL ABMLOC
+25 SET ABMASDT=(ABMFD-.000001)
+26 FOR
SET ABMASDT=$ORDER(^ABMDBILL(DUZ(2),"AP",ABMASDT))
IF 'ABMASDT
QUIT
Begin DoDot:2
+27 SET ABMP("BDFN")=0
+28 FOR
SET ABMP("BDFN")=$ORDER(^ABMDBILL(DUZ(2),"AP",ABMASDT,ABMP("BDFN")))
IF 'ABMP("BDFN")
QUIT
Begin DoDot:3
+29 IF $PIECE($GET(^ABMDBILL(DUZ(2),ABMP("BDFN"),1)),U,4)'=DUZ
QUIT
+30 ;don't add if POS claim
IF $PIECE($GET(^ABMDBILL(DUZ(2),ABMP("BDFN"),0)),U,7)=901
QUIT
+31 DO ADDBENTR^ABMUCUTL("ABILL",ABMP("BDFN"))
+32 IF ($PIECE(Y,U,3)'="")
Begin DoDot:4
+33 WRITE !?5,"Bill number: ",$PIECE($GET(^ABMDBILL(DUZ(2),ABMP("BDFN"),0)),U)," added to session"
+34 SET ABMFFLG=1
End DoDot:4
End DoDot:3
End DoDot:2
End DoDot:1
+35 IF ABMFFLG=0
WRITE !,"No ""missing"" bills found"
+36 SET DUZ(2)=ABMHOLD
+37 WRITE !!
+38 KILL ABMPARNT,ABMP("SATS")
+39 QUIT