ABMURCN1 ; IHS/SD/SDR - 3PB/UFMS Reconcile Sessions Option
;;2.6;IHS Third Party Billing;**1,8,19**;NOV 12, 2009;Build 300
;
; New routine - v2.5 p12 SDD item 4.9.2.4
; Reconcile Sessions Option
;
;IHS/SD/SDR - 2.6*19 - HEAT160514 - When exporting wasn't capturing session correctly if user
; had IEN less than the number of users being exported (if the user IEN is 8 but 10 sessions
; are being exported).
;
W !!,"The following SESSIONS are currently "_ABMFLG_" =>",!
W !?3,"(*) Indicates no activity in session.",!!
W ?6,"SESSION ID",?18,"CASHIER",?47,"DATE "_$S(ABMFLG="OPEN":"OPENED",1:ABMFLG)
I ABMFLG["CLOSE" W ?68,"STATUS"
W !
S $P(ABMLINE,"-",80)=""
W ABMLINE,!
Q
VIEWLIST ;EP
S ABMS=0,ABMSCNT=0
F S ABMS=$O(ABMO(ABMS)) Q:+ABMS=0 D
.S ABMSDUZ=""
.F S ABMSDUZ=$O(ABMO(ABMS,ABMSDUZ)) Q:ABMSDUZ="" D
..S ABMSDT=0
..F S ABMSDT=$O(ABMO(ABMS,ABMSDUZ,ABMSDT)) Q:+ABMSDT=0 D
...S ABMSCNT=ABMSCNT+1
...W ABMSCNT_"."
...W ?5,ABMSDT
...W ?21,$S(+ABMSDUZ:$E($P($G(^VA(200,ABMSDUZ,0)),U),1,24),1:"POS CLAIMS")
...W ?47,$$CDT^ABMDUTL(ABMSDT)
...I $P($G(ABMO(ABMS,ABMSDUZ,ABMSDT)),U)'="" D
....S ABMST=$P($G(ABMO(ABMS,ABMSDUZ,ABMSDT)),U)
....W ?68,$S(ABMST="O":"OPEN",ABMST="C":"CLOSED",ABMST="R":"RECONCILED",1:"TRANSMITTED")
...S ABMOS(ABMSCNT)=ABMS_"^"_ABMSDUZ_"^"_ABMSDT_"^"_$G(ABMO(ABMS,ABMSDUZ,ABMSDT))
...I +ABMSDUZ'=0,(+$P($G(ABMO(ABMS,ABMSDUZ,ABMSDT)),U,3)'=1) W ?79,"*"
...W !
I $D(ABMOS),(ABMSCNT>1) D
.S ABMSCNT=ABMSCNT+1
.W !,ABMSCNT_". ",?6,$S($G(ABMFLG)="CLOSED":"RECONCILE",1:"CLOSE")_" ALL SESSIONS"
Q
SELSESS ;SEL SESSIONS
K ABMY("SESS")
;S DIR(0)="NO" ;abm*2.6*1 HEAT5977
S DIR(0)="NO^1:"_ABMSCNT_"" ;abm*2.6*1 HEAT5977
S DIR("A")="Session number or ""^"" to not select any sessions"
F D Q:+Y<1!(Y=ABMSCNT)
.I '$D(ABMY("SESS")) S DIR("B")=ABMSCNT
.;I $D(ABMY("SESS")),'$D(ABMY("SESS",ABMSCNT)) S DIR("A")="Select another session",DIR(0)="NO^1:"_(ABMSCNT-1) K DIR("B") ;abm*2.6*1 HEAT5977
.I $D(ABMY("SESS")),'$D(ABMY("SESS",ABMSCNT)) S DIR("A")="Select another session",DIR(0)="NO^1:"_(ABMSCNT-1)_"" K DIR("B") ;abm*2.6*1 HEAT5977
.D ^DIR K DIR
.Q:+Y<0
.Q:$D(DUOUT)!$D(DTOUT)!$D(DIRUT)!$D(DIROUT)
.S ABMY("SESS",Y)=""
I '$D(ABMY("SESS")) D
.I $D(DUOUT)!$D(DTOUT)!$D(DIRUT)!$D(DIROUT) Q
K DIR
Q
VIEWSEL ;EP - view selected sessions for reconciliation
W !!,"The following SESSIONS have been selected for Reconciliation =>",!
W !?3,"(*) Indicates no activity in session.",!!
W ?6,"SESSION ID",?18,"CASHIER",?47,"DATE OPENED"
W !
S $P(ABMLINE,"-",80)=""
W ABMLINE,!
I $D(ABMY("SESS",ABMSCNT)),(ABMSCNT>1) D ;they said all; put all sessions in selection array
.F ABMI=1:1:(ABMSCNT-1) S ABMY("SESS",ABMI)=""
.K ABMY("SESS",ABMSCNT)
S ABMI=0,ABMSCNT=0
F S ABMI=$O(ABMC(ABMI)) Q:+ABMI=0 D
.S ABMSDUZ=""
.F S ABMSDUZ=$O(ABMC(ABMI,ABMSDUZ)) Q:ABMSDUZ="" D
..S ABMSDT=0
..F S ABMSDT=$O(ABMC(ABMI,ABMSDUZ,ABMSDT)) Q:+ABMSDT=0 D
...S ABMSCNT=ABMSCNT+1
...W ABMSCNT_"."
...W ?5,ABMSDT
...W ?21,$S(+ABMSDUZ:$E($P($G(^VA(200,ABMSDUZ,0)),U),1,24),1:"POS CLAIMS")
...W ?47,$$CDT^ABMDUTL(ABMSDT)
...I $P($G(ABMC(ABMI,ABMSDUZ,ABMSDT)),U)'="" D
....S ABMST=$P($G(ABMC(ABMI,ABMSDUZ,ABMSDT)),U)
....W ?68,$S(ABMST="O":"OPEN",ABMST="C":"CLOSED",ABMST="R":"RECONCILED",1:"TRANSMITTED")
...I +ABMSDUZ'=0,(+$P($G(ABMC(ABMI,ABMSDUZ,ABMSDT)),U,3)'=1) W ?79,"*"
...W !
I '$D(ABMC) W ?5,"NO CLOSED SESSIONS"
W !,ABMLINE
S ABMI=0
F S ABMI=$O(ABMY("SESS",ABMI)) Q:+ABMI=0 D
.S ABMREC=$G(ABMOS(ABMI))
.W !
.W ?2,ABMI,".",?5,$P(ABMREC,U)
.W ?21,$S(+$P(ABMREC,U,2)'=0:$P($G(^VA(200,$P(ABMREC,U,2),0)),U),1:"POS CLAIMS")
.W ?47,$$CDT^ABMDUTL($P(ABMREC,U,3))
.I +$P(ABMREC,U,2)'=0,(+$P($G(ABMO($P(ABMREC,U),$P(ABMREC,U,2),$P(ABMREC,U))),U,3)'=1) W ?79,"*"
W !
Q
CLOSE ;EP
W !
S ABMJ=0
F S ABMJ=$O(ABMY("SESS",ABMJ)) Q:+ABMJ=0 D
.S ABMREC=$G(ABMOS(ABMJ))
.S ABMSESS=$P(ABMREC,U)
.S ABMDUZ=$P(ABMREC,U,2)
.S ABMFD=$P(ABMREC,U,3)
.D:ABMDUZ EP^ABMXUS9 ;check if user is signed in and in TPB
.I $G(ABMOPFLG)=1 D Q
..W !,"User "_$P($G(^VA(200,ABMDUZ,0)),U)_" with session ID "_ABMSESS
..W " is still signed into TPB so their session will not be closed."
.D:ABMDUZ CASHTOT^ABMUCASH(ABMDUZ) ;count claims/bills for session
.D:'ABMDUZ CASHTOTP^ABMUCASH
.D CLOSESES^ABMUCUTL(ABMLOC,ABMDUZ,ABMFD)
.S ABMC(ABMSESS,ABMDUZ,ABMFD)="C"
.S ABMAFLG=$$ACTIVCK^ABMUUTL(ABMLOC,ABMFD,ABMDUZ)
.I ABMAFLG'=0 S $P(ABMC(ABMSESS,ABMDUZ,ABMFD),U,3)=1
Q
CREATBTH ;EP - create UFMS export entry
S DIC="^ABMUTXMT("
S DIC("DR")=".02////"_ABMFILE_";.03////"_DUZ_";.04////"_ABMLOC
S DIC(0)="L"
D NOW^%DTC
S X=%
D ^DIC
K DIC
Q:Y<0
S ABMPXMIT=+Y
Q
PRINTSUM ;EP - print sum?
K DIR
S DIR(0)="Y"
S DIR("A")="Print summary screen"
D ^DIR K DIR
S ABMXANS=+Y
Q:ABMXANS=0 ;no, don't print
S ABMQ("RX")="XIT^ABMURCON"
S ABMQ("NS")="ABM"
S ABMQ("RP")="XSUMDISP^ABMURCON"
D ^ABMDRDBQ
Q
BATCH ;EP - put bill entry in batch file
;user
K DIC,DIE,DIR,X,Y,DA
S DA(1)=ABMPXMIT
I ABMDUZ D
.S DIC="^ABMUTXMT("_DA(1)_",1,"
.S DIC("P")=$P(^DD(9002274.46,1,0),U,2)
.;S X="`"_ABMDUZ ;abm*2.6*19 IHS/SD/SDR HEAT160514
.S X=$$GET1^DIQ(200,ABMDUZ,".01","E") ;abm*2.6*19 IHS/SD/SDR HEAT160514
I 'ABMDUZ D
.S DIC="^ABMUTXMT("_DA(1)_",2,"
.S DIC("P")=$P(^DD(9002274.46,2,0),U,2)
.S X=1
S DIC(0)="L"
D ^DIC
Q:+Y<0
;sign in date
K DIC,DIE,X,Y,DA
S DA(2)=ABMPXMIT
I ABMDUZ D
.S DA(1)=ABMDUZ
.S DIC="^ABMUTXMT("_DA(2)_",1,"_DA(1)_",2,"
I 'ABMDUZ D
.S DA(1)=1
.S DIC="^ABMUTXMT("_DA(2)_",2,"_DA(1)_",2,"
S (X,DINUM)=ABMSDT
S DIC(0)="L"
S DIC("DR")=".02////"_ABMSDT
D ^DIC
Q:+Y<0
;budget activity
K DIC,DIE,X,Y,DA
S DA(3)=ABMPXMIT
S DA(2)=$S(ABMDUZ:ABMDUZ,1:1)
S DA(1)=ABMSDT
I ABMDUZ S DIC="^ABMUTXMT("_DA(3)_",1,"_DA(2)_",2,"_DA(1)_",11,"
I 'ABMDUZ S DIC="^ABMUTXMT("_DA(3)_",2,"_DA(2)_",2,"_DA(1)_",11,"
S X=ABMBAOUT
;S DIC(0)="L" ;abm*2.6*8 HEAT28427
S DIC(0)="LMX" ;abm*2.6*8 HEAT28427
D ^DIC
Q:+Y<0
S ABMBCHBA=+Y
;bills
K DIC,DIE,X,Y,DA
S DA(4)=ABMPXMIT
S DA(3)=$S(ABMDUZ:ABMDUZ,1:1)
S DA(2)=ABMSDT
S DA(1)=ABMBCHBA
I ABMDUZ S DIC="^ABMUTXMT("_DA(4)_",1,"_DA(3)_",2,"_DA(2)_",11,"_DA(1)_",2,"
I 'ABMDUZ S DIC="^ABMUTXMT("_DA(4)_",2,"_DA(3)_",2,"_DA(2)_",11,"_DA(1)_",2,"
S X=$P(ABMPREC,U)
S DIC(0)="L"
S DIC("DR")=".02////"_$P(ABMPREC,U,2)_";.03////"_$P(ABMPREC,U,3)
S DIC("DR")=DIC("DR")_";.04////"_+$P($G(^ABMDBILL($P(ABMPREC,U,2),$P(ABMPREC,U,3),2)),U)
I ABMEXCLD<1 S DIC("DR")=DIC("DR")_";.05////1" ;excluded data
D ^DIC
Q
REEXPB ;EP - put re-export entry in batch file
;user
K DIC,DIE,DIR,X,Y,DA
S DA(1)=ABMPXMIT
S DIC="^ABMUTXMT("_DA(1)_",1,"
S DIC("P")=$P(^DD(9002274.46,1,0),U,2)
S X="`"_ABMDUZ
S DIC(0)="L"
D ^DIC
Q:+Y<0
;sign in date
K DIC,DIE,X,Y,DA
S DA(2)=ABMPXMIT
S DA(1)=ABMDUZ
S DIC="^ABMUTXMT("_DA(2)_",1,"_DA(1)_",2,"
S (X,DINUM)=ABMSDT
S DIC(0)="L"
S DIC("DR")=".02////"_ABMSDT
D ^DIC
Q:+Y<0
;
;re-export IEN
K DIC,DIE,X,Y,DA
S DA(3)=ABMPXMIT
S DA(2)=ABMDUZ
S DA(1)=ABMSDT
I ABMDUZ S DIC="^ABMUTXMT("_DA(3)_",1,"_DA(2)_",2,"_DA(1)_",3,"
I 'ABMDUZ S DIC="^ABMUTXMT("_DA(3)_",2,"_DA(2)_",2,"_DA(1)_",3,"
S X=ABMPBTCH
S DIC(0)="L"
D ^DIC
Q:+Y<0
S ABMREXP=+Y
Q
BILL ;EP - put entry in bill multiple for transmit date and save UFMS invoice#
;transmit date
S ABMHOLD=DUZ(2)
S DUZ(2)=$P(ABMPREC,U,2)
K DIC,DIE,X,Y,DA
S DIC(0)="L"
S DA(1)=ABMP("BDFN")
S DIC="^ABMDBILL(DUZ(2),"_DA(1)_",69,"
S DIC("P")=$P(^DD(9002274.4,69,0),U,2)
S X=ABMPXMIT ;date from batch
S DIC("DR")=".02////"_ABMPASUF_ABMSASUF_$S(+$G(ABMUAOF)'=0:$P($G(^AUTTLOC(ABMP("LDFN"),0)),U,7),1:"")_ABMP("BDFN")
I ABMEXCLD<1 S DIC("DR")=DIC("DR")_";.03////1" ;excluded data
D ^DIC
S DUZ(2)=ABMHOLD
Q
NOSEND ;EP - don't send but mark as reconciled
W !,"Sessions will be marked as reconciled..."
F S ABMSESS=$O(ABMC(ABMSESS)) Q:+ABMSESS=0 D
.S ABMDUZ=""
.F S ABMDUZ=$O(ABMC(ABMSESS,ABMDUZ)) Q:ABMDUZ="" D
..S ABMSDT=0
..F S ABMSDT=$O(ABMC(ABMSESS,ABMDUZ,ABMSDT)) Q:+ABMSDT=0 D
...I ABMDUZ D
....D RCONSESS
...I 'ABMDUZ D ;POS CLAIMS
....S ABMUSER=0
....F S ABMUSER=$O(^ABMUCASH(ABMLOC,20,ABMUSER)) Q:+ABMUSER=0 D
.....D RCONSESS
D PRINTSUM^ABMURCON
W !,"EXITING Reconcile sessions option..."
Q
RCONSESS ;EP - mark session as transmitted
K DIC,DIE,DA,DR,X,Y
S DA(2)=DUZ(2)
S DA(1)=$S(ABMDUZ:ABMDUZ,1:1)
S:ABMDUZ DIE="^ABMUCASH("_DA(2)_",10,"_DA(1)_",20,"
S:'ABMDUZ DIE="^ABMUCASH("_DA(2)_",20,"_DA(1)_",20,"
S DA=ABMSDT
S DR=".04///R;.07///NOW" ;reconciled status w/date
D ^DIE
Q
ABMURCN1 ; IHS/SD/SDR - 3PB/UFMS Reconcile Sessions Option
+1 ;;2.6;IHS Third Party Billing;**1,8,19**;NOV 12, 2009;Build 300
+2 ;
+3 ; New routine - v2.5 p12 SDD item 4.9.2.4
+4 ; Reconcile Sessions Option
+5 ;
+6 ;IHS/SD/SDR - 2.6*19 - HEAT160514 - When exporting wasn't capturing session correctly if user
+7 ; had IEN less than the number of users being exported (if the user IEN is 8 but 10 sessions
+8 ; are being exported).
+9 ;
+1 WRITE !!,"The following SESSIONS are currently "_ABMFLG_" =>",!
+2 WRITE !?3,"(*) Indicates no activity in session.",!!
+3 WRITE ?6,"SESSION ID",?18,"CASHIER",?47,"DATE "_$SELECT(ABMFLG="OPEN":"OPENED",1:ABMFLG)
+4 IF ABMFLG["CLOSE"
WRITE ?68,"STATUS"
+5 WRITE !
+6 SET $PIECE(ABMLINE,"-",80)=""
+7 WRITE ABMLINE,!
+8 QUIT
VIEWLIST ;EP
+1 SET ABMS=0
SET ABMSCNT=0
+2 FOR
SET ABMS=$ORDER(ABMO(ABMS))
IF +ABMS=0
QUIT
Begin DoDot:1
+3 SET ABMSDUZ=""
+4 FOR
SET ABMSDUZ=$ORDER(ABMO(ABMS,ABMSDUZ))
IF ABMSDUZ=""
QUIT
Begin DoDot:2
+5 SET ABMSDT=0
+6 FOR
SET ABMSDT=$ORDER(ABMO(ABMS,ABMSDUZ,ABMSDT))
IF +ABMSDT=0
QUIT
Begin DoDot:3
+7 SET ABMSCNT=ABMSCNT+1
+8 WRITE ABMSCNT_"."
+9 WRITE ?5,ABMSDT
+10 WRITE ?21,$SELECT(+ABMSDUZ:$EXTRACT($PIECE($GET(^VA(200,ABMSDUZ,0)),U),1,24),1:"POS CLAIMS")
+11 WRITE ?47,$$CDT^ABMDUTL(ABMSDT)
+12 IF $PIECE($GET(ABMO(ABMS,ABMSDUZ,ABMSDT)),U)'=""
Begin DoDot:4
+13 SET ABMST=$PIECE($GET(ABMO(ABMS,ABMSDUZ,ABMSDT)),U)
+14 WRITE ?68,$SELECT(ABMST="O":"OPEN",ABMST="C":"CLOSED",ABMST="R":"RECONCILED",1:"TRANSMITTED")
End DoDot:4
+15 SET ABMOS(ABMSCNT)=ABMS_"^"_ABMSDUZ_"^"_ABMSDT_"^"_$GET(ABMO(ABMS,ABMSDUZ,ABMSDT))
+16 IF +ABMSDUZ'=0
IF (+$PIECE($GET(ABMO(ABMS,ABMSDUZ,ABMSDT)),U,3)'=1)
WRITE ?79,"*"
+17 WRITE !
End DoDot:3
End DoDot:2
End DoDot:1
+18 IF $DATA(ABMOS)
IF (ABMSCNT>1)
Begin DoDot:1
+19 SET ABMSCNT=ABMSCNT+1
+20 WRITE !,ABMSCNT_". ",?6,$SELECT($GET(ABMFLG)="CLOSED":"RECONCILE",1:"CLOSE")_" ALL SESSIONS"
End DoDot:1
+21 QUIT
SELSESS ;SEL SESSIONS
+1 KILL ABMY("SESS")
+2 ;S DIR(0)="NO" ;abm*2.6*1 HEAT5977
+3 ;abm*2.6*1 HEAT5977
SET DIR(0)="NO^1:"_ABMSCNT_""
+4 SET DIR("A")="Session number or ""^"" to not select any sessions"
+5 FOR
Begin DoDot:1
+6 IF '$DATA(ABMY("SESS"))
SET DIR("B")=ABMSCNT
+7 ;I $D(ABMY("SESS")),'$D(ABMY("SESS",ABMSCNT)) S DIR("A")="Select another session",DIR(0)="NO^1:"_(ABMSCNT-1) K DIR("B") ;abm*2.6*1 HEAT5977
+8 ;abm*2.6*1 HEAT5977
IF $DATA(ABMY("SESS"))
IF '$DATA(ABMY("SESS",ABMSCNT))
SET DIR("A")="Select another session"
SET DIR(0)="NO^1:"_(ABMSCNT-1)_""
KILL DIR("B")
+9 DO ^DIR
KILL DIR
+10 IF +Y<0
QUIT
+11 IF $DATA(DUOUT)!$DATA(DTOUT)!$DATA(DIRUT)!$DATA(DIROUT)
QUIT
+12 SET ABMY("SESS",Y)=""
End DoDot:1
IF +Y<1!(Y=ABMSCNT)
QUIT
+13 IF '$DATA(ABMY("SESS"))
Begin DoDot:1
+14 IF $DATA(DUOUT)!$DATA(DTOUT)!$DATA(DIRUT)!$DATA(DIROUT)
QUIT
End DoDot:1
+15 KILL DIR
+16 QUIT
VIEWSEL ;EP - view selected sessions for reconciliation
+1 WRITE !!,"The following SESSIONS have been selected for Reconciliation =>",!
+2 WRITE !?3,"(*) Indicates no activity in session.",!!
+3 WRITE ?6,"SESSION ID",?18,"CASHIER",?47,"DATE OPENED"
+4 WRITE !
+5 SET $PIECE(ABMLINE,"-",80)=""
+6 WRITE ABMLINE,!
+7 ;they said all; put all sessions in selection array
IF $DATA(ABMY("SESS",ABMSCNT))
IF (ABMSCNT>1)
Begin DoDot:1
+8 FOR ABMI=1:1:(ABMSCNT-1)
SET ABMY("SESS",ABMI)=""
+9 KILL ABMY("SESS",ABMSCNT)
End DoDot:1
+10 SET ABMI=0
SET ABMSCNT=0
+11 FOR
SET ABMI=$ORDER(ABMC(ABMI))
IF +ABMI=0
QUIT
Begin DoDot:1
+12 SET ABMSDUZ=""
+13 FOR
SET ABMSDUZ=$ORDER(ABMC(ABMI,ABMSDUZ))
IF ABMSDUZ=""
QUIT
Begin DoDot:2
+14 SET ABMSDT=0
+15 FOR
SET ABMSDT=$ORDER(ABMC(ABMI,ABMSDUZ,ABMSDT))
IF +ABMSDT=0
QUIT
Begin DoDot:3
+16 SET ABMSCNT=ABMSCNT+1
+17 WRITE ABMSCNT_"."
+18 WRITE ?5,ABMSDT
+19 WRITE ?21,$SELECT(+ABMSDUZ:$EXTRACT($PIECE($GET(^VA(200,ABMSDUZ,0)),U),1,24),1:"POS CLAIMS")
+20 WRITE ?47,$$CDT^ABMDUTL(ABMSDT)
+21 IF $PIECE($GET(ABMC(ABMI,ABMSDUZ,ABMSDT)),U)'=""
Begin DoDot:4
+22 SET ABMST=$PIECE($GET(ABMC(ABMI,ABMSDUZ,ABMSDT)),U)
+23 WRITE ?68,$SELECT(ABMST="O":"OPEN",ABMST="C":"CLOSED",ABMST="R":"RECONCILED",1:"TRANSMITTED")
End DoDot:4
+24 IF +ABMSDUZ'=0
IF (+$PIECE($GET(ABMC(ABMI,ABMSDUZ,ABMSDT)),U,3)'=1)
WRITE ?79,"*"
+25 WRITE !
End DoDot:3
End DoDot:2
End DoDot:1
+26 IF '$DATA(ABMC)
WRITE ?5,"NO CLOSED SESSIONS"
+27 WRITE !,ABMLINE
+28 SET ABMI=0
+29 FOR
SET ABMI=$ORDER(ABMY("SESS",ABMI))
IF +ABMI=0
QUIT
Begin DoDot:1
+30 SET ABMREC=$GET(ABMOS(ABMI))
+31 WRITE !
+32 WRITE ?2,ABMI,".",?5,$PIECE(ABMREC,U)
+33 WRITE ?21,$SELECT(+$PIECE(ABMREC,U,2)'=0:$PIECE($GET(^VA(200,$PIECE(ABMREC,U,2),0)),U),1:"POS CLAIMS")
+34 WRITE ?47,$$CDT^ABMDUTL($PIECE(ABMREC,U,3))
+35 IF +$PIECE(ABMREC,U,2)'=0
IF (+$PIECE($GET(ABMO($PIECE(ABMREC,U),$PIECE(ABMREC,U,2),$PIECE(ABMREC,U))),U,3)'=1)
WRITE ?79,"*"
End DoDot:1
+36 WRITE !
+37 QUIT
CLOSE ;EP
+1 WRITE !
+2 SET ABMJ=0
+3 FOR
SET ABMJ=$ORDER(ABMY("SESS",ABMJ))
IF +ABMJ=0
QUIT
Begin DoDot:1
+4 SET ABMREC=$GET(ABMOS(ABMJ))
+5 SET ABMSESS=$PIECE(ABMREC,U)
+6 SET ABMDUZ=$PIECE(ABMREC,U,2)
+7 SET ABMFD=$PIECE(ABMREC,U,3)
+8 ;check if user is signed in and in TPB
IF ABMDUZ
DO EP^ABMXUS9
+9 IF $GET(ABMOPFLG)=1
Begin DoDot:2
+10 WRITE !,"User "_$PIECE($GET(^VA(200,ABMDUZ,0)),U)_" with session ID "_ABMSESS
+11 WRITE " is still signed into TPB so their session will not be closed."
End DoDot:2
QUIT
+12 ;count claims/bills for session
IF ABMDUZ
DO CASHTOT^ABMUCASH(ABMDUZ)
+13 IF 'ABMDUZ
DO CASHTOTP^ABMUCASH
+14 DO CLOSESES^ABMUCUTL(ABMLOC,ABMDUZ,ABMFD)
+15 SET ABMC(ABMSESS,ABMDUZ,ABMFD)="C"
+16 SET ABMAFLG=$$ACTIVCK^ABMUUTL(ABMLOC,ABMFD,ABMDUZ)
+17 IF ABMAFLG'=0
SET $PIECE(ABMC(ABMSESS,ABMDUZ,ABMFD),U,3)=1
End DoDot:1
+18 QUIT
CREATBTH ;EP - create UFMS export entry
+1 SET DIC="^ABMUTXMT("
+2 SET DIC("DR")=".02////"_ABMFILE_";.03////"_DUZ_";.04////"_ABMLOC
+3 SET DIC(0)="L"
+4 DO NOW^%DTC
+5 SET X=%
+6 DO ^DIC
+7 KILL DIC
+8 IF Y<0
QUIT
+9 SET ABMPXMIT=+Y
+10 QUIT
PRINTSUM ;EP - print sum?
+1 KILL DIR
+2 SET DIR(0)="Y"
+3 SET DIR("A")="Print summary screen"
+4 DO ^DIR
KILL DIR
+5 SET ABMXANS=+Y
+6 ;no, don't print
IF ABMXANS=0
QUIT
+7 SET ABMQ("RX")="XIT^ABMURCON"
+8 SET ABMQ("NS")="ABM"
+9 SET ABMQ("RP")="XSUMDISP^ABMURCON"
+10 DO ^ABMDRDBQ
+11 QUIT
BATCH ;EP - put bill entry in batch file
+1 ;user
+2 KILL DIC,DIE,DIR,X,Y,DA
+3 SET DA(1)=ABMPXMIT
+4 IF ABMDUZ
Begin DoDot:1
+5 SET DIC="^ABMUTXMT("_DA(1)_",1,"
+6 SET DIC("P")=$PIECE(^DD(9002274.46,1,0),U,2)
+7 ;S X="`"_ABMDUZ ;abm*2.6*19 IHS/SD/SDR HEAT160514
+8 ;abm*2.6*19 IHS/SD/SDR HEAT160514
SET X=$$GET1^DIQ(200,ABMDUZ,".01","E")
End DoDot:1
+9 IF 'ABMDUZ
Begin DoDot:1
+10 SET DIC="^ABMUTXMT("_DA(1)_",2,"
+11 SET DIC("P")=$PIECE(^DD(9002274.46,2,0),U,2)
+12 SET X=1
End DoDot:1
+13 SET DIC(0)="L"
+14 DO ^DIC
+15 IF +Y<0
QUIT
+16 ;sign in date
+17 KILL DIC,DIE,X,Y,DA
+18 SET DA(2)=ABMPXMIT
+19 IF ABMDUZ
Begin DoDot:1
+20 SET DA(1)=ABMDUZ
+21 SET DIC="^ABMUTXMT("_DA(2)_",1,"_DA(1)_",2,"
End DoDot:1
+22 IF 'ABMDUZ
Begin DoDot:1
+23 SET DA(1)=1
+24 SET DIC="^ABMUTXMT("_DA(2)_",2,"_DA(1)_",2,"
End DoDot:1
+25 SET (X,DINUM)=ABMSDT
+26 SET DIC(0)="L"
+27 SET DIC("DR")=".02////"_ABMSDT
+28 DO ^DIC
+29 IF +Y<0
QUIT
+30 ;budget activity
+31 KILL DIC,DIE,X,Y,DA
+32 SET DA(3)=ABMPXMIT
+33 SET DA(2)=$SELECT(ABMDUZ:ABMDUZ,1:1)
+34 SET DA(1)=ABMSDT
+35 IF ABMDUZ
SET DIC="^ABMUTXMT("_DA(3)_",1,"_DA(2)_",2,"_DA(1)_",11,"
+36 IF 'ABMDUZ
SET DIC="^ABMUTXMT("_DA(3)_",2,"_DA(2)_",2,"_DA(1)_",11,"
+37 SET X=ABMBAOUT
+38 ;S DIC(0)="L" ;abm*2.6*8 HEAT28427
+39 ;abm*2.6*8 HEAT28427
SET DIC(0)="LMX"
+40 DO ^DIC
+41 IF +Y<0
QUIT
+42 SET ABMBCHBA=+Y
+43 ;bills
+44 KILL DIC,DIE,X,Y,DA
+45 SET DA(4)=ABMPXMIT
+46 SET DA(3)=$SELECT(ABMDUZ:ABMDUZ,1:1)
+47 SET DA(2)=ABMSDT
+48 SET DA(1)=ABMBCHBA
+49 IF ABMDUZ
SET DIC="^ABMUTXMT("_DA(4)_",1,"_DA(3)_",2,"_DA(2)_",11,"_DA(1)_",2,"
+50 IF 'ABMDUZ
SET DIC="^ABMUTXMT("_DA(4)_",2,"_DA(3)_",2,"_DA(2)_",11,"_DA(1)_",2,"
+51 SET X=$PIECE(ABMPREC,U)
+52 SET DIC(0)="L"
+53 SET DIC("DR")=".02////"_$PIECE(ABMPREC,U,2)_";.03////"_$PIECE(ABMPREC,U,3)
+54 SET DIC("DR")=DIC("DR")_";.04////"_+$PIECE($GET(^ABMDBILL($PIECE(ABMPREC,U,2),$PIECE(ABMPREC,U,3),2)),U)
+55 ;excluded data
IF ABMEXCLD<1
SET DIC("DR")=DIC("DR")_";.05////1"
+56 DO ^DIC
+57 QUIT
REEXPB ;EP - put re-export entry in batch file
+1 ;user
+2 KILL DIC,DIE,DIR,X,Y,DA
+3 SET DA(1)=ABMPXMIT
+4 SET DIC="^ABMUTXMT("_DA(1)_",1,"
+5 SET DIC("P")=$PIECE(^DD(9002274.46,1,0),U,2)
+6 SET X="`"_ABMDUZ
+7 SET DIC(0)="L"
+8 DO ^DIC
+9 IF +Y<0
QUIT
+10 ;sign in date
+11 KILL DIC,DIE,X,Y,DA
+12 SET DA(2)=ABMPXMIT
+13 SET DA(1)=ABMDUZ
+14 SET DIC="^ABMUTXMT("_DA(2)_",1,"_DA(1)_",2,"
+15 SET (X,DINUM)=ABMSDT
+16 SET DIC(0)="L"
+17 SET DIC("DR")=".02////"_ABMSDT
+18 DO ^DIC
+19 IF +Y<0
QUIT
+20 ;
+21 ;re-export IEN
+22 KILL DIC,DIE,X,Y,DA
+23 SET DA(3)=ABMPXMIT
+24 SET DA(2)=ABMDUZ
+25 SET DA(1)=ABMSDT
+26 IF ABMDUZ
SET DIC="^ABMUTXMT("_DA(3)_",1,"_DA(2)_",2,"_DA(1)_",3,"
+27 IF 'ABMDUZ
SET DIC="^ABMUTXMT("_DA(3)_",2,"_DA(2)_",2,"_DA(1)_",3,"
+28 SET X=ABMPBTCH
+29 SET DIC(0)="L"
+30 DO ^DIC
+31 IF +Y<0
QUIT
+32 SET ABMREXP=+Y
+33 QUIT
BILL ;EP - put entry in bill multiple for transmit date and save UFMS invoice#
+1 ;transmit date
+2 SET ABMHOLD=DUZ(2)
+3 SET DUZ(2)=$PIECE(ABMPREC,U,2)
+4 KILL DIC,DIE,X,Y,DA
+5 SET DIC(0)="L"
+6 SET DA(1)=ABMP("BDFN")
+7 SET DIC="^ABMDBILL(DUZ(2),"_DA(1)_",69,"
+8 SET DIC("P")=$PIECE(^DD(9002274.4,69,0),U,2)
+9 ;date from batch
SET X=ABMPXMIT
+10 SET DIC("DR")=".02////"_ABMPASUF_ABMSASUF_$SELECT(+$GET(ABMUAOF)'=0:$PIECE($GET(^AUTTLOC(ABMP("LDFN"),0)),U,7),1:"")_ABMP("BDFN")
+11 ;excluded data
IF ABMEXCLD<1
SET DIC("DR")=DIC("DR")_";.03////1"
+12 DO ^DIC
+13 SET DUZ(2)=ABMHOLD
+14 QUIT
NOSEND ;EP - don't send but mark as reconciled
+1 WRITE !,"Sessions will be marked as reconciled..."
+2 FOR
SET ABMSESS=$ORDER(ABMC(ABMSESS))
IF +ABMSESS=0
QUIT
Begin DoDot:1
+3 SET ABMDUZ=""
+4 FOR
SET ABMDUZ=$ORDER(ABMC(ABMSESS,ABMDUZ))
IF ABMDUZ=""
QUIT
Begin DoDot:2
+5 SET ABMSDT=0
+6 FOR
SET ABMSDT=$ORDER(ABMC(ABMSESS,ABMDUZ,ABMSDT))
IF +ABMSDT=0
QUIT
Begin DoDot:3
+7 IF ABMDUZ
Begin DoDot:4
+8 DO RCONSESS
End DoDot:4
+9 ;POS CLAIMS
IF 'ABMDUZ
Begin DoDot:4
+10 SET ABMUSER=0
+11 FOR
SET ABMUSER=$ORDER(^ABMUCASH(ABMLOC,20,ABMUSER))
IF +ABMUSER=0
QUIT
Begin DoDot:5
+12 DO RCONSESS
End DoDot:5
End DoDot:4
End DoDot:3
End DoDot:2
End DoDot:1
+13 DO PRINTSUM^ABMURCON
+14 WRITE !,"EXITING Reconcile sessions option..."
+15 QUIT
RCONSESS ;EP - mark session as transmitted
+1 KILL DIC,DIE,DA,DR,X,Y
+2 SET DA(2)=DUZ(2)
+3 SET DA(1)=$SELECT(ABMDUZ:ABMDUZ,1:1)
+4 IF ABMDUZ
SET DIE="^ABMUCASH("_DA(2)_",10,"_DA(1)_",20,"
+5 IF 'ABMDUZ
SET DIE="^ABMUCASH("_DA(2)_",20,"_DA(1)_",20,"
+6 SET DA=ABMSDT
+7 ;reconciled status w/date
SET DR=".04///R;.07///NOW"
+8 DO ^DIE
+9 QUIT