ABMDRSET ; IHS/DSD/DMJ - Reset Exported to Unexported ;
;;2.6;IHS 3P BILLING SYSTEM;;NOV 12, 2009
;
K ABM S U="^",ABM("XMIT")=0
W !!,"If run, this Program will remove a selected Export Batch and reset all ",!,"Bills that are linked to it so that they may be re-exported."
W !!,"NOTE: Only batches that were exported by you and have not been transmitted to",!?6,"the Area Tracking System may be selected."
SEL W !! K DIC S DIC="^ABMDTXST(",DIC("A")="Select EXPORT Batch: ",DIC(0)="QEAM",DIC("S")="I '$P(^(0),U,6),$P(^(0),U,5)=DUZ" D ^DIC K DIC
G XIT:X=""!$D(DUOUT)!$D(DTOUT)
I +Y<1 G SEL
K DIR S ABM("Y")=+Y,DIR(0)="Y",DIR("A")="Do you wish to Cancel Export Batch Number "_+Y_" (Y/N)" D ^DIR K DIR G XIT:Y'=1 S Y=ABM("Y")
S ABM("BAT")=+Y
;
S ABM="" F S ABM=$O(^ABMDBILL("AX",ABM("BAT"),ABM)) Q:'ABM D
.I '$D(^ABMDBILL(ABM,0)) K ^ABMDBILL("AX",ABM("BAT"),ABM)
.S DIE="^ABMDBILL(",DA=ABM,DR=".04////A;.16///@;.17///@" D ^ABMDDIE
.S ABM("BILL")=$P(^ABMDBILL(ABM,0),U) I $D(^ABPVFAC("B",ABM("BILL"))) S DIK="^ABPVFAC(",DA=$O(^(ABM("BILL"),"")) D ^DIK
S DIK="^ABMDTXST(",DA=ABM("BAT") D ^DIK
XIT K ABM
Q
ABMDRSET ; IHS/DSD/DMJ - Reset Exported to Unexported ;
+1 ;;2.6;IHS 3P BILLING SYSTEM;;NOV 12, 2009
+2 ;
+3 KILL ABM
SET U="^"
SET ABM("XMIT")=0
+4 WRITE !!,"If run, this Program will remove a selected Export Batch and reset all ",!,"Bills that are linked to it so that they may be re-exported."
+5 WRITE !!,"NOTE: Only batches that were exported by you and have not been transmitted to",!?6,"the Area Tracking System may be selected."
SEL WRITE !!
KILL DIC
SET DIC="^ABMDTXST("
SET DIC("A")="Select EXPORT Batch: "
SET DIC(0)="QEAM"
SET DIC("S")="I '$P(^(0),U,6),$P(^(0),U,5)=DUZ"
DO ^DIC
KILL DIC
+1 IF X=""!$DATA(DUOUT)!$DATA(DTOUT)
GOTO XIT
+2 IF +Y<1
GOTO SEL
+3 KILL DIR
SET ABM("Y")=+Y
SET DIR(0)="Y"
SET DIR("A")="Do you wish to Cancel Export Batch Number "_+Y_" (Y/N)"
DO ^DIR
KILL DIR
IF Y'=1
GOTO XIT
SET Y=ABM("Y")
+4 SET ABM("BAT")=+Y
+5 ;
+6 SET ABM=""
FOR
SET ABM=$ORDER(^ABMDBILL("AX",ABM("BAT"),ABM))
IF 'ABM
QUIT
Begin DoDot:1
+7 IF '$DATA(^ABMDBILL(ABM,0))
KILL ^ABMDBILL("AX",ABM("BAT"),ABM)
+8 SET DIE="^ABMDBILL("
SET DA=ABM
SET DR=".04////A;.16///@;.17///@"
DO ^ABMDDIE
+9 SET ABM("BILL")=$PIECE(^ABMDBILL(ABM,0),U)
IF $DATA(^ABPVFAC("B",ABM("BILL")))
SET DIK="^ABPVFAC("
SET DA=$ORDER(^(ABM("BILL"),""))
DO ^DIK
End DoDot:1
+10 SET DIK="^ABMDTXST("
SET DA=ABM("BAT")
DO ^DIK
XIT KILL ABM
+1 QUIT