RCRCVLE ;ALB/CMS - TP POSSIBLE REFERRAL SEL/MOD LIST BUILD ; 09/13/97
V ;;4.5;Accounts Receivable;**63**;Mar 20, 1995
;;Per VHA Directive 10-93-142, this routine should not be modified.
;
SEL ; Entry point to select Items on List
; Select items will be highlighted and stored in TMP("RCRCVL",$J,"SEL"
N DIC,DIRUT,DUOUT,RCSELN,RCOUT,VALMY,X,Y S RCSELN=0
D EN^VALM2($G(XQORNOD(0)),0)
I '$D(VALMY) W !," ...Nothing Selected." D PAUSE^VALM1 D
.I ($D(DIROUT))!($D(DUOUT)) S RCOUT=1
F S RCSELN=$O(VALMY(RCSELN)) Q:('RCSELN)!($D(RCOUT)) D
.I $D(^TMP("RCRCVL",$J,"SEL",RCSELN)) D UNSEL(RCSELN) Q
.S ^TMP("RCRCVL",$J,"SEL",RCSELN)=""
.D SELECT^VALM10(RCSELN,1)
I $D(RCOUT) G SELQ
I $O(^TMP("RCRCVL",$J,"SEL",0)) D
.D FULL^VALM1
.W @IOF,!!,"Current Selection of Items on List: "
.S RCSELN=0 F S RCSELN=$O(^TMP("RCRCVL",$J,"SEL",RCSELN)) Q:('RCSELN)!($D(RCOUT)) D
..I $Y>(IOSL+3) W ! D PAUSE^VALM1 W @IOF,!,"Current Selection of Items on List:"
..I $D(DIRUT)!$D(DUOUT) S RCOUT=1 Q
..W !,@VALMAR@(RCSELN,0)
.W ! D PAUSE^VALM1
SELQ Q
;
UNSEL(RCSELN) ; Unselect and Unhighlight items on the list
;Ask user if they want to Unselect the Item
N DIR,DIROUT,DTOUT,DUOUT,DIROUT,X,Y
S DIR(0)="Y",DIR("B")="No"
S DIR("?")="Enter Yes to un-select pre-selected item."
S DIR("A")="Do you want to UNSELECT Item "_RCSELN_" "
W !! D ^DIR I $D(DTOUT)!$D(DIROUT) S RCOUT=1 G UNSELQ
I +Y K ^TMP("RCRCVL",$J,"SEL",RCSELN) D SELECT^VALM10(RCSELN,0)
UNSELQ Q
;
MOD ; Entry point to Modify active list for third party possible referrals
; Rebuilds the List of Possible Referrals by patname then resequence
N CNT,DIR,DIROUT,DTOUT,DUOUT,DIROUT,RCA,RCD,RCOUT,RCS,RCSBN,RCSEL,RCSN,RCSP,RCY,X,Y
;
;select bill to delete from highlighted selection
S RCSEL=""
I $O(^TMP("RCRCVL",$J,"SEL",0)) D DELA I $G(RCOUT) G MODQ
I RCSEL S RCD="" G MODA
;
;select bill to delete from in RCD()
S DIR(0)="LAOC^1:"_VALMCNT_":0",DIR("A")="Delete List item number(s): "
S DIR("?")="Enter item number(s) you want to remove from list"
W !! D ^DIR M RCD=Y
I ($D(DIROUT))!($D(DUOUT)) S RCOUT=1 W !,"Nothing Changed." G MODQ
;
MODA ;select bill to add in RCSBN()
K DIR S DIR("A")="Do you want to ADD AR Bills to the List "
S DIR("B")="Yes" D ASK^RCRCACP
I Y=1 W !!,"Add Selected Bill(s) to List" D BILL^RCRCVLB S RCOUT=0
;
;If none to add or delete quit
I 'RCSEL,$G(RCD)="",'$O(RCSBN(0)) G MODQ
;
D FULL^VALM1 W @IOF
W !!,?10,"* WARNING: ADDING OR DELETING ITEMS FROM THE CURRENT LIST *"
W !,?10,"* WILL CAUSE THE LIST TO BE RE-SEQUENCED WHICH MAY CAUSE A *"
W !,?10,"* BILL TO BE ASSOCIATED WITH A DIFFERENT ITEM NUMBER. ALSO, *"
W !,?10,"* ALL CURRENT HIGHLIGHTED SELECTIONS WILL BE UNSELECTED. *"
W !!
;
;Display Current actions
I RCD W !,"Selected Items to Delete:",! S RCY="" F S RCY=$O(RCD(RCY)) Q:RCY="" D
.F RCSP=1:1:999 S RCS=$P(RCD(RCY),",",RCSP) Q:RCS="" D
..I RCS["-" F RCSN=$P(RCS,"-",1):1:$P(RCS,"-",2) W !,@VALMAR@(RCSN,0) D
...I $Y>(IOSL+3) D PAUSE^VALM1 W @IOF,!!,"Selected Items to Delete:",!
..I RCS'["-" W !,@VALMAR@(RCS,0)
..I $Y>(IOSL+3) D PAUSE^VALM1 W @IOF,!!,"Selected Items to Delete:",!
;
I RCSEL W !,"Selected Items to Delete:",! S RCY=0 F S RCY=$O(^TMP("RCRCVL",$J,"SEL",RCY)) Q:'RCY D
.I $Y>(IOSL+3) D PAUSE^VALM1 W @IOF,!!,"Selected Items to Delete:",!
.W !,@VALMAR@(RCY,0)
;
I $O(RCSBN(0)) W !!,"Selected Bills to Add:",! S RCY=0 F S RCY=$O(RCSBN(RCY)) Q:'RCY D
.I $Y>(IOSL+3) D PAUSE^VALM1 W @IOF,!!,"Selected Bills to Add:",!
.W !,$P(^PRCA(430,RCY,0),U,1)
;
;Ask user if sure
K DIR,DIROUT,DTOUT,DUOUT,DIROUT,X,Y
S DIR(0)="Y",DIR("B")="No"
S DIR("?")="Enter Yes if you want to rebuild the current list"
S DIR("A")="Okay to Continue "
W !! D ^DIR I 'Y G MODQ
I ($D(DTOUT))!($D(DIROUT)) S RCOUT=1 W !,"Nothing Changed." G MODQ
W !
;
;Delete all items in RCD variable from "B"
I RCD W !,?3,"Deleting Selected Items..." S RCY="" F S RCY=$O(RCD(RCY)) Q:RCY="" D
.F RCSP=1:1:999 S RCS=$P(RCD(RCY),",",RCSP) Q:RCS="" D
..I RCS["-" F RCSN=$P(RCS,"-",1):1:$P(RCS,"-",2) D
...K ^TMP("RCRCVL",$J,"B",$P($G(^DPT(+$G(^TMP("RCRCVLPT",$J,RCSN)),0),0),U,1),+$P($G(^TMP("RCRCVLX",$J,RCSN),0),U,2))
..I RCS'["-" K ^TMP("RCRCVL",$J,"B",$P($G(^DPT(+$G(^TMP("RCRCVLPT",$J,RCS)),0),0),U,1),+$P($G(^TMP("RCRCVLX",$J,RCS),0),U,2))
;
;Delete all highlighted selected Items
I RCSEL W !,?3,"Deleting Selected Items..." S RCY=0 F S RCY=$O(^TMP("RCRCVL",$J,"SEL",RCY)) Q:'RCY D
.K ^TMP("RCRCVL",$J,"B",$P($G(^DPT(+$G(^TMP("RCRCVLPT",$J,RCY)),0),0),U,1),+$P($G(^TMP("RCRCVLX",$J,RCY),0),U,2))
;
;Add selected bills in RCA
I $O(RCSBN(0)) W !,?3,"Adding Selected Items..."
S RCY=0 F S RCY=$O(RCSBN(RCY)) Q:'RCY D
.S CNT=$G(VALMCNT)+1
.D SCRN^RCRCVL1(RCY,CNT)
;
;Delete Highlighted selected items
I $O(^TMP("RCRCVL",$J,"SEL",0)) W !,?3,"Deleting Highlighted Items..."
S RCY=0 F S RCY=$O(^TMP("RCRCVL",$J,"SEL",RCY)) Q:'RCY D SELECT^VALM10(RCY,0)
;
W !,?3,"Killing current list ..."
S RCY=0 F S RCY=$O(^TMP("RCRCVL",$J,RCY)) Q:'RCY K ^TMP("RCRCVL",$J,RCY)
K ^TMP("RCRCVLX",$J),^TMP("RCRCVLPT",$J),^TMP("RCRCVL",$J,"IDX"),^TMP("RCRCVL",$J,"SEL")
;
;Rebuild using altered TMP("RCRCVL",$J,"B"
D RESL^RCRCVL1
MODQ Q
;
DELA ;Ask if delete all items on selection list
N DIR,DIROUT,DTOUT,DUOUT,DIROUT,X,Y
S DIR(0)="Y",DIR("B")="Yes"
S DIR("?")="Enter Yes if you want to delete ALL the highlighted selected items from the current list"
S DIR("A")="Delete ALL highlighted selected items "
W !! D ^DIR S RCSEL=+Y
I ($D(DTOUT))!($D(DIROUT)) S RCOUT=1
DELAQ Q
;RCRCVLE
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HRCRCVLE 5677 printed Oct 16, 2024@17:48:49 Page 2
RCRCVLE ;ALB/CMS - TP POSSIBLE REFERRAL SEL/MOD LIST BUILD ; 09/13/97
V ;;4.5;Accounts Receivable;**63**;Mar 20, 1995
+1 ;;Per VHA Directive 10-93-142, this routine should not be modified.
+2 ;
SEL ; Entry point to select Items on List
+1 ; Select items will be highlighted and stored in TMP("RCRCVL",$J,"SEL"
+2 NEW DIC,DIRUT,DUOUT,RCSELN,RCOUT,VALMY,X,Y
SET RCSELN=0
+3 DO EN^VALM2($GET(XQORNOD(0)),0)
+4 IF '$DATA(VALMY)
WRITE !," ...Nothing Selected."
DO PAUSE^VALM1
Begin DoDot:1
+5 IF ($DATA(DIROUT))!($DATA(DUOUT))
SET RCOUT=1
End DoDot:1
+6 FOR
SET RCSELN=$ORDER(VALMY(RCSELN))
if ('RCSELN)!($DATA(RCOUT))
QUIT
Begin DoDot:1
+7 IF $DATA(^TMP("RCRCVL",$JOB,"SEL",RCSELN))
DO UNSEL(RCSELN)
QUIT
+8 SET ^TMP("RCRCVL",$JOB,"SEL",RCSELN)=""
+9 DO SELECT^VALM10(RCSELN,1)
End DoDot:1
+10 IF $DATA(RCOUT)
GOTO SELQ
+11 IF $ORDER(^TMP("RCRCVL",$JOB,"SEL",0))
Begin DoDot:1
+12 DO FULL^VALM1
+13 WRITE @IOF,!!,"Current Selection of Items on List: "
+14 SET RCSELN=0
FOR
SET RCSELN=$ORDER(^TMP("RCRCVL",$JOB,"SEL",RCSELN))
if ('RCSELN)!($DATA(RCOUT))
QUIT
Begin DoDot:2
+15 IF $Y>(IOSL+3)
WRITE !
DO PAUSE^VALM1
WRITE @IOF,!,"Current Selection of Items on List:"
+16 IF $DATA(DIRUT)!$DATA(DUOUT)
SET RCOUT=1
QUIT
+17 WRITE !,@VALMAR@(RCSELN,0)
End DoDot:2
+18 WRITE !
DO PAUSE^VALM1
End DoDot:1
SELQ QUIT
+1 ;
UNSEL(RCSELN) ; Unselect and Unhighlight items on the list
+1 ;Ask user if they want to Unselect the Item
+2 NEW DIR,DIROUT,DTOUT,DUOUT,DIROUT,X,Y
+3 SET DIR(0)="Y"
SET DIR("B")="No"
+4 SET DIR("?")="Enter Yes to un-select pre-selected item."
+5 SET DIR("A")="Do you want to UNSELECT Item "_RCSELN_" "
+6 WRITE !!
DO ^DIR
IF $DATA(DTOUT)!$DATA(DIROUT)
SET RCOUT=1
GOTO UNSELQ
+7 IF +Y
KILL ^TMP("RCRCVL",$JOB,"SEL",RCSELN)
DO SELECT^VALM10(RCSELN,0)
UNSELQ QUIT
+1 ;
MOD ; Entry point to Modify active list for third party possible referrals
+1 ; Rebuilds the List of Possible Referrals by patname then resequence
+2 NEW CNT,DIR,DIROUT,DTOUT,DUOUT,DIROUT,RCA,RCD,RCOUT,RCS,RCSBN,RCSEL,RCSN,RCSP,RCY,X,Y
+3 ;
+4 ;select bill to delete from highlighted selection
+5 SET RCSEL=""
+6 IF $ORDER(^TMP("RCRCVL",$JOB,"SEL",0))
DO DELA
IF $GET(RCOUT)
GOTO MODQ
+7 IF RCSEL
SET RCD=""
GOTO MODA
+8 ;
+9 ;select bill to delete from in RCD()
+10 SET DIR(0)="LAOC^1:"_VALMCNT_":0"
SET DIR("A")="Delete List item number(s): "
+11 SET DIR("?")="Enter item number(s) you want to remove from list"
+12 WRITE !!
DO ^DIR
MERGE RCD=Y
+13 IF ($DATA(DIROUT))!($DATA(DUOUT))
SET RCOUT=1
WRITE !,"Nothing Changed."
GOTO MODQ
+14 ;
MODA ;select bill to add in RCSBN()
+1 KILL DIR
SET DIR("A")="Do you want to ADD AR Bills to the List "
+2 SET DIR("B")="Yes"
DO ASK^RCRCACP
+3 IF Y=1
WRITE !!,"Add Selected Bill(s) to List"
DO BILL^RCRCVLB
SET RCOUT=0
+4 ;
+5 ;If none to add or delete quit
+6 IF 'RCSEL
IF $GET(RCD)=""
IF '$ORDER(RCSBN(0))
GOTO MODQ
+7 ;
+8 DO FULL^VALM1
WRITE @IOF
+9 WRITE !!,?10,"* WARNING: ADDING OR DELETING ITEMS FROM THE CURRENT LIST *"
+10 WRITE !,?10,"* WILL CAUSE THE LIST TO BE RE-SEQUENCED WHICH MAY CAUSE A *"
+11 WRITE !,?10,"* BILL TO BE ASSOCIATED WITH A DIFFERENT ITEM NUMBER. ALSO, *"
+12 WRITE !,?10,"* ALL CURRENT HIGHLIGHTED SELECTIONS WILL BE UNSELECTED. *"
+13 WRITE !!
+14 ;
+15 ;Display Current actions
+16 IF RCD
WRITE !,"Selected Items to Delete:",!
SET RCY=""
FOR
SET RCY=$ORDER(RCD(RCY))
if RCY=""
QUIT
Begin DoDot:1
+17 FOR RCSP=1:1:999
SET RCS=$PIECE(RCD(RCY),",",RCSP)
if RCS=""
QUIT
Begin DoDot:2
+18 IF RCS["-"
FOR RCSN=$PIECE(RCS,"-",1):1:$PIECE(RCS,"-",2)
WRITE !,@VALMAR@(RCSN,0)
Begin DoDot:3
+19 IF $Y>(IOSL+3)
DO PAUSE^VALM1
WRITE @IOF,!!,"Selected Items to Delete:",!
End DoDot:3
+20 IF RCS'["-"
WRITE !,@VALMAR@(RCS,0)
+21 IF $Y>(IOSL+3)
DO PAUSE^VALM1
WRITE @IOF,!!,"Selected Items to Delete:",!
End DoDot:2
End DoDot:1
+22 ;
+23 IF RCSEL
WRITE !,"Selected Items to Delete:",!
SET RCY=0
FOR
SET RCY=$ORDER(^TMP("RCRCVL",$JOB,"SEL",RCY))
if 'RCY
QUIT
Begin DoDot:1
+24 IF $Y>(IOSL+3)
DO PAUSE^VALM1
WRITE @IOF,!!,"Selected Items to Delete:",!
+25 WRITE !,@VALMAR@(RCY,0)
End DoDot:1
+26 ;
+27 IF $ORDER(RCSBN(0))
WRITE !!,"Selected Bills to Add:",!
SET RCY=0
FOR
SET RCY=$ORDER(RCSBN(RCY))
if 'RCY
QUIT
Begin DoDot:1
+28 IF $Y>(IOSL+3)
DO PAUSE^VALM1
WRITE @IOF,!!,"Selected Bills to Add:",!
+29 WRITE !,$PIECE(^PRCA(430,RCY,0),U,1)
End DoDot:1
+30 ;
+31 ;Ask user if sure
+32 KILL DIR,DIROUT,DTOUT,DUOUT,DIROUT,X,Y
+33 SET DIR(0)="Y"
SET DIR("B")="No"
+34 SET DIR("?")="Enter Yes if you want to rebuild the current list"
+35 SET DIR("A")="Okay to Continue "
+36 WRITE !!
DO ^DIR
IF 'Y
GOTO MODQ
+37 IF ($DATA(DTOUT))!($DATA(DIROUT))
SET RCOUT=1
WRITE !,"Nothing Changed."
GOTO MODQ
+38 WRITE !
+39 ;
+40 ;Delete all items in RCD variable from "B"
+41 IF RCD
WRITE !,?3,"Deleting Selected Items..."
SET RCY=""
FOR
SET RCY=$ORDER(RCD(RCY))
if RCY=""
QUIT
Begin DoDot:1
+42 FOR RCSP=1:1:999
SET RCS=$PIECE(RCD(RCY),",",RCSP)
if RCS=""
QUIT
Begin DoDot:2
+43 IF RCS["-"
FOR RCSN=$PIECE(RCS,"-",1):1:$PIECE(RCS,"-",2)
Begin DoDot:3
+44 KILL ^TMP("RCRCVL",$JOB,"B",$PIECE($GET(^DPT(+$GET(^TMP("RCRCVLPT",$JOB,RCSN)),0),0),U,1),+$PIECE($GET(^TMP("RCRCVLX",$JOB,RCSN),0),U,2))
End DoDot:3
+45 IF RCS'["-"
KILL ^TMP("RCRCVL",$JOB,"B",$PIECE($GET(^DPT(+$GET(^TMP("RCRCVLPT",$JOB,RCS)),0),0),U,1),+$PIECE($GET(^TMP("RCRCVLX",$JOB,RCS),0),U,2))
End DoDot:2
End DoDot:1
+46 ;
+47 ;Delete all highlighted selected Items
+48 IF RCSEL
WRITE !,?3,"Deleting Selected Items..."
SET RCY=0
FOR
SET RCY=$ORDER(^TMP("RCRCVL",$JOB,"SEL",RCY))
if 'RCY
QUIT
Begin DoDot:1
+49 KILL ^TMP("RCRCVL",$JOB,"B",$PIECE($GET(^DPT(+$GET(^TMP("RCRCVLPT",$JOB,RCY)),0),0),U,1),+$PIECE($GET(^TMP("RCRCVLX",$JOB,RCY),0),U,2))
End DoDot:1
+50 ;
+51 ;Add selected bills in RCA
+52 IF $ORDER(RCSBN(0))
WRITE !,?3,"Adding Selected Items..."
+53 SET RCY=0
FOR
SET RCY=$ORDER(RCSBN(RCY))
if 'RCY
QUIT
Begin DoDot:1
+54 SET CNT=$GET(VALMCNT)+1
+55 DO SCRN^RCRCVL1(RCY,CNT)
End DoDot:1
+56 ;
+57 ;Delete Highlighted selected items
+58 IF $ORDER(^TMP("RCRCVL",$JOB,"SEL",0))
WRITE !,?3,"Deleting Highlighted Items..."
+59 SET RCY=0
FOR
SET RCY=$ORDER(^TMP("RCRCVL",$JOB,"SEL",RCY))
if 'RCY
QUIT
DO SELECT^VALM10(RCY,0)
+60 ;
+61 WRITE !,?3,"Killing current list ..."
+62 SET RCY=0
FOR
SET RCY=$ORDER(^TMP("RCRCVL",$JOB,RCY))
if 'RCY
QUIT
KILL ^TMP("RCRCVL",$JOB,RCY)
+63 KILL ^TMP("RCRCVLX",$JOB),^TMP("RCRCVLPT",$JOB),^TMP("RCRCVL",$JOB,"IDX"),^TMP("RCRCVL",$JOB,"SEL")
+64 ;
+65 ;Rebuild using altered TMP("RCRCVL",$J,"B"
+66 DO RESL^RCRCVL1
MODQ QUIT
+1 ;
DELA ;Ask if delete all items on selection list
+1 NEW DIR,DIROUT,DTOUT,DUOUT,DIROUT,X,Y
+2 SET DIR(0)="Y"
SET DIR("B")="Yes"
+3 SET DIR("?")="Enter Yes if you want to delete ALL the highlighted selected items from the current list"
+4 SET DIR("A")="Delete ALL highlighted selected items "
+5 WRITE !!
DO ^DIR
SET RCSEL=+Y
+6 IF ($DATA(DTOUT))!($DATA(DIROUT))
SET RCOUT=1
DELAQ QUIT
+1 ;RCRCVLE