ABMUROPN ; IHS/SD/SDR - 3PB/UFMS Re-open Session Option
;;2.6;IHS 3P BILLING SYSTEM;;NOV 12, 2009
;
; New routine - v2.5 p12 SDD item 4.9.2.3
; Re-open Cashiering Session
;
W !!,"The following sessions are available for re-opening =>",!
S ABMFLG="CLOSED"
K ABMO
D FINDACLS^ABMUCUTL
D HEADER
;remove any POS entries; they are not re-openable
S ABMS=0
F S ABMS=$O(ABMO(ABMS)) Q:+ABMS=0 D
.S ABMSDUZ=""
.F S ABMSDUZ=$O(ABMO(ABMS,ABMSDUZ)) Q:ABMSDUZ="" D
..I ABMSDUZ="POS" K ABMO(ABMS)
I '$D(ABMO) D Q
.W !?5,"There are no CLOSED sessions."
.K DIR
.W !!!
.S DIR(0)="E",DIR("A")="Enter RETURN to Continue" D ^DIR K DIR
D VIEWLIST ;list of closed sessions
D SELSESS ;which session to open
Q:+$G(ABMANS)=0
D FINDOPEN^ABMUCUTL($P($G(ABMOS(ABMANS)),U,2)) ;check if user already has open session; prevent two open sessions
I +$G(ABMFD)'=0 D
.W !!,"This user has an existing open session so the selected session will not be",!," re-opened.",!
.K ABMANS
.S DIR(0)="E",DIR("A")="Enter RETURN to Continue" D ^DIR K DIR
I +$G(ABMANS)'=0 D REOPEN
Q
W !!,"The following SESSIONS are currently "_ABMFLG_" =>",!!
W ?4,"SESSION ID",?19,"CASHIER",?40,"DATE OPENED",?57,"DATE CLOSED"
W ?74,"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=0
.F S ABMSDUZ=$O(ABMO(ABMS,ABMSDUZ)) Q:+ABMSDUZ=0 D
..S ABMSDT=0
..F S ABMSDT=$O(ABMO(ABMS,ABMSDUZ,ABMSDT)) Q:+ABMSDT=0 D
...S ABMST=$P($G(ABMO(ABMS,ABMSDUZ,ABMSDT)),U)
...Q:ABMST'="C" ;only closed sessions
...S ABMSCNT=ABMSCNT+1
...W ABMSCNT_". "
...W ABMSDT
...W ?19,$E($P($G(^VA(200,ABMSDUZ,0)),U),1,19)
...W ?40,$P($$CDT^ABMDUTL(ABMSDT)," ")
...W ?57,$P($$CDT^ABMDUTL($P($G(^ABMUCASH(ABMLOC,10,ABMSDUZ,20,ABMSDT,0)),U,3))," ")
...I $G(ABMO(ABMS,ABMSDUZ,ABMSDT))'="" D
....W ?74,"CLOSED",!
...S ABMOS(ABMSCNT)=ABMS_"^"_ABMSDUZ_"^"_ABMSDT_"^"_$G(ABMO(ABMS,ABMSDUZ,ABMSDT))
Q
SELSESS ;EP
K DIC,DIE,DIR,X,Y,DA
S DIR(0)="NO^1:"_ABMSCNT
S DIR("A")="Select Session Number to Re-open"
D ^DIR K DIR
S ABMANS=+Y
I $D(DIROUT)!$D(DUOUT)!$D(DTOUT)!$D(DIRUT) K ABMANS Q
K DIC,DIE,DIR,X,Y,DA
W !
S DIR(0)="Y"
S DIR("A")="Are you sure you want to re-open session "_$P($G(ABMOS(ABMANS)),U,3)
S DIR("B")="N"
D ^DIR K DIR
I +Y'=1 K ABMANS
Q
REOPEN ;EP
K DIC,DIE,X,Y,DA
S DA(2)=ABMLOC
S DA(1)=$P($G(ABMOS(ABMANS)),U,2)
S DA=$P($G(ABMOS(ABMANS)),U,3)
S DIE="^ABMUCASH("_DA(2)_",10,"_DA(1)_",20,"
S DR=".09///NOW;.03////@;.04////O"
D ^DIE
W !!,"Ok, session "_$P($G(ABMOS(ABMANS)),U,3)_" has been re-opened and will begin tracking bills again."
Q
ABMUROPN ; IHS/SD/SDR - 3PB/UFMS Re-open Session Option
+1 ;;2.6;IHS 3P BILLING SYSTEM;;NOV 12, 2009
+2 ;
+3 ; New routine - v2.5 p12 SDD item 4.9.2.3
+4 ; Re-open Cashiering Session
+5 ;
+6 WRITE !!,"The following sessions are available for re-opening =>",!
+7 SET ABMFLG="CLOSED"
+8 KILL ABMO
+9 DO FINDACLS^ABMUCUTL
+10 DO HEADER
+11 ;remove any POS entries; they are not re-openable
+12 SET ABMS=0
+13 FOR
SET ABMS=$ORDER(ABMO(ABMS))
IF +ABMS=0
QUIT
Begin DoDot:1
+14 SET ABMSDUZ=""
+15 FOR
SET ABMSDUZ=$ORDER(ABMO(ABMS,ABMSDUZ))
IF ABMSDUZ=""
QUIT
Begin DoDot:2
+16 IF ABMSDUZ="POS"
KILL ABMO(ABMS)
End DoDot:2
End DoDot:1
+17 IF '$DATA(ABMO)
Begin DoDot:1
+18 WRITE !?5,"There are no CLOSED sessions."
+19 KILL DIR
+20 WRITE !!!
+21 SET DIR(0)="E"
SET DIR("A")="Enter RETURN to Continue"
DO ^DIR
KILL DIR
End DoDot:1
QUIT
+22 ;list of closed sessions
DO VIEWLIST
+23 ;which session to open
DO SELSESS
+24 IF +$GET(ABMANS)=0
QUIT
+25 ;check if user already has open session; prevent two open sessions
DO FINDOPEN^ABMUCUTL($PIECE($GET(ABMOS(ABMANS)),U,2))
+26 IF +$GET(ABMFD)'=0
Begin DoDot:1
+27 WRITE !!,"This user has an existing open session so the selected session will not be",!," re-opened.",!
+28 KILL ABMANS
+29 SET DIR(0)="E"
SET DIR("A")="Enter RETURN to Continue"
DO ^DIR
KILL DIR
End DoDot:1
+30 IF +$GET(ABMANS)'=0
DO REOPEN
+31 QUIT
+1 WRITE !!,"The following SESSIONS are currently "_ABMFLG_" =>",!!
+2 WRITE ?4,"SESSION ID",?19,"CASHIER",?40,"DATE OPENED",?57,"DATE CLOSED"
+3 WRITE ?74,"STATUS"
+4 WRITE !
+5 SET $PIECE(ABMLINE,"-",80)=""
+6 WRITE ABMLINE,!
+7 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=0
+4 FOR
SET ABMSDUZ=$ORDER(ABMO(ABMS,ABMSDUZ))
IF +ABMSDUZ=0
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 ABMST=$PIECE($GET(ABMO(ABMS,ABMSDUZ,ABMSDT)),U)
+8 ;only closed sessions
IF ABMST'="C"
QUIT
+9 SET ABMSCNT=ABMSCNT+1
+10 WRITE ABMSCNT_". "
+11 WRITE ABMSDT
+12 WRITE ?19,$EXTRACT($PIECE($GET(^VA(200,ABMSDUZ,0)),U),1,19)
+13 WRITE ?40,$PIECE($$CDT^ABMDUTL(ABMSDT)," ")
+14 WRITE ?57,$PIECE($$CDT^ABMDUTL($PIECE($GET(^ABMUCASH(ABMLOC,10,ABMSDUZ,20,ABMSDT,0)),U,3))," ")
+15 IF $GET(ABMO(ABMS,ABMSDUZ,ABMSDT))'=""
Begin DoDot:4
+16 WRITE ?74,"CLOSED",!
End DoDot:4
+17 SET ABMOS(ABMSCNT)=ABMS_"^"_ABMSDUZ_"^"_ABMSDT_"^"_$GET(ABMO(ABMS,ABMSDUZ,ABMSDT))
End DoDot:3
End DoDot:2
End DoDot:1
+18 QUIT
SELSESS ;EP
+1 KILL DIC,DIE,DIR,X,Y,DA
+2 SET DIR(0)="NO^1:"_ABMSCNT
+3 SET DIR("A")="Select Session Number to Re-open"
+4 DO ^DIR
KILL DIR
+5 SET ABMANS=+Y
+6 IF $DATA(DIROUT)!$DATA(DUOUT)!$DATA(DTOUT)!$DATA(DIRUT)
KILL ABMANS
QUIT
+7 KILL DIC,DIE,DIR,X,Y,DA
+8 WRITE !
+9 SET DIR(0)="Y"
+10 SET DIR("A")="Are you sure you want to re-open session "_$PIECE($GET(ABMOS(ABMANS)),U,3)
+11 SET DIR("B")="N"
+12 DO ^DIR
KILL DIR
+13 IF +Y'=1
KILL ABMANS
+14 QUIT
REOPEN ;EP
+1 KILL DIC,DIE,X,Y,DA
+2 SET DA(2)=ABMLOC
+3 SET DA(1)=$PIECE($GET(ABMOS(ABMANS)),U,2)
+4 SET DA=$PIECE($GET(ABMOS(ABMANS)),U,3)
+5 SET DIE="^ABMUCASH("_DA(2)_",10,"_DA(1)_",20,"
+6 SET DR=".09///NOW;.03////@;.04////O"
+7 DO ^DIE
+8 WRITE !!,"Ok, session "_$PIECE($GET(ABMOS(ABMANS)),U,3)_" has been re-opened and will begin tracking bills again."
+9 QUIT