ABMUCASH ; IHS/SD/SDR - 3PB/UFMS Cashiering Options
;;2.6;IHS 3P BILLING SYSTEM;**9,11**;NOV 12, 2009;Build 133
; New routine - v2.5 p12 SDD item 4.9.1
; Cashiering Sign In/Out option
EP ;EP
;start new abm*2.6*9 NOHEAT - ensure UFMS setup
I $P($G(^ABMDPARM(DUZ(2),1,4)),U,15)="" D Q
.W !!,"* * UFMS SETUP MUST BE DONE BEFORE ANY BILLING FUNCTIONS CAN BE USED! * *",!
.S DIR(0)="E",DIR("A")="Enter RETURN to Continue" D ^DIR K DIR
;end new
S ABMFD=$$FINDOPEN^ABMUCUTL(DUZ)
S ABMTRIBL=$P($G(^ABMDPARM(ABMLOC,1,4)),U,14) ;export flag
S $P(ABMLINE,"-",80)=""
;NO open sess found
I ABMFD=0 D
.D SIG^XUSESIG ;ask esig
.Q:X1="" ;esig test
.S ABMSNUM=$$CR8SESS^ABMUCUTL() ;create sess
.I ABMSNUM=0 W !,"NEW SESSION COULD NOT BE CREATED" Q
.W !!,"YOU ARE SIGNING *IN* FOR BILLING",!
.W !?10,$$EN^ABMVDF("ULN"),"Billing Activity",$$EN^ABMVDF("ULF")
.W ?40,$$EN^ABMVDF("ULN"),"COUNT",$$EN^ABMVDF("ULF")
.W ?60,$$EN^ABMVDF("ULN"),"TOTAL",$$EN^ABMVDF("ULF"),!
.W !?15,"- Cancelled Claims",?44,"0"
.W !?15,"- Approved Bills",?44,"0",?58,"$",?64,"0"
.W !?15,"- Cancelled Bills",?44,"0",?58,"$",?64,"0"
.W !!,"Assigned Session number: ",$P(ABMSNUM,U),!
;
;open sess found
I ABMFD'=0 D
.W !!,"YOU ARE SIGNING *OUT* FOR BILLING",!
.D UFMSCK^ABMUMISS
.W !?10,$$EN^ABMVDF("ULN"),"Billing Activity",$$EN^ABMVDF("ULF")
.W ?32,$$EN^ABMVDF("ULN"),"COUNT",$$EN^ABMVDF("ULF")
.W ?45,$$EN^ABMVDF("ULN"),"TOTAL",$$EN^ABMVDF("ULF"),!
.K ABMSBTOT,ABMSATOT
.S ABMDUZ=DUZ
.D CASHTOT(DUZ)
.S ABMBA=""
.I '$D(ABMBAL) W !?5,"AT THIS TIME THERE IS NO BILLING ACTIVITY FOR THIS SESSION.",!
.F S ABMBA=$O(ABMBAL(ABMBA)) Q:ABMBA="" D
..;W !?5,$P($T(@ABMBA),";;",2) ;abm*2.6*11 insurer type
..W !?5,$$INSTYP(ABMBA) ;abm*2.6*11 insurer type
..W !?10,"- Cancelled Claims",?33,+$G(ABMBAL(ABMBA,"CCLMS"))
..W !?10,"- Approved Bills",?33,+$G(ABMBAL(ABMBA,"ABILLS")),?40,"$",$J($FN(+$G(ABMBAL(ABMBA,"ABAMT")),",",2),10)
..I ABMTRIBL=1,(+$G(ABMBAL(ABMBA,"EBILLS"))>0) D
...W " "
...W $$EN^ABMVDF("RVN")_"(EXCL. ",ABMBAL(ABMBA,"EBILLS")
...W $$EN^ABMVDF("RVN")_" @ "_$FN(+$G(ABMBAL(ABMBA,"EBAMT")),",",2)_")"
...W $$EN^ABMVDF("RVF")
..W !?10,"- Cancelled Bills",?33,+$G(ABMBAL(ABMBA,"CBILLS")),?40,"$",$J($FN(+$G(ABMBAL(ABMBA,"CBAMT")),",",2),10)
.W !
.I +$G(ABMBLCNT)'=0 W !?5,"REQUEUED BILLS: ",ABMBLCNT
.I +$G(ABMBTCNT)'=0 W !?5,"REQUEUED EXPORTS: ",ABMBTCNT
.W !!,ABMLINE
.W !?2,"TOTAL CANCELLED CLAIMS:",?33,+$G(ABMCCLMS)
.W !?2,"TOTAL CANCELLED BILLS:",?33,+$G(ABMCBILL),?40,"$",$J($FN(+$G(ABMCBAMT),",",2),10)
.W !?2,"TOTAL APPROVED:",?33,+$G(ABMSBTOT),?40,"$",$J($FN(+$G(ABMSATOT),",",2),10)
.W:(ABMTRIBL=1) !?2,$$EN^ABMVDF("RVN"),"TOTAL EXCLUDED:",?33,+$G(ABMEBILL),?40,"$",$J($FN(+$G(ABMEBAMT),",",2),10),$$EN^ABMVDF("RVF")
.W !
.I +$P($G(^ABMUCASH(ABMLOC,10,DUZ,20,ABMFD,0)),U,11)'=0 D
..S ABMBCNT=$P($G(^ABMUCASH(ABMLOC,10,DUZ,20,ABMFD,0)),U,11)
..W !?3,"There "_$S(ABMBCNT=1:"is ",1:"are "),$S(+ABMBCNT=0:"no",1:ABMBCNT)," "_$S(ABMBCNT=1:"claim/bill",1:"claims/bills")_" for beneficiary patients in this session that will ",!?3,"not be included in the export.",!
.K DIR,X,Y
.S DIR(0)="Y"
.S DIR("A")=" Do you wish to sign out now"
.S DIR("B")="No"
.D ^DIR K DIR
.S ABMSGNIO=+Y
.I ABMSGNIO=1 D ;if yes, to signout
..K DIR,X,Y
..W !
..S DIR("A",1)=" By signing out you are confirming the system balances."
..S DIR("A")=" Are you sure you wish to sign out"
..S DIR(0)="Y"
..D ^DIR K DIR
..I Y=1 D ;if yes, confirmed signout
...W !!?5,"Done..."
...W !?8,"the session ",ABMFD," will be sent to your manager for processing.",!
...W !?5,"Signing out of session ",ABMFD,!
...D CLOSESES^ABMUCUTL(ABMLOC,DUZ,ABMFD)
.;view detail?
.W !
.K DIR,X,Y
.S DIR("A")="View detail"
.S DIR(0)="Y"
.D ^DIR K DIR
.I Y=1 D SEL
.;
.I ABMSGNIO=0 D ;if no, don't sign out
..W !
..K DIR,X,Y
..S DIR("A")="Do you wish to print the productivity report"
..S DIR(0)="Y"
..D ^DIR K DIR
..I Y=1 D ^ABMDRPR ;do productivity report (PRRP)
S DIR(0)="E",DIR("A")="Enter RETURN to Continue" D ^DIR K DIR
Q
CASHTOT(ABMDUZ) ;EP - cnt claims/bills & amts for sess
;cancelled clms
K ABMCCLMS
S ABMLOC=$$FINDLOC^ABMUCUTL
S ABMTRIBL=$P($G(^ABMDPARM(ABMLOC,1,4)),U,14)
S ABMBA=0
F S ABMBA=$O(^ABMUCASH(ABMLOC,10,ABMDUZ,20,ABMFD,11,ABMBA)) Q:+ABMBA=0 D
.S ABMBDAC=$P($G(^ABMUCASH(ABMLOC,10,ABMDUZ,20,ABMFD,11,ABMBA,0)),U)
.S ABMCDFN=0
.F S ABMCDFN=$O(^ABMUCASH(ABMLOC,10,ABMDUZ,20,ABMFD,11,ABMBA,1,ABMCDFN)) Q:+ABMCDFN=0 D
..S ABMBAL(ABMBDAC,"CCLMS")=+$G(ABMBAL(ABMBDAC,"CCLMS"))+1
..S ABMCCLMS=+$G(ABMCCLMS)+1 ;sess cntr
..S ABMTCCLM=+$G(ABMTCCLM)+1 ;tot cancelled clms (mult. sess)
;
;appr bills
K ABMABILL,ABMABAMT
K ABMEBILL,ABMEBAMT
S ABMBA=0
F S ABMBA=$O(^ABMUCASH(ABMLOC,10,ABMDUZ,20,ABMFD,11,ABMBA)) Q:+ABMBA=0 D
.S ABMBDAC=$P($G(^ABMUCASH(ABMLOC,10,ABMDUZ,20,ABMFD,11,ABMBA,0)),U)
.S ABMCDFN=0
.F S ABMCDFN=$O(^ABMUCASH(ABMLOC,10,ABMDUZ,20,ABMFD,11,ABMBA,2,ABMCDFN)) Q:+ABMCDFN=0 D
..S ABMBAL(ABMBDAC,"ABILLS")=+$G(ABMBAL(ABMBDAC,"ABILLS"))+1 ;tot appr bills by B.A.
..S ABMABILL=+$G(ABMABILL)+1 ;tot appr bills
..S ABMSBTOT=+$G(ABMSBTOT)+1
..S ABMDUZ2=$P($G(^ABMUCASH(ABMLOC,10,ABMDUZ,20,ABMFD,11,ABMBA,2,ABMCDFN,0)),U,2)
..S ABMBDFN=$P($G(^ABMUCASH(ABMLOC,10,ABMDUZ,20,ABMFD,11,ABMBA,2,ABMCDFN,0)),U,3)
..S ABMBAL(ABMBDAC,"ABAMT")=+$G(ABMBAL(ABMBDAC,"ABAMT"))+($P($G(^ABMDBILL(ABMDUZ2,ABMBDFN,2)),U))
..S ABMSATOT=(+$G(ABMSATOT))+($P($G(^ABMDBILL(ABMDUZ2,ABMBDFN,2)),U))
..S ABMABAMT=$G(ABMABAMT)+($P($G(^ABMDBILL(ABMDUZ2,ABMBDFN,2)),U)) ;tot appr bill amt
..;now check if bill is part of 3P UFMS Exclusion Table
..Q:$$BILL^ABMUEAPI(ABMDUZ2,$P($G(^ABMUCASH(ABMLOC,10,ABMDUZ,20,ABMFD,11,ABMBA,2,ABMCDFN,0)),U,3))=1
..S ABMBAL(ABMBDAC,"EBILLS")=+$G(ABMBAL(ABMBDAC,"EBILLS"))+1
..S ABMEBILL=+$G(ABMEBILL)+1 ;session tot
..S ABMTEBIL=+$G(ABMTEBIL)+1 ;tot bills (multiple sessions)
..S ABMBAL(ABMBDAC,"EBAMT")=+$G(ABMBAL(ABMBDAC,"EBAMT"))+($P($G(^ABMDBILL(ABMDUZ2,ABMBDFN,2)),U))
..S ABMEBAMT=+$G(ABMEBAMT)+($P($G(^ABMDBILL(ABMDUZ2,ABMBDFN,2)),U)) ;sess tot
..S ABMTEBAM=+$G(ABMTEBAM)+($P($G(^ABMDBILL(ABMDUZ2,ABMBDFN,2)),U)) ;tot amt (mult. sess)
;
;cancelled bills
K ABMCBILL,ABMCBAMT
S ABMBA=0
F S ABMBA=$O(^ABMUCASH(ABMLOC,10,ABMDUZ,20,ABMFD,11,ABMBA)) Q:+ABMBA=0 D
.S ABMBDAC=$P($G(^ABMUCASH(ABMLOC,10,ABMDUZ,20,ABMFD,11,ABMBA,0)),U)
.S ABMCDFN=0
.F S ABMCDFN=$O(^ABMUCASH(ABMLOC,10,ABMDUZ,20,ABMFD,11,ABMBA,3,ABMCDFN)) Q:+ABMCDFN=0 D
..S ABMBAL(ABMBDAC,"CBILLS")=+$G(ABMBAL(ABMBDAC,"CBILLS"))+1
..S ABMCBILL=$G(ABMCBILL)+1 ;session tot
..S ABMTCBIL=+$G(ABMTCBIL)+1 ;tot bills (multiple sessions)
..S ABMDUZ2=$P($G(^ABMUCASH(ABMLOC,10,ABMDUZ,20,ABMFD,11,ABMBA,3,ABMCDFN,0)),U,2)
..S ABMBDFN=$P($G(^ABMUCASH(ABMLOC,10,ABMDUZ,20,ABMFD,11,ABMBA,3,ABMCDFN,0)),U,3)
..S ABMBAL(ABMBDAC,"CBAMT")=+$G(ABMBAL(ABMBDAC,"CBAMT"))+($P($G(^ABMDBILL(ABMDUZ2,ABMBDFN,2)),U))
..S ABMCBAMT=+$G(ABMCBAMT)+($P($G(^ABMDBILL(ABMDUZ2,ABMBDFN,2)),U)) ;session tot
..S ABMTCBAM=+$G(ABMTCBAM)+($P($G(^ABMDBILL(ABMDUZ2,ABMBDFN,2)),U)) ;tot amt (multiple sessions)
;
;cnt any requeued bills or batches (no detail)
K ABMBLCNT,ABMBTCNT
F ABMI=12,13 D
.S ABMIEN=0
.F S ABMIEN=$O(^ABMUCASH(ABMLOC,10,ABMDUZ,20,ABMFD,ABMI,ABMIEN)) Q:+ABMIEN=0 D
..I ABMI=12 S ABMBLCNT=+$G(ABMBLCNT)+1
..I ABMI=13 S ABMBTCNT=+$G(ABMBTCNT)+1
Q
CASHTOTP ;EP - cnt POS claims
D CASHTOTP^ABMUUTL
Q
SEL ;EP
;Select device
S %ZIS="NQ"
S %ZIS("A")="Enter DEVICE: "
D ^%ZIS Q:POP
I IO'=IO(0) D QUE,HOME^%ZIS S DIR(0)="E" D ^DIR K DIR Q
I $D(IO("S")) S IOP=ION D ^%ZIS
;
PRINT ;EP
;Callable point for queuing
S ABME("PG")=0
D HD
D DETAIL
W !!,$$EN^ABMVDF("HIN"),"E N D O F R E P O R T",$$EN^ABMVDF("HIF"),!
I $E(IOST)="C" S DIR(0)="E" D ^DIR K DIR
I $E(IOST)="P" W $$EN^ABMVDF("IOF")
I $D(IO("S")) D ^%ZISC
K ABME
Q
DETAIL ;EP - view session detail
;
I $G(ABMDUZ)="" S ABMDUZ=DUZ
K ABMCCLMS,ABMBAOUT
S ABMLOC=$$FINDLOC^ABMUCUTL
;"regular" claims
I +$G(ABMDUZ)'=0 D
.S ABMBA=0
.F S ABMBA=$O(^ABMUCASH(ABMLOC,10,ABMDUZ,20,ABMFD,11,ABMBA)) Q:+ABMBA=0 D
..S ABMBAOUT=$P($G(^ABMUCASH(ABMLOC,10,ABMDUZ,20,ABMFD,11,ABMBA,0)),U)
..F ABMLOOP=1:1:3 D
...S ABMCDFN=0
...F S ABMCDFN=$O(^ABMUCASH(ABMLOC,10,ABMDUZ,20,ABMFD,11,ABMBA,ABMLOOP,ABMCDFN)) Q:+ABMCDFN=0 D
....S ABMCREC=$G(^ABMUCASH(ABMLOC,10,ABMDUZ,20,ABMFD,11,ABMBA,ABMLOOP,ABMCDFN,0))
....S ABMB(ABMBAOUT,ABMLOOP,ABMCDFN)=$P(ABMCREC,U)_"^"_$P(ABMCREC,U,2)_"^"_$P(ABMCREC,U,3)
.;
.;cnt any requeued bills or batches (no detail)
.K ABMBLCNT,ABMBTCNT
.F ABMI=12,13 D
..S ABMIEN=0
..F S ABMIEN=$O(^ABMUCASH(ABMLOC,10,ABMDUZ,20,ABMFD,ABMI,ABMIEN)) Q:+ABMIEN=0 D
...S ABMCREC=$G(^ABMUCASH(ABMLOC,10,ABMDUZ,20,ABMFD,ABMI,ABMIEN,0))
...S:ABMI=12 ABMB(ABMI,ABMIEN)=$P(ABMCREC,U)_"^"_$P(ABMCREC,U,2)_"^"_$P(ABMCREC,U,3)
...S:ABMI=13 ABMB(ABMI,ABMIEN)=$P(ABMCREC,U)
;pos clms
I $G(ABMDUZ)="POS" S ABMDUZ=1 D
.S ABMBA=0
.F S ABMBA=$O(^ABMUCASH(ABMLOC,20,ABMDUZ,20,ABMFD,11,ABMBA)) Q:+ABMBA=0 D
..S ABMBAOUT=$P($G(^ABMUCASH(ABMLOC,20,ABMDUZ,20,ABMFD,11,ABMBA,0)),U)
..F ABMLOOP=1:1:3 D
...S ABMCDFN=0
...F S ABMCDFN=$O(^ABMUCASH(ABMLOC,20,ABMDUZ,20,ABMFD,11,ABMBA,ABMLOOP,ABMCDFN)) Q:+ABMCDFN=0 D
....S ABMCREC=$G(^ABMUCASH(ABMLOC,20,ABMDUZ,20,ABMFD,11,ABMBA,ABMLOOP,ABMCDFN,0))
....S ABMB(ABMBAOUT,ABMLOOP,ABMCDFN)=$P(ABMCREC,U)_"^"_$P(ABMCREC,U,2)_"^"_$P(ABMCREC,U,3)
D DTAILPRT
Q
HD ;
I $G(ABME("PG")),$E(IOST)="C" S DIR(0)="E" D ^DIR K DIR Q:(IOST["C")&($G(Y)<0)!($D(DIRUT)!$D(DIROUT)!$D(DTOUT)!$D(DUOUT))
S ABME("PG")=+$G(ABME("PG"))+1
W $$EN^ABMVDF("IOF")
W !,?23,$$EN^ABMVDF("HIN"),"UFMS VIEW CASHIERING SESSION DETAIL",?70,"Page: ",ABME("PG"),$$EN^ABMVDF("HIF")
W !,"SESSION ID: ",ABMFD,!
W:ABMDUZ'=1 "BILLER: ",$P($P($G(^VA(200,ABMDUZ,0)),U),",")_","_$E($P($P($G(^VA(200,ABMDUZ,0)),U),",",2),1),!
W:ABMDUZ=1 "BILLER: POS CLAIMS"
W:(ABMTRIBL=1) !,"(*) Indicates bills that will be excluded from export"
W !
W !,"LOC",?5,"BILL#",?16,"HRN",?24,"PATIENT",?47,"APPROVE DT",?61,"DOS",?71,"BILL AMT"
W ! F ABMDASH=1:1:80 W "-"
Q
DTAILPRT ;
I '$D(ABMB) W !?5,"AT THIS TIME THERE IS NO BILLING ACTIVITY FOR THIS SESSION.",!
S ABMBAOUT=""
F S ABMBAOUT=$O(ABMB(ABMBAOUT)) Q:ABMBAOUT="" D Q:+$G(Y)=0&(IOST["C")
.Q:ABMBAOUT=12!(ABMBAOUT=13) ;skip requeued bills/exports for now
.;W !!,$P($T(@ABMBAOUT^ABMUCASH),";;",2) ;abm*2.6*11 insurer type
.W !!,$$INSTYP(ABMBAOUT) ;abm*2.6*11 insurer type
.F ABMI=1:1:3 D Q:+$G(Y)=0&(IOST["C")
..I ABMI=1,(+$G(ABMBAL(ABMBAOUT,"CCLMS"))'=0) W !?2,"-CANCELLED CLAIMS - ",+$G(ABMBAL(ABMBAOUT,"CCLMS"))
..I ABMI=2,(+$G(ABMBAL(ABMBAOUT,"ABILLS"))'=0) D
...W !?2,"-APPROVED BILLS - ",+$G(ABMBAL(ABMBAOUT,"ABILLS"))
...W ?25," $",$J($FN(+$G(ABMBAL(ABMBAOUT,"ABAMT")),",",2),10)
..I ABMI=3,(+$G(ABMBAL(ABMBAOUT,"CBILLS"))'=0) D
...W !?2,"-CANCELLED BILLS - ",+$G(ABMBAL(ABMBAOUT,"CBILLS"))
...W ?25,"$",$J($FN(+$G(ABMBAL(ABMBAOUT,"CBAMT")),",",2),10)
..I '$D(ABMB(ABMBAOUT,ABMI)) D
..S ABMBIEN=0
..F S ABMBIEN=$O(ABMB(ABMBAOUT,ABMI,ABMBIEN)) Q:+ABMBIEN=0 D Q:+$G(Y)=0&(IOST["C")
...S ABMDUZ2=$P(ABMB(ABMBAOUT,ABMI,ABMBIEN),U,2)
...S ABMBDFN=$P(ABMB(ABMBAOUT,ABMI,ABMBIEN),U,3)
...I ABMI'=1 D
....S ABME(21)=$P($G(^ABMDBILL(ABMDUZ2,ABMBDFN,2)),U)
....S ABME(ABMBAOUT,"AMT")=$G(ABME(ABMBAOUT,"AMT"))+(ABME(21)) ;cnt bill amt
....S ABME("CNT")=+$G(ABME("CNT"))+1 ;cnt total bills
....S ABME("TOT")=+$G(ABME("TOT"))+(ABME(21)) ;cnt tot bill amt
....S ABME(71)=$$SDT^ABMDUTL($P($G(^ABMDBILL(ABMDUZ2,ABMBDFN,7)),U))
....S ABME(1)=$P($G(^ABMDBILL(ABMDUZ2,ABMBDFN,0)),U)
....S ABME(3)=$P($G(^ABMDBILL(ABMDUZ2,ABMBDFN,0)),U,3)
....S ABME(5)=$P($G(^ABMDBILL(ABMDUZ2,ABMBDFN,0)),U,5)
....S ABME(15)=$$SDT^ABMDUTL($P($G(^ABMDBILL(ABMDUZ2,ABMBDFN,1)),U,5))
....S ABME("HRN")=$P($G(^AUPNPAT(+ABME(5),41,+ABMDUZ2,0)),U,2)
....S ABME("SUFFIX")=$P($G(^ABMDPARM(ABMDUZ2,1,2)),U,4)
....W !,ABME("SUFFIX"),?5,ABME(1),?16,ABME("HRN"),?24,$E($P($G(^DPT(+ABME(5),0)),U),1,22),?47,ABME(15)
....W ?58,ABME(71),?69,$J($FN(ABME(21),",",2),10)
....I ABMTRIBL=1 D
.....S ABMP("XMIT")=$O(^ABMDBILL(ABMDUZ2,ABMBDFN,69,"B",999999999),-1)
.....I +ABMP("XMIT")'=0 D
......S ABMXMIT=$O(^ABMDBILL(ABMDUZ2,ABMBDFN,69,"B",ABMP("XMIT"),0))
......I $P($G(^ABMDBILL(ABMDUZ2,ABMBDFN,69,ABMXMIT,0)),U,3)=1 W "*" ;excluded/tribal data
.....I +ABMP("XMIT")=0 D ;bill not transmitted yet
......I $$BILL^ABMUEAPI(ABMDUZ2,ABMBDFN)=0 W "*" ;excluded/tribal data
...I ABMI=1 D
....S ABME("CNT")=+$G(ABME("CNT"))+1 ;cnt tot bills
....S ABME(21)=$$SDT^ABMDUTL($P($G(^ABMCCLMS(ABMDUZ2,ABMBDFN,0)),U,2))
....S ABME(1)=ABMBDFN
....S ABME(3)=$P($G(^ABMCCLMS(ABMDUZ2,ABMBDFN,0)),U,3)
....S ABME(5)=$P($G(^ABMCCLMS(ABMDUZ2,ABMBDFN,0)),U)
....S ABME(15)=$$SDT^ABMDUTL($P($G(^ABMCCLMS(ABMDUZ2,ABMBDFN,1)),U,5))
....S ABME("HRN")=$P($G(^AUPNPAT(+ABME(5),41,+ABMDUZ2,0)),U,2)
....S ABME("SUFFIX")=$P($G(^ABMDPARM(ABMDUZ2,1,2)),U,4)
....W !,ABME("SUFFIX"),?4,ABME(1),?12,ABME("HRN"),?20,$P($G(^DPT(+ABME(5),0)),U),?47,ABME(15)
....W ?58,ABME(21)
...I $Y+5>IOSL D HD Q:(IOST["C")&($G(Y)<0)
;
K ABMBLCNT,ABMBTCNT
W !
F ABMI=12,13 D
.I ABMI=12,$D(ABMB(ABMI)) D
..W !,"REQUEUED BILLS - "
..S ABMJ=0
..F S ABMJ=$O(ABMB(ABMI,ABMJ)) Q:+ABMJ=0 D
...S ABMDUZ2=$P(ABMB(ABMI,ABMJ),U,2)
...S ABMBDFN=$P(ABMB(ABMI,ABMJ),U,3)
...S ABME(21)=$P($G(^ABMDBILL(ABMDUZ2,ABMBDFN,2)),U)
...S ABME(71)=$$SDT^ABMDUTL($P($G(^ABMDBILL(ABMDUZ2,ABMBDFN,7)),U))
...S ABME(1)=$P($G(^ABMDBILL(ABMDUZ2,ABMBDFN,0)),U)
...S ABME(3)=$P($G(^ABMDBILL(ABMDUZ2,ABMBDFN,0)),U,3)
...S ABME(5)=$P($G(^ABMDBILL(ABMDUZ2,ABMBDFN,0)),U,5)
...S ABME(15)=$$SDT^ABMDUTL($P($G(^ABMDBILL(ABMDUZ2,ABMBDFN,1)),U,5))
...S ABME("HRN")=$P($G(^AUPNPAT(+ABME(5),41,+ABMDUZ2,0)),U,2)
...S ABME("SUFFIX")=$P($G(^ABMDPARM(ABMDUZ2,1,2)),U,4)
...W !,ABME("SUFFIX"),?5,ABME(1),?16,ABME("HRN"),?24,$E($P($G(^DPT(+ABME(5),0)),U),1,22),?47,ABME(15)
...W ?58,ABME(71),?69,$J($FN(ABME(21),",",2),10)
..I $Y+5>IOSL D HD Q:Y=0
.I ABMI=13,$D(ABMB(ABMI)) D
..W !,"REQUEUED EXPORTS - "
..S ABMJ=0
..F S ABMJ=$O(ABMB(ABMI,ABMJ)) Q:+ABMJ=0 D
...S ABMEIEN=$G(ABMB(ABMI,ABMJ))
...S ABMEDT=$$CDT^ABMDUTL($P($G(^ABMUTXMT(ABMEIEN,0)),U))
...S ABMFNM=$P($G(^ABMUTXMT(ABMEIEN,0)),U,2)
...W !,ABMEDT,?20,ABMFNM
..I $Y+5>IOSL D HD Q:Y=0
Q
QUE ;QUE TO TASKMAN
S ZTRTN="PRINT^ABMUCASH"
S ZTDESC="3P UFMS VIEW CASHIERING SESSION DETAIL"
S ZTSAVE("ABM*")=""
K ZTSK
D ^%ZTLOAD
W:$G(ZTSK) !,"Task # ",ZTSK," queued.",!
Q
;
;start new code abm*2.6*11 insurer type
INSTYP(X) ;PEP - returns insurer type name
; X = CODE (1)
N ABMINS,ABMITYP
S ABMINS=$O(^AUTTINTY("C",X,0))
S ABMITYP=$$GET1^DIQ(9999999.181,ABMINS,".01","E")
Q ABMITYP
;end new code insurer type
ABMUCASH ; IHS/SD/SDR - 3PB/UFMS Cashiering Options
+1 ;;2.6;IHS 3P BILLING SYSTEM;**9,11**;NOV 12, 2009;Build 133
+2 ; New routine - v2.5 p12 SDD item 4.9.1
+3 ; Cashiering Sign In/Out option
EP ;EP
+1 ;start new abm*2.6*9 NOHEAT - ensure UFMS setup
+2 IF $PIECE($GET(^ABMDPARM(DUZ(2),1,4)),U,15)=""
Begin DoDot:1
+3 WRITE !!,"* * UFMS SETUP MUST BE DONE BEFORE ANY BILLING FUNCTIONS CAN BE USED! * *",!
+4 SET DIR(0)="E"
SET DIR("A")="Enter RETURN to Continue"
DO ^DIR
KILL DIR
End DoDot:1
QUIT
+5 ;end new
+6 SET ABMFD=$$FINDOPEN^ABMUCUTL(DUZ)
+7 ;export flag
SET ABMTRIBL=$PIECE($GET(^ABMDPARM(ABMLOC,1,4)),U,14)
+8 SET $PIECE(ABMLINE,"-",80)=""
+9 ;NO open sess found
+10 IF ABMFD=0
Begin DoDot:1
+11 ;ask esig
DO SIG^XUSESIG
+12 ;esig test
IF X1=""
QUIT
+13 ;create sess
SET ABMSNUM=$$CR8SESS^ABMUCUTL()
+14 IF ABMSNUM=0
WRITE !,"NEW SESSION COULD NOT BE CREATED"
QUIT
+15 WRITE !!,"YOU ARE SIGNING *IN* FOR BILLING",!
+16 WRITE !?10,$$EN^ABMVDF("ULN"),"Billing Activity",$$EN^ABMVDF("ULF")
+17 WRITE ?40,$$EN^ABMVDF("ULN"),"COUNT",$$EN^ABMVDF("ULF")
+18 WRITE ?60,$$EN^ABMVDF("ULN"),"TOTAL",$$EN^ABMVDF("ULF"),!
+19 WRITE !?15,"- Cancelled Claims",?44,"0"
+20 WRITE !?15,"- Approved Bills",?44,"0",?58,"$",?64,"0"
+21 WRITE !?15,"- Cancelled Bills",?44,"0",?58,"$",?64,"0"
+22 WRITE !!,"Assigned Session number: ",$PIECE(ABMSNUM,U),!
End DoDot:1
+23 ;
+24 ;open sess found
+25 IF ABMFD'=0
Begin DoDot:1
+26 WRITE !!,"YOU ARE SIGNING *OUT* FOR BILLING",!
+27 DO UFMSCK^ABMUMISS
+28 WRITE !?10,$$EN^ABMVDF("ULN"),"Billing Activity",$$EN^ABMVDF("ULF")
+29 WRITE ?32,$$EN^ABMVDF("ULN"),"COUNT",$$EN^ABMVDF("ULF")
+30 WRITE ?45,$$EN^ABMVDF("ULN"),"TOTAL",$$EN^ABMVDF("ULF"),!
+31 KILL ABMSBTOT,ABMSATOT
+32 SET ABMDUZ=DUZ
+33 DO CASHTOT(DUZ)
+34 SET ABMBA=""
+35 IF '$DATA(ABMBAL)
WRITE !?5,"AT THIS TIME THERE IS NO BILLING ACTIVITY FOR THIS SESSION.",!
+36 FOR
SET ABMBA=$ORDER(ABMBAL(ABMBA))
IF ABMBA=""
QUIT
Begin DoDot:2
+37 ;W !?5,$P($T(@ABMBA),";;",2) ;abm*2.6*11 insurer type
+38 ;abm*2.6*11 insurer type
WRITE !?5,$$INSTYP(ABMBA)
+39 WRITE !?10,"- Cancelled Claims",?33,+$GET(ABMBAL(ABMBA,"CCLMS"))
+40 WRITE !?10,"- Approved Bills",?33,+$GET(ABMBAL(ABMBA,"ABILLS")),?40,"$",$JUSTIFY($FNUMBER(+$GET(ABMBAL(ABMBA,"ABAMT")),",",2),10)
+41 IF ABMTRIBL=1
IF (+$GET(ABMBAL(ABMBA,"EBILLS"))>0)
Begin DoDot:3
+42 WRITE " "
+43 WRITE $$EN^ABMVDF("RVN")_"(EXCL. ",ABMBAL(ABMBA,"EBILLS")
+44 WRITE $$EN^ABMVDF("RVN")_" @ "_$FNUMBER(+$GET(ABMBAL(ABMBA,"EBAMT")),",",2)_")"
+45 WRITE $$EN^ABMVDF("RVF")
End DoDot:3
+46 WRITE !?10,"- Cancelled Bills",?33,+$GET(ABMBAL(ABMBA,"CBILLS")),?40,"$",$JUSTIFY($FNUMBER(+$GET(ABMBAL(ABMBA,"CBAMT")),",",2),10)
End DoDot:2
+47 WRITE !
+48 IF +$GET(ABMBLCNT)'=0
WRITE !?5,"REQUEUED BILLS: ",ABMBLCNT
+49 IF +$GET(ABMBTCNT)'=0
WRITE !?5,"REQUEUED EXPORTS: ",ABMBTCNT
+50 WRITE !!,ABMLINE
+51 WRITE !?2,"TOTAL CANCELLED CLAIMS:",?33,+$GET(ABMCCLMS)
+52 WRITE !?2,"TOTAL CANCELLED BILLS:",?33,+$GET(ABMCBILL),?40,"$",$JUSTIFY($FNUMBER(+$GET(ABMCBAMT),",",2),10)
+53 WRITE !?2,"TOTAL APPROVED:",?33,+$GET(ABMSBTOT),?40,"$",$JUSTIFY($FNUMBER(+$GET(ABMSATOT),",",2),10)
+54 IF (ABMTRIBL=1)
WRITE !?2,$$EN^ABMVDF("RVN"),"TOTAL EXCLUDED:",?33,+$GET(ABMEBILL),?40,"$",$JUSTIFY($FNUMBER(+$GET(ABMEBAMT),",",2),10),$$EN^ABMVDF("RVF")
+55 WRITE !
+56 IF +$PIECE($GET(^ABMUCASH(ABMLOC,10,DUZ,20,ABMFD,0)),U,11)'=0
Begin DoDot:2
+57 SET ABMBCNT=$PIECE($GET(^ABMUCASH(ABMLOC,10,DUZ,20,ABMFD,0)),U,11)
+58 WRITE !?3,"There "_$SELECT(ABMBCNT=1:"is ",1:"are "),$SELECT(+ABMBCNT=0:"no",1:ABMBCNT)," "_$SELECT(ABMBCNT=1:"claim/bill",1:"claims/bills")_" for beneficiary patients in this session that will ",!?3,"not be included in the expo
rt.",!
End DoDot:2
+59 KILL DIR,X,Y
+60 SET DIR(0)="Y"
+61 SET DIR("A")=" Do you wish to sign out now"
+62 SET DIR("B")="No"
+63 DO ^DIR
KILL DIR
+64 SET ABMSGNIO=+Y
+65 ;if yes, to signout
IF ABMSGNIO=1
Begin DoDot:2
+66 KILL DIR,X,Y
+67 WRITE !
+68 SET DIR("A",1)=" By signing out you are confirming the system balances."
+69 SET DIR("A")=" Are you sure you wish to sign out"
+70 SET DIR(0)="Y"
+71 DO ^DIR
KILL DIR
+72 ;if yes, confirmed signout
IF Y=1
Begin DoDot:3
+73 WRITE !!?5,"Done..."
+74 WRITE !?8,"the session ",ABMFD," will be sent to your manager for processing.",!
+75 WRITE !?5,"Signing out of session ",ABMFD,!
+76 DO CLOSESES^ABMUCUTL(ABMLOC,DUZ,ABMFD)
End DoDot:3
End DoDot:2
+77 ;view detail?
+78 WRITE !
+79 KILL DIR,X,Y
+80 SET DIR("A")="View detail"
+81 SET DIR(0)="Y"
+82 DO ^DIR
KILL DIR
+83 IF Y=1
DO SEL
+84 ;
+85 ;if no, don't sign out
IF ABMSGNIO=0
Begin DoDot:2
+86 WRITE !
+87 KILL DIR,X,Y
+88 SET DIR("A")="Do you wish to print the productivity report"
+89 SET DIR(0)="Y"
+90 DO ^DIR
KILL DIR
+91 ;do productivity report (PRRP)
IF Y=1
DO ^ABMDRPR
End DoDot:2
End DoDot:1
+92 SET DIR(0)="E"
SET DIR("A")="Enter RETURN to Continue"
DO ^DIR
KILL DIR
+93 QUIT
CASHTOT(ABMDUZ) ;EP - cnt claims/bills & amts for sess
+1 ;cancelled clms
+2 KILL ABMCCLMS
+3 SET ABMLOC=$$FINDLOC^ABMUCUTL
+4 SET ABMTRIBL=$PIECE($GET(^ABMDPARM(ABMLOC,1,4)),U,14)
+5 SET ABMBA=0
+6 FOR
SET ABMBA=$ORDER(^ABMUCASH(ABMLOC,10,ABMDUZ,20,ABMFD,11,ABMBA))
IF +ABMBA=0
QUIT
Begin DoDot:1
+7 SET ABMBDAC=$PIECE($GET(^ABMUCASH(ABMLOC,10,ABMDUZ,20,ABMFD,11,ABMBA,0)),U)
+8 SET ABMCDFN=0
+9 FOR
SET ABMCDFN=$ORDER(^ABMUCASH(ABMLOC,10,ABMDUZ,20,ABMFD,11,ABMBA,1,ABMCDFN))
IF +ABMCDFN=0
QUIT
Begin DoDot:2
+10 SET ABMBAL(ABMBDAC,"CCLMS")=+$GET(ABMBAL(ABMBDAC,"CCLMS"))+1
+11 ;sess cntr
SET ABMCCLMS=+$GET(ABMCCLMS)+1
+12 ;tot cancelled clms (mult. sess)
SET ABMTCCLM=+$GET(ABMTCCLM)+1
End DoDot:2
End DoDot:1
+13 ;
+14 ;appr bills
+15 KILL ABMABILL,ABMABAMT
+16 KILL ABMEBILL,ABMEBAMT
+17 SET ABMBA=0
+18 FOR
SET ABMBA=$ORDER(^ABMUCASH(ABMLOC,10,ABMDUZ,20,ABMFD,11,ABMBA))
IF +ABMBA=0
QUIT
Begin DoDot:1
+19 SET ABMBDAC=$PIECE($GET(^ABMUCASH(ABMLOC,10,ABMDUZ,20,ABMFD,11,ABMBA,0)),U)
+20 SET ABMCDFN=0
+21 FOR
SET ABMCDFN=$ORDER(^ABMUCASH(ABMLOC,10,ABMDUZ,20,ABMFD,11,ABMBA,2,ABMCDFN))
IF +ABMCDFN=0
QUIT
Begin DoDot:2
+22 ;tot appr bills by B.A.
SET ABMBAL(ABMBDAC,"ABILLS")=+$GET(ABMBAL(ABMBDAC,"ABILLS"))+1
+23 ;tot appr bills
SET ABMABILL=+$GET(ABMABILL)+1
+24 SET ABMSBTOT=+$GET(ABMSBTOT)+1
+25 SET ABMDUZ2=$PIECE($GET(^ABMUCASH(ABMLOC,10,ABMDUZ,20,ABMFD,11,ABMBA,2,ABMCDFN,0)),U,2)
+26 SET ABMBDFN=$PIECE($GET(^ABMUCASH(ABMLOC,10,ABMDUZ,20,ABMFD,11,ABMBA,2,ABMCDFN,0)),U,3)
+27 SET ABMBAL(ABMBDAC,"ABAMT")=+$GET(ABMBAL(ABMBDAC,"ABAMT"))+($PIECE($GET(^ABMDBILL(ABMDUZ2,ABMBDFN,2)),U))
+28 SET ABMSATOT=(+$GET(ABMSATOT))+($PIECE($GET(^ABMDBILL(ABMDUZ2,ABMBDFN,2)),U))
+29 ;tot appr bill amt
SET ABMABAMT=$GET(ABMABAMT)+($PIECE($GET(^ABMDBILL(ABMDUZ2,ABMBDFN,2)),U))
+30 ;now check if bill is part of 3P UFMS Exclusion Table
+31 IF $$BILL^ABMUEAPI(ABMDUZ2,$PIECE($GET(^ABMUCASH(ABMLOC,10,ABMDUZ,20,ABMFD,11,ABMBA,2,ABMCDFN,0)),U,3))=1
QUIT
+32 SET ABMBAL(ABMBDAC,"EBILLS")=+$GET(ABMBAL(ABMBDAC,"EBILLS"))+1
+33 ;session tot
SET ABMEBILL=+$GET(ABMEBILL)+1
+34 ;tot bills (multiple sessions)
SET ABMTEBIL=+$GET(ABMTEBIL)+1
+35 SET ABMBAL(ABMBDAC,"EBAMT")=+$GET(ABMBAL(ABMBDAC,"EBAMT"))+($PIECE($GET(^ABMDBILL(ABMDUZ2,ABMBDFN,2)),U))
+36 ;sess tot
SET ABMEBAMT=+$GET(ABMEBAMT)+($PIECE($GET(^ABMDBILL(ABMDUZ2,ABMBDFN,2)),U))
+37 ;tot amt (mult. sess)
SET ABMTEBAM=+$GET(ABMTEBAM)+($PIECE($GET(^ABMDBILL(ABMDUZ2,ABMBDFN,2)),U))
End DoDot:2
End DoDot:1
+38 ;
+39 ;cancelled bills
+40 KILL ABMCBILL,ABMCBAMT
+41 SET ABMBA=0
+42 FOR
SET ABMBA=$ORDER(^ABMUCASH(ABMLOC,10,ABMDUZ,20,ABMFD,11,ABMBA))
IF +ABMBA=0
QUIT
Begin DoDot:1
+43 SET ABMBDAC=$PIECE($GET(^ABMUCASH(ABMLOC,10,ABMDUZ,20,ABMFD,11,ABMBA,0)),U)
+44 SET ABMCDFN=0
+45 FOR
SET ABMCDFN=$ORDER(^ABMUCASH(ABMLOC,10,ABMDUZ,20,ABMFD,11,ABMBA,3,ABMCDFN))
IF +ABMCDFN=0
QUIT
Begin DoDot:2
+46 SET ABMBAL(ABMBDAC,"CBILLS")=+$GET(ABMBAL(ABMBDAC,"CBILLS"))+1
+47 ;session tot
SET ABMCBILL=$GET(ABMCBILL)+1
+48 ;tot bills (multiple sessions)
SET ABMTCBIL=+$GET(ABMTCBIL)+1
+49 SET ABMDUZ2=$PIECE($GET(^ABMUCASH(ABMLOC,10,ABMDUZ,20,ABMFD,11,ABMBA,3,ABMCDFN,0)),U,2)
+50 SET ABMBDFN=$PIECE($GET(^ABMUCASH(ABMLOC,10,ABMDUZ,20,ABMFD,11,ABMBA,3,ABMCDFN,0)),U,3)
+51 SET ABMBAL(ABMBDAC,"CBAMT")=+$GET(ABMBAL(ABMBDAC,"CBAMT"))+($PIECE($GET(^ABMDBILL(ABMDUZ2,ABMBDFN,2)),U))
+52 ;session tot
SET ABMCBAMT=+$GET(ABMCBAMT)+($PIECE($GET(^ABMDBILL(ABMDUZ2,ABMBDFN,2)),U))
+53 ;tot amt (multiple sessions)
SET ABMTCBAM=+$GET(ABMTCBAM)+($PIECE($GET(^ABMDBILL(ABMDUZ2,ABMBDFN,2)),U))
End DoDot:2
End DoDot:1
+54 ;
+55 ;cnt any requeued bills or batches (no detail)
+56 KILL ABMBLCNT,ABMBTCNT
+57 FOR ABMI=12,13
Begin DoDot:1
+58 SET ABMIEN=0
+59 FOR
SET ABMIEN=$ORDER(^ABMUCASH(ABMLOC,10,ABMDUZ,20,ABMFD,ABMI,ABMIEN))
IF +ABMIEN=0
QUIT
Begin DoDot:2
+60 IF ABMI=12
SET ABMBLCNT=+$GET(ABMBLCNT)+1
+61 IF ABMI=13
SET ABMBTCNT=+$GET(ABMBTCNT)+1
End DoDot:2
End DoDot:1
+62 QUIT
CASHTOTP ;EP - cnt POS claims
+1 DO CASHTOTP^ABMUUTL
+2 QUIT
SEL ;EP
+1 ;Select device
+2 SET %ZIS="NQ"
+3 SET %ZIS("A")="Enter DEVICE: "
+4 DO ^%ZIS
IF POP
QUIT
+5 IF IO'=IO(0)
DO QUE
DO HOME^%ZIS
SET DIR(0)="E"
DO ^DIR
KILL DIR
QUIT
+6 IF $DATA(IO("S"))
SET IOP=ION
DO ^%ZIS
+7 ;
PRINT ;EP
+1 ;Callable point for queuing
+2 SET ABME("PG")=0
+3 DO HD
+4 DO DETAIL
+5 WRITE !!,$$EN^ABMVDF("HIN"),"E N D O F R E P O R T",$$EN^ABMVDF("HIF"),!
+6 IF $EXTRACT(IOST)="C"
SET DIR(0)="E"
DO ^DIR
KILL DIR
+7 IF $EXTRACT(IOST)="P"
WRITE $$EN^ABMVDF("IOF")
+8 IF $DATA(IO("S"))
DO ^%ZISC
+9 KILL ABME
+10 QUIT
DETAIL ;EP - view session detail
+1 ;
+2 IF $GET(ABMDUZ)=""
SET ABMDUZ=DUZ
+3 KILL ABMCCLMS,ABMBAOUT
+4 SET ABMLOC=$$FINDLOC^ABMUCUTL
+5 ;"regular" claims
+6 IF +$GET(ABMDUZ)'=0
Begin DoDot:1
+7 SET ABMBA=0
+8 FOR
SET ABMBA=$ORDER(^ABMUCASH(ABMLOC,10,ABMDUZ,20,ABMFD,11,ABMBA))
IF +ABMBA=0
QUIT
Begin DoDot:2
+9 SET ABMBAOUT=$PIECE($GET(^ABMUCASH(ABMLOC,10,ABMDUZ,20,ABMFD,11,ABMBA,0)),U)
+10 FOR ABMLOOP=1:1:3
Begin DoDot:3
+11 SET ABMCDFN=0
+12 FOR
SET ABMCDFN=$ORDER(^ABMUCASH(ABMLOC,10,ABMDUZ,20,ABMFD,11,ABMBA,ABMLOOP,ABMCDFN))
IF +ABMCDFN=0
QUIT
Begin DoDot:4
+13 SET ABMCREC=$GET(^ABMUCASH(ABMLOC,10,ABMDUZ,20,ABMFD,11,ABMBA,ABMLOOP,ABMCDFN,0))
+14 SET ABMB(ABMBAOUT,ABMLOOP,ABMCDFN)=$PIECE(ABMCREC,U)_"^"_$PIECE(ABMCREC,U,2)_"^"_$PIECE(ABMCREC,U,3)
End DoDot:4
End DoDot:3
End DoDot:2
+15 ;
+16 ;cnt any requeued bills or batches (no detail)
+17 KILL ABMBLCNT,ABMBTCNT
+18 FOR ABMI=12,13
Begin DoDot:2
+19 SET ABMIEN=0
+20 FOR
SET ABMIEN=$ORDER(^ABMUCASH(ABMLOC,10,ABMDUZ,20,ABMFD,ABMI,ABMIEN))
IF +ABMIEN=0
QUIT
Begin DoDot:3
+21 SET ABMCREC=$GET(^ABMUCASH(ABMLOC,10,ABMDUZ,20,ABMFD,ABMI,ABMIEN,0))
+22 IF ABMI=12
SET ABMB(ABMI,ABMIEN)=$PIECE(ABMCREC,U)_"^"_$PIECE(ABMCREC,U,2)_"^"_$PIECE(ABMCREC,U,3)
+23 IF ABMI=13
SET ABMB(ABMI,ABMIEN)=$PIECE(ABMCREC,U)
End DoDot:3
End DoDot:2
End DoDot:1
+24 ;pos clms
+25 IF $GET(ABMDUZ)="POS"
SET ABMDUZ=1
Begin DoDot:1
+26 SET ABMBA=0
+27 FOR
SET ABMBA=$ORDER(^ABMUCASH(ABMLOC,20,ABMDUZ,20,ABMFD,11,ABMBA))
IF +ABMBA=0
QUIT
Begin DoDot:2
+28 SET ABMBAOUT=$PIECE($GET(^ABMUCASH(ABMLOC,20,ABMDUZ,20,ABMFD,11,ABMBA,0)),U)
+29 FOR ABMLOOP=1:1:3
Begin DoDot:3
+30 SET ABMCDFN=0
+31 FOR
SET ABMCDFN=$ORDER(^ABMUCASH(ABMLOC,20,ABMDUZ,20,ABMFD,11,ABMBA,ABMLOOP,ABMCDFN))
IF +ABMCDFN=0
QUIT
Begin DoDot:4
+32 SET ABMCREC=$GET(^ABMUCASH(ABMLOC,20,ABMDUZ,20,ABMFD,11,ABMBA,ABMLOOP,ABMCDFN,0))
+33 SET ABMB(ABMBAOUT,ABMLOOP,ABMCDFN)=$PIECE(ABMCREC,U)_"^"_$PIECE(ABMCREC,U,2)_"^"_$PIECE(ABMCREC,U,3)
End DoDot:4
End DoDot:3
End DoDot:2
End DoDot:1
+34 DO DTAILPRT
+35 QUIT
HD ;
+1 IF $GET(ABME("PG"))
IF $EXTRACT(IOST)="C"
SET DIR(0)="E"
DO ^DIR
KILL DIR
IF (IOST["C")&($GET(Y)<0)!($DATA(DIRUT)!$DATA(DIROUT)!$DATA(DTOUT)!$DATA(DUOUT))
QUIT
+2 SET ABME("PG")=+$GET(ABME("PG"))+1
+3 WRITE $$EN^ABMVDF("IOF")
+4 WRITE !,?23,$$EN^ABMVDF("HIN"),"UFMS VIEW CASHIERING SESSION DETAIL",?70,"Page: ",ABME("PG"),$$EN^ABMVDF("HIF")
+5 WRITE !,"SESSION ID: ",ABMFD,!
+6 IF ABMDUZ'=1
WRITE "BILLER: ",$PIECE($PIECE($GET(^VA(200,ABMDUZ,0)),U),",")_","_$EXTRACT($PIECE($PIECE($GET(^VA(200,ABMDUZ,0)),U),",",2),1),!
+7 IF ABMDUZ=1
WRITE "BILLER: POS CLAIMS"
+8 IF (ABMTRIBL=1)
WRITE !,"(*) Indicates bills that will be excluded from export"
+9 WRITE !
+10 WRITE !,"LOC",?5,"BILL#",?16,"HRN",?24,"PATIENT",?47,"APPROVE DT",?61,"DOS",?71,"BILL AMT"
+11 WRITE !
FOR ABMDASH=1:1:80
WRITE "-"
+12 QUIT
DTAILPRT ;
+1 IF '$DATA(ABMB)
WRITE !?5,"AT THIS TIME THERE IS NO BILLING ACTIVITY FOR THIS SESSION.",!
+2 SET ABMBAOUT=""
+3 FOR
SET ABMBAOUT=$ORDER(ABMB(ABMBAOUT))
IF ABMBAOUT=""
QUIT
Begin DoDot:1
+4 ;skip requeued bills/exports for now
IF ABMBAOUT=12!(ABMBAOUT=13)
QUIT
+5 ;W !!,$P($T(@ABMBAOUT^ABMUCASH),";;",2) ;abm*2.6*11 insurer type
+6 ;abm*2.6*11 insurer type
WRITE !!,$$INSTYP(ABMBAOUT)
+7 FOR ABMI=1:1:3
Begin DoDot:2
+8 IF ABMI=1
IF (+$GET(ABMBAL(ABMBAOUT,"CCLMS"))'=0)
WRITE !?2,"-CANCELLED CLAIMS - ",+$GET(ABMBAL(ABMBAOUT,"CCLMS"))
+9 IF ABMI=2
IF (+$GET(ABMBAL(ABMBAOUT,"ABILLS"))'=0)
Begin DoDot:3
+10 WRITE !?2,"-APPROVED BILLS - ",+$GET(ABMBAL(ABMBAOUT,"ABILLS"))
+11 WRITE ?25," $",$JUSTIFY($FNUMBER(+$GET(ABMBAL(ABMBAOUT,"ABAMT")),",",2),10)
End DoDot:3
+12 IF ABMI=3
IF (+$GET(ABMBAL(ABMBAOUT,"CBILLS"))'=0)
Begin DoDot:3
+13 WRITE !?2,"-CANCELLED BILLS - ",+$GET(ABMBAL(ABMBAOUT,"CBILLS"))
+14 WRITE ?25,"$",$JUSTIFY($FNUMBER(+$GET(ABMBAL(ABMBAOUT,"CBAMT")),",",2),10)
End DoDot:3
+15 IF '$DATA(ABMB(ABMBAOUT,ABMI))
Begin DoDot:3
End DoDot:3
+16 SET ABMBIEN=0
+17 FOR
SET ABMBIEN=$ORDER(ABMB(ABMBAOUT,ABMI,ABMBIEN))
IF +ABMBIEN=0
QUIT
Begin DoDot:3
+18 SET ABMDUZ2=$PIECE(ABMB(ABMBAOUT,ABMI,ABMBIEN),U,2)
+19 SET ABMBDFN=$PIECE(ABMB(ABMBAOUT,ABMI,ABMBIEN),U,3)
+20 IF ABMI'=1
Begin DoDot:4
+21 SET ABME(21)=$PIECE($GET(^ABMDBILL(ABMDUZ2,ABMBDFN,2)),U)
+22 ;cnt bill amt
SET ABME(ABMBAOUT,"AMT")=$GET(ABME(ABMBAOUT,"AMT"))+(ABME(21))
+23 ;cnt total bills
SET ABME("CNT")=+$GET(ABME("CNT"))+1
+24 ;cnt tot bill amt
SET ABME("TOT")=+$GET(ABME("TOT"))+(ABME(21))
+25 SET ABME(71)=$$SDT^ABMDUTL($PIECE($GET(^ABMDBILL(ABMDUZ2,ABMBDFN,7)),U))
+26 SET ABME(1)=$PIECE($GET(^ABMDBILL(ABMDUZ2,ABMBDFN,0)),U)
+27 SET ABME(3)=$PIECE($GET(^ABMDBILL(ABMDUZ2,ABMBDFN,0)),U,3)
+28 SET ABME(5)=$PIECE($GET(^ABMDBILL(ABMDUZ2,ABMBDFN,0)),U,5)
+29 SET ABME(15)=$$SDT^ABMDUTL($PIECE($GET(^ABMDBILL(ABMDUZ2,ABMBDFN,1)),U,5))
+30 SET ABME("HRN")=$PIECE($GET(^AUPNPAT(+ABME(5),41,+ABMDUZ2,0)),U,2)
+31 SET ABME("SUFFIX")=$PIECE($GET(^ABMDPARM(ABMDUZ2,1,2)),U,4)
+32 WRITE !,ABME("SUFFIX"),?5,ABME(1),?16,ABME("HRN"),?24,$EXTRACT($PIECE($GET(^DPT(+ABME(5),0)),U),1,22),?47,ABME(15)
+33 WRITE ?58,ABME(71),?69,$JUSTIFY($FNUMBER(ABME(21),",",2),10)
+34 IF ABMTRIBL=1
Begin DoDot:5
+35 SET ABMP("XMIT")=$ORDER(^ABMDBILL(ABMDUZ2,ABMBDFN,69,"B",999999999),-1)
+36 IF +ABMP("XMIT")'=0
Begin DoDot:6
+37 SET ABMXMIT=$ORDER(^ABMDBILL(ABMDUZ2,ABMBDFN,69,"B",ABMP("XMIT"),0))
+38 ;excluded/tribal data
IF $PIECE($GET(^ABMDBILL(ABMDUZ2,ABMBDFN,69,ABMXMIT,0)),U,3)=1
WRITE "*"
End DoDot:6
+39 ;bill not transmitted yet
IF +ABMP("XMIT")=0
Begin DoDot:6
+40 ;excluded/tribal data
IF $$BILL^ABMUEAPI(ABMDUZ2,ABMBDFN)=0
WRITE "*"
End DoDot:6
End DoDot:5
End DoDot:4
+41 IF ABMI=1
Begin DoDot:4
+42 ;cnt tot bills
SET ABME("CNT")=+$GET(ABME("CNT"))+1
+43 SET ABME(21)=$$SDT^ABMDUTL($PIECE($GET(^ABMCCLMS(ABMDUZ2,ABMBDFN,0)),U,2))
+44 SET ABME(1)=ABMBDFN
+45 SET ABME(3)=$PIECE($GET(^ABMCCLMS(ABMDUZ2,ABMBDFN,0)),U,3)
+46 SET ABME(5)=$PIECE($GET(^ABMCCLMS(ABMDUZ2,ABMBDFN,0)),U)
+47 SET ABME(15)=$$SDT^ABMDUTL($PIECE($GET(^ABMCCLMS(ABMDUZ2,ABMBDFN,1)),U,5))
+48 SET ABME("HRN")=$PIECE($GET(^AUPNPAT(+ABME(5),41,+ABMDUZ2,0)),U,2)
+49 SET ABME("SUFFIX")=$PIECE($GET(^ABMDPARM(ABMDUZ2,1,2)),U,4)
+50 WRITE !,ABME("SUFFIX"),?4,ABME(1),?12,ABME("HRN"),?20,$PIECE($GET(^DPT(+ABME(5),0)),U),?47,ABME(15)
+51 WRITE ?58,ABME(21)
End DoDot:4
+52 IF $Y+5>IOSL
DO HD
IF (IOST["C")&($GET(Y)<0)
QUIT
End DoDot:3
IF +$GET(Y)=0&(IOST["C")
QUIT
End DoDot:2
IF +$GET(Y)=0&(IOST["C")
QUIT
End DoDot:1
IF +$GET(Y)=0&(IOST["C")
QUIT
+53 ;
+54 KILL ABMBLCNT,ABMBTCNT
+55 WRITE !
+56 FOR ABMI=12,13
Begin DoDot:1
+57 IF ABMI=12
IF $DATA(ABMB(ABMI))
Begin DoDot:2
+58 WRITE !,"REQUEUED BILLS - "
+59 SET ABMJ=0
+60 FOR
SET ABMJ=$ORDER(ABMB(ABMI,ABMJ))
IF +ABMJ=0
QUIT
Begin DoDot:3
+61 SET ABMDUZ2=$PIECE(ABMB(ABMI,ABMJ),U,2)
+62 SET ABMBDFN=$PIECE(ABMB(ABMI,ABMJ),U,3)
+63 SET ABME(21)=$PIECE($GET(^ABMDBILL(ABMDUZ2,ABMBDFN,2)),U)
+64 SET ABME(71)=$$SDT^ABMDUTL($PIECE($GET(^ABMDBILL(ABMDUZ2,ABMBDFN,7)),U))
+65 SET ABME(1)=$PIECE($GET(^ABMDBILL(ABMDUZ2,ABMBDFN,0)),U)
+66 SET ABME(3)=$PIECE($GET(^ABMDBILL(ABMDUZ2,ABMBDFN,0)),U,3)
+67 SET ABME(5)=$PIECE($GET(^ABMDBILL(ABMDUZ2,ABMBDFN,0)),U,5)
+68 SET ABME(15)=$$SDT^ABMDUTL($PIECE($GET(^ABMDBILL(ABMDUZ2,ABMBDFN,1)),U,5))
+69 SET ABME("HRN")=$PIECE($GET(^AUPNPAT(+ABME(5),41,+ABMDUZ2,0)),U,2)
+70 SET ABME("SUFFIX")=$PIECE($GET(^ABMDPARM(ABMDUZ2,1,2)),U,4)
+71 WRITE !,ABME("SUFFIX"),?5,ABME(1),?16,ABME("HRN"),?24,$EXTRACT($PIECE($GET(^DPT(+ABME(5),0)),U),1,22),?47,ABME(15)
+72 WRITE ?58,ABME(71),?69,$JUSTIFY($FNUMBER(ABME(21),",",2),10)
End DoDot:3
+73 IF $Y+5>IOSL
DO HD
IF Y=0
QUIT
End DoDot:2
+74 IF ABMI=13
IF $DATA(ABMB(ABMI))
Begin DoDot:2
+75 WRITE !,"REQUEUED EXPORTS - "
+76 SET ABMJ=0
+77 FOR
SET ABMJ=$ORDER(ABMB(ABMI,ABMJ))
IF +ABMJ=0
QUIT
Begin DoDot:3
+78 SET ABMEIEN=$GET(ABMB(ABMI,ABMJ))
+79 SET ABMEDT=$$CDT^ABMDUTL($PIECE($GET(^ABMUTXMT(ABMEIEN,0)),U))
+80 SET ABMFNM=$PIECE($GET(^ABMUTXMT(ABMEIEN,0)),U,2)
+81 WRITE !,ABMEDT,?20,ABMFNM
End DoDot:3
+82 IF $Y+5>IOSL
DO HD
IF Y=0
QUIT
End DoDot:2
End DoDot:1
+83 QUIT
QUE ;QUE TO TASKMAN
+1 SET ZTRTN="PRINT^ABMUCASH"
+2 SET ZTDESC="3P UFMS VIEW CASHIERING SESSION DETAIL"
+3 SET ZTSAVE("ABM*")=""
+4 KILL ZTSK
+5 DO ^%ZTLOAD
+6 IF $GET(ZTSK)
WRITE !,"Task # ",ZTSK," queued.",!
+7 QUIT
+8 ;
+9 ;start new code abm*2.6*11 insurer type
INSTYP(X) ;PEP - returns insurer type name
+1 ; X = CODE (1)
+2 NEW ABMINS,ABMITYP
+3 SET ABMINS=$ORDER(^AUTTINTY("C",X,0))
+4 SET ABMITYP=$$GET1^DIQ(9999999.181,ABMINS,".01","E")
+5 QUIT ABMITYP
+6 ;end new code insurer type