ABMUVCSH ; IHS/SD/SDR - 3PB/UFMS View Cashiering Session Option
;;2.6;IHS 3P BILLING SYSTEM;**11,21**;NOV 12, 2009;Build 379
; New routine - v2.5 p12 SDD item 4.9.2.2
;IHS/SD/SDR - 2.6*21 - HEAT121470 - Updated to display all open, all closed, but only the limit of transmitted sessions
;
; View Cashiering Session
EP ;EP
D HEADER("OPEN")
S ABMSESSL="O" ;abm*2.6*21 IHS/SD/SDR HEAT121470
D FINDAOPN^ABMUCUTL
S ABMTRIBL=$P($G(^ABMDPARM(DUZ(2),1,4)),U,14)
I '$D(ABMO) W !?5,"There are NO open sessions at this time"
D VIEWLIST
K DIR,X,Y
W !!
I $D(ABMO) D
.S DIR(0)="NO^1:"_ABMSCNT
.S DIR("A")="Select Session Number to View: "
.D ^DIR K DIR
S ABMSESSL=+$G(Y)
I ABMSESSL'=0 D DISPLAY("opened") ;open session selected for view
I +$G(ABMSESSL)=0 D ;no open session selected; what about closed?
.W !!
.W !?1,"Other session statuses available for viewing"
.W !?1,"Enter list of session statuses to view or ""^"" to quit."
.W !!?4,"C - CLOSED"
.I $P($G(^ABMDPARM(DUZ(2),1,4)),U,14)=0 W !?4,"R - RECONCILED"
.I $P($G(^ABMDPARM(DUZ(2),1,4)),U,14)=1 W !?4,"T - TRANSMITTED"
.W !?4,"B - BOTH",!
.S DIR(0)="FO^0:3"
.S DIR("A")="Session statuses to view"
.D ^DIR K DIR
.Q:$D(DTOUT)!$D(DUOUT)!$D(DIRUT)!$D(DIROUT)
.S ABMBAD=0
.I Y="B"!(Y="b") S Y=$S($P($G(^ABMDPARM(DUZ(2),1,4)),U,14)=0:"CR",1:"CT")
.S ABMSESSL=Y
.I ABMSESSL="C" S ABMFLG="CLOSED" ;abm*2.6*21 IHS/SD/SDR HEAT121470
.F I=1:1:$L(Y) I ABMSESSL'[$E(Y,I) D Q
..W !!,"<<BAD ENTRY>> ",Y
..S ABMBAD=1
.Q:+ABMBAD
.;
.W !!
.D HEADER("CLOSED")
.D FINDACLS^ABMUCUTL
.I '$D(ABMO) W !?5,"There are NO sessions with a status of "_$S(ABMSESSL["RT":"RECONCILED and TRANSMITTED",ABMSESSL="R":"RECONCILED",1:"TRANSMITTED")_"at this time" S DIR(0)="E",DIR("A")="Enter RETURN to Continue" D ^DIR K DIR Q
.D VIEWLIST
.W !!
.K DIR
.S DIR(0)="NO^1:"_ABMSCNT
.S DIR("A")="Select Session Number to View: "
.D ^DIR K DIR
.S ABMSESSL=+Y
.I ABMSESSL'=0 D DISPLAY("closed") ;closed session selected for view
Q
W !!,"The following SESSIONS are currently "_ABMFLG_" =>"
W !!?3,"(*) Indicates no activity in session."
W !!?6,"SESSION ID",?19,"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 X1=DT
S X2="-"_$P($G(^ABMDPARM(DUZ(2),1,4)),U,16) ;display number of days limit
D C^%DTC
S ABMDLIMT=X
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
..;not supervisor; they can only view their own sessions
..I '$D(^XUSEC("ABMDZ UFMS SUPERVISOR",DUZ)),(ABMSDUZ'=DUZ) K ABMO(ABMS,ABMSDUZ) Q
..S ABMSDT=0
..F S ABMSDT=$O(ABMO(ABMS,ABMSDUZ,ABMSDT)) Q:+ABMSDT=0 D
...;Q:ABMSDT<ABMDLIMT ;abm*2.6*21 IHS/SD/SDR HEAT121470
...I "^O^C^"'[("^"_ABMSESSL_"^") Q:ABMSDT<ABMDLIMT ;abm*2.6*21 IHS/SD/SDR HEAT121470
...I $G(ABMSESSL)'="",(ABMSESSL'[$P($G(ABMO(ABMS,ABMSDUZ,ABMSDT)),U)) Q ;status selected and not part of selection
...S ABMSCNT=ABMSCNT+1
...W !,ABMSCNT_"."
...W ?4,ABMSDT
...W ?19,$S(+ABMSDUZ'=0:$E($P($G(^VA(200,ABMSDUZ,0)),U),1,26),1:"POS CLAIMS")
...W ?47,$$CDT^ABMDUTL($S($P($G(ABMO(ABMS,ABMSDUZ,ABMSDT)),U,2)'="":$P($G(ABMO(ABMS,ABMSDUZ,ABMSDT)),U,2),1:ABMSDT))
...I $P(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)=0) W ?79,"*" ;session doesn't have activity
Q
DISPLAY(ABMFLG) ;EP
W $$EN^ABMVDF("IOF")
S ABMLREC=$G(ABMOS(ABMSESSL))
S ABMS=$P(ABMLREC,U)
S ABMSDUZ=$P(ABMLREC,U,2)
S ABMSDT=$P(ABMLREC,U,3)
W !,"Session detail for Session ID: "_ABMSDT
W ?48,"Date ",ABMFLG,": ",$$CDT^ABMDUTL(ABMSDT)
W !,"Cashier: ",$S(+ABMSDUZ'=0:$P($G(^VA(200,ABMSDUZ,0)),U),1:"POS CLAIMS")
W !,ABMLINE
S ABMFD=ABMSDT
D:+ABMSDUZ CASHTOT^ABMUCASH(ABMSDUZ)
D:'ABMSDUZ CASHTOTP^ABMUCASH
S ABMBA=""
I '$D(ABMBAL)&(+ABMSDUZ) D Q
.W !?5,"AT THIS TIME THERE IS NO BILLING ACTIVITY FOR THIS SESSION.",!
.S DIR(0)="E",DIR("A")="Enter RETURN to Continue" D ^DIR K DIR
F S ABMBA=$O(ABMBAL(ABMBA)) Q:ABMBA="" D
.;W !?5,$P($T(@ABMBA^ABMUCASH),";;",2) ;abm*2.6*11 insurer type
.W !?5,$$INSTYP^ABMUCASH(ABMBA) ;abm*2.6*11 insurer type
.W !?15,"- Cancelled Claims",?40,+$G(ABMBAL(ABMBA,"CCLMS"))
.W !?15,"- Approved Bills",?40,+$G(ABMBAL(ABMBA,"ABILLS")),?50,"$",$J($FN(+$G(ABMBAL(ABMBA,"ABAMT")),",",2),10)
.I +$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 !?15,"- Cancelled Bills",?40,+$G(ABMBAL(ABMBA,"CBILLS")),?50,"$",$J($FN(+$G(ABMBAL(ABMBA,"CBAMT")),",",2),10)
W !
;requeued bills/batches
I +$G(ABMBLCNT)'=0 W !?3,ABMBLCNT_" "_$S(ABMBLCNT=1:"BILL has",1:"BILLS have")_" been requeued"
I +$G(ABMBTCNT)'=0 W !?3,ABMBTCNT_" "_$S(ABMBTCNT=1:"EXPORT has",1:"EXPORTS have")_" been requeued"
;ben pts
I +$P($G(^ABMUCASH(ABMLOC,10,ABMSDUZ,20,ABMFD,0)),U,11)'=0 D
.S ABMBCNT=$P($G(^ABMUCASH(ABMLOC,10,ABMSDUZ,20,ABMFD,0)),U,11)
.W !?3,"There is ",ABMBCNT," claims/bills for beneficiary patients in this session that will ",!?3,"not be included in the export.",!
;
K DIR
;view detail of session?
W !
K DIR,X,Y
S DIR("A")="View detail"
S DIR(0)="Y"
D ^DIR K DIR
S ABMDUZ=ABMSDUZ
I Y=1 D SEL^ABMUCASH
S DIR(0)="E",DIR("A")="Enter RETURN to Continue" D ^DIR K DIR
Q
ABMUVCSH ; IHS/SD/SDR - 3PB/UFMS View Cashiering Session Option
+1 ;;2.6;IHS 3P BILLING SYSTEM;**11,21**;NOV 12, 2009;Build 379
+2 ; New routine - v2.5 p12 SDD item 4.9.2.2
+3 ;IHS/SD/SDR - 2.6*21 - HEAT121470 - Updated to display all open, all closed, but only the limit of transmitted sessions
+4 ;
+5 ; View Cashiering Session
EP ;EP
+1 DO HEADER("OPEN")
+2 ;abm*2.6*21 IHS/SD/SDR HEAT121470
SET ABMSESSL="O"
+3 DO FINDAOPN^ABMUCUTL
+4 SET ABMTRIBL=$PIECE($GET(^ABMDPARM(DUZ(2),1,4)),U,14)
+5 IF '$DATA(ABMO)
WRITE !?5,"There are NO open sessions at this time"
+6 DO VIEWLIST
+7 KILL DIR,X,Y
+8 WRITE !!
+9 IF $DATA(ABMO)
Begin DoDot:1
+10 SET DIR(0)="NO^1:"_ABMSCNT
+11 SET DIR("A")="Select Session Number to View: "
+12 DO ^DIR
KILL DIR
End DoDot:1
+13 SET ABMSESSL=+$GET(Y)
+14 ;open session selected for view
IF ABMSESSL'=0
DO DISPLAY("opened")
+15 ;no open session selected; what about closed?
IF +$GET(ABMSESSL)=0
Begin DoDot:1
+16 WRITE !!
+17 WRITE !?1,"Other session statuses available for viewing"
+18 WRITE !?1,"Enter list of session statuses to view or ""^"" to quit."
+19 WRITE !!?4,"C - CLOSED"
+20 IF $PIECE($GET(^ABMDPARM(DUZ(2),1,4)),U,14)=0
WRITE !?4,"R - RECONCILED"
+21 IF $PIECE($GET(^ABMDPARM(DUZ(2),1,4)),U,14)=1
WRITE !?4,"T - TRANSMITTED"
+22 WRITE !?4,"B - BOTH",!
+23 SET DIR(0)="FO^0:3"
+24 SET DIR("A")="Session statuses to view"
+25 DO ^DIR
KILL DIR
+26 IF $DATA(DTOUT)!$DATA(DUOUT)!$DATA(DIRUT)!$DATA(DIROUT)
QUIT
+27 SET ABMBAD=0
+28 IF Y="B"!(Y="b")
SET Y=$SELECT($PIECE($GET(^ABMDPARM(DUZ(2),1,4)),U,14)=0:"CR",1:"CT")
+29 SET ABMSESSL=Y
+30 ;abm*2.6*21 IHS/SD/SDR HEAT121470
IF ABMSESSL="C"
SET ABMFLG="CLOSED"
+31 FOR I=1:1:$LENGTH(Y)
IF ABMSESSL'[$EXTRACT(Y,I)
Begin DoDot:2
+32 WRITE !!,"<<BAD ENTRY>> ",Y
+33 SET ABMBAD=1
End DoDot:2
QUIT
+34 IF +ABMBAD
QUIT
+35 ;
+36 WRITE !!
+37 DO HEADER("CLOSED")
+38 DO FINDACLS^ABMUCUTL
+39 IF '$DATA(ABMO)
WRITE !?5,"There are NO sessions with a status of "_$SELECT(ABMSESSL["RT":"RECONCILED and TRANSMITTED",ABMSESSL="R":"RECONCILED",1:"TRANSMITTED")_"at this time"
SET DIR(0)="E"
SET DIR("A")="Enter RETURN to Continue"
DO ^DIR
KILL DIR
QUIT
+40 DO VIEWLIST
+41 WRITE !!
+42 KILL DIR
+43 SET DIR(0)="NO^1:"_ABMSCNT
+44 SET DIR("A")="Select Session Number to View: "
+45 DO ^DIR
KILL DIR
+46 SET ABMSESSL=+Y
+47 ;closed session selected for view
IF ABMSESSL'=0
DO DISPLAY("closed")
End DoDot:1
+48 QUIT
+1 WRITE !!,"The following SESSIONS are currently "_ABMFLG_" =>"
+2 WRITE !!?3,"(*) Indicates no activity in session."
+3 WRITE !!?6,"SESSION ID",?19,"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 X1=DT
+2 ;display number of days limit
SET X2="-"_$PIECE($GET(^ABMDPARM(DUZ(2),1,4)),U,16)
+3 DO C^%DTC
+4 SET ABMDLIMT=X
+5 SET ABMS=0
SET ABMSCNT=0
+6 FOR
SET ABMS=$ORDER(ABMO(ABMS))
IF +ABMS=0
QUIT
Begin DoDot:1
+7 SET ABMSDUZ=""
+8 FOR
SET ABMSDUZ=$ORDER(ABMO(ABMS,ABMSDUZ))
IF ABMSDUZ=""
QUIT
Begin DoDot:2
+9 ;not supervisor; they can only view their own sessions
+10 IF '$DATA(^XUSEC("ABMDZ UFMS SUPERVISOR",DUZ))
IF (ABMSDUZ'=DUZ)
KILL ABMO(ABMS,ABMSDUZ)
QUIT
+11 SET ABMSDT=0
+12 FOR
SET ABMSDT=$ORDER(ABMO(ABMS,ABMSDUZ,ABMSDT))
IF +ABMSDT=0
QUIT
Begin DoDot:3
+13 ;Q:ABMSDT<ABMDLIMT ;abm*2.6*21 IHS/SD/SDR HEAT121470
+14 ;abm*2.6*21 IHS/SD/SDR HEAT121470
IF "^O^C^"'[("^"_ABMSESSL_"^")
IF ABMSDT<ABMDLIMT
QUIT
+15 ;status selected and not part of selection
IF $GET(ABMSESSL)'=""
IF (ABMSESSL'[$PIECE($GET(ABMO(ABMS,ABMSDUZ,ABMSDT)),U))
QUIT
+16 SET ABMSCNT=ABMSCNT+1
+17 WRITE !,ABMSCNT_"."
+18 WRITE ?4,ABMSDT
+19 WRITE ?19,$SELECT(+ABMSDUZ'=0:$EXTRACT($PIECE($GET(^VA(200,ABMSDUZ,0)),U),1,26),1:"POS CLAIMS")
+20 WRITE ?47,$$CDT^ABMDUTL($SELECT($PIECE($GET(ABMO(ABMS,ABMSDUZ,ABMSDT)),U,2)'="":$PIECE($GET(ABMO(ABMS,ABMSDUZ,ABMSDT)),U,2),1:ABMSDT))
+21 IF $PIECE(ABMO(ABMS,ABMSDUZ,ABMSDT),U)'=""
Begin DoDot:4
+22 SET ABMST=$PIECE($GET(ABMO(ABMS,ABMSDUZ,ABMSDT)),U)
+23 WRITE ?68,$SELECT(ABMST="O":"OPEN",ABMST="C":"CLOSED",ABMST="R":"RECONCILED",1:"TRANSMITTED")
End DoDot:4
+24 SET ABMOS(ABMSCNT)=ABMS_"^"_ABMSDUZ_"^"_ABMSDT_"^"_$GET(ABMO(ABMS,ABMSDUZ,ABMSDT))
+25 ;session doesn't have activity
IF +ABMSDUZ'=0
IF (+$PIECE($GET(ABMO(ABMS,ABMSDUZ,ABMSDT)),U,3)=0)
WRITE ?79,"*"
End DoDot:3
End DoDot:2
End DoDot:1
+26 QUIT
DISPLAY(ABMFLG) ;EP
+1 WRITE $$EN^ABMVDF("IOF")
+2 SET ABMLREC=$GET(ABMOS(ABMSESSL))
+3 SET ABMS=$PIECE(ABMLREC,U)
+4 SET ABMSDUZ=$PIECE(ABMLREC,U,2)
+5 SET ABMSDT=$PIECE(ABMLREC,U,3)
+6 WRITE !,"Session detail for Session ID: "_ABMSDT
+7 WRITE ?48,"Date ",ABMFLG,": ",$$CDT^ABMDUTL(ABMSDT)
+8 WRITE !,"Cashier: ",$SELECT(+ABMSDUZ'=0:$PIECE($GET(^VA(200,ABMSDUZ,0)),U),1:"POS CLAIMS")
+9 WRITE !,ABMLINE
+10 SET ABMFD=ABMSDT
+11 IF +ABMSDUZ
DO CASHTOT^ABMUCASH(ABMSDUZ)
+12 IF 'ABMSDUZ
DO CASHTOTP^ABMUCASH
+13 SET ABMBA=""
+14 IF '$DATA(ABMBAL)&(+ABMSDUZ)
Begin DoDot:1
+15 WRITE !?5,"AT THIS TIME THERE IS NO BILLING ACTIVITY FOR THIS SESSION.",!
+16 SET DIR(0)="E"
SET DIR("A")="Enter RETURN to Continue"
DO ^DIR
KILL DIR
End DoDot:1
QUIT
+17 FOR
SET ABMBA=$ORDER(ABMBAL(ABMBA))
IF ABMBA=""
QUIT
Begin DoDot:1
+18 ;W !?5,$P($T(@ABMBA^ABMUCASH),";;",2) ;abm*2.6*11 insurer type
+19 ;abm*2.6*11 insurer type
WRITE !?5,$$INSTYP^ABMUCASH(ABMBA)
+20 WRITE !?15,"- Cancelled Claims",?40,+$GET(ABMBAL(ABMBA,"CCLMS"))
+21 WRITE !?15,"- Approved Bills",?40,+$GET(ABMBAL(ABMBA,"ABILLS")),?50,"$",$JUSTIFY($FNUMBER(+$GET(ABMBAL(ABMBA,"ABAMT")),",",2),10)
+22 IF +$GET(ABMBAL(ABMBA,"EBILLS"))>0
Begin DoDot:2
+23 WRITE " "
+24 WRITE $$EN^ABMVDF("RVN")_"(EXCL. ",ABMBAL(ABMBA,"EBILLS")
+25 WRITE $$EN^ABMVDF("RVN")_" @ "_$FNUMBER(+$GET(ABMBAL(ABMBA,"EBAMT")),",",2)_")"
+26 WRITE $$EN^ABMVDF("RVF")
End DoDot:2
+27 WRITE !?15,"- Cancelled Bills",?40,+$GET(ABMBAL(ABMBA,"CBILLS")),?50,"$",$JUSTIFY($FNUMBER(+$GET(ABMBAL(ABMBA,"CBAMT")),",",2),10)
End DoDot:1
+28 WRITE !
+29 ;requeued bills/batches
+30 IF +$GET(ABMBLCNT)'=0
WRITE !?3,ABMBLCNT_" "_$SELECT(ABMBLCNT=1:"BILL has",1:"BILLS have")_" been requeued"
+31 IF +$GET(ABMBTCNT)'=0
WRITE !?3,ABMBTCNT_" "_$SELECT(ABMBTCNT=1:"EXPORT has",1:"EXPORTS have")_" been requeued"
+32 ;ben pts
+33 IF +$PIECE($GET(^ABMUCASH(ABMLOC,10,ABMSDUZ,20,ABMFD,0)),U,11)'=0
Begin DoDot:1
+34 SET ABMBCNT=$PIECE($GET(^ABMUCASH(ABMLOC,10,ABMSDUZ,20,ABMFD,0)),U,11)
+35 WRITE !?3,"There is ",ABMBCNT," claims/bills for beneficiary patients in this session that will ",!?3,"not be included in the export.",!
End DoDot:1
+36 ;
+37 KILL DIR
+38 ;view detail of session?
+39 WRITE !
+40 KILL DIR,X,Y
+41 SET DIR("A")="View detail"
+42 SET DIR(0)="Y"
+43 DO ^DIR
KILL DIR
+44 SET ABMDUZ=ABMSDUZ
+45 IF Y=1
DO SEL^ABMUCASH
+46 SET DIR(0)="E"
SET DIR("A")="Enter RETURN to Continue"
DO ^DIR
KILL DIR
+47 QUIT