Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: PRCPURS3

PRCPURS3.m

Go to the documentation of this file.
  1. PRCPURS3 ;WISC/RFJ-select distribution points ;24 May 93
  1. V ;;5.1;IFCAP;**1,108**;Oct 20, 2000;Build 10
  1. ;Per VHA Directive 2004-038, this routine should not be modified.
  1. Q
  1. ;
  1. ;
  1. DISTRSEL(V1) ; select distribution points
  1. ; v1=inventory point da
  1. N %,D,DISTR,DISTRNM,PRCPEXIT,PRCPFLAG,PRCPLINE,PRCPINPT
  1. K ^TMP($J,"PRCPURS3"),DISTRALL
  1. S PRCPINPT=+V1,PRCPLINE="",$P(PRCPLINE,"-",76)="",PRCPLINE="+"_PRCPLINE_"+"
  1. S %=$$ALLDISTR I %=0 Q
  1. I %=1 S DISTRALL=1
  1. F D I $G(PRCPFLAG) Q
  1. . W !
  1. . I $O(^TMP($J,"PRCPURS3","YES",0))]""!($G(DISTRALL)) D
  1. . . W !?2,PRCPLINE,!?2,"| Currently selected ",$S(PRCP("DPTYPE")="S":"recipients:",1:"distribution points:"),?78,"|"
  1. . . I $G(DISTRALL) W !?2,"| << ALL ",$S(PRCP("DPTYPE")="S":"RECIPIENTS",1:"DISTRIBUTION POINTS")," >>",?78,"|"
  1. . . E D
  1. . . . W !?2,"| "
  1. . . . S D=0 F S D=$O(^TMP($J,"PRCPURS3","YES",D)) Q:D']"" S %=$E(^(D),1,20),%=%_$E(" ",$L(%),20) W:$X>70 ?78,"|",!?2,"| " W %," "
  1. . . . W ?78,"|"
  1. . . W !?2,"| You can DE-select one of the above ",$S(PRCP("DPTYPE")="S":"recipients:",1:"distribution points:")," by reselecting it.",?78,"|"
  1. . I $O(^TMP($J,"PRCPURS3","NO",0))]""!('$G(DISTRALL)) D
  1. . . W !?2,PRCPLINE,!?2,"| Currently DE-selected ",$S(PRCP("DPTYPE")="S":"recipients:",1:"distribution points:"),?78,"|"
  1. . . I '$G(DISTRALL) W !?2,"| << ALL ",$S(PRCP("DPTYPE")="S":"RECIPIENTS",1:"DISTRIBUTION POINTS")," >>",?78,"|"
  1. . . E D
  1. . . . W !?2,"| "
  1. . . . S D=0 F S D=$O(^TMP($J,"PRCPURS3","NO",D)) Q:D']"" S %=$E(^(D),1,20),%=%_$E(" ",$L(%),20) W:$X>70 ?78,"|",!?2,"| " W %," "
  1. . . . W ?78,"|"
  1. . . I PRCP("DPTYPE")'="S" W !?2,"| You can RE-select one of the above distribution points by reselecting it.",?78,"|"
  1. . . I PRCP("DPTYPE")="S" W !?2,"| These recipients can be moved to the SELECTED List by reselecting them.",?78,"|"
  1. . W !?2,PRCPLINE
  1. . I PRCP("DPTYPE")'="S" S DISTR=$$TO^PRCPUDPT(PRCPINPT)
  1. . I PRCP("DPTYPE")="S" S DISTR=$$TOWHOM^PRCPRISS(PRCPINPT)
  1. . I DISTR<0 S (PRCPFLAG,PRCPEXIT)=1 Q
  1. . S DISTRNM="" I PRCP("DPTYPE")="S",DISTR'=0 S DISTRNM=DISTR
  1. . I PRCP("DPTYPE")'="S" S DISTRNM=$$INVNAME^PRCPUX1(DISTR)
  1. . I DISTR=0,$O(^TMP($J,"PRCPURS3","YES",0))']"",'$G(DISTRALL) D Q
  1. . . S %=$$ALLDISTR I %=0 S (PRCPFLAG,PRCPEXIT)=1 Q
  1. . . I %=1 S DISTRALL=1
  1. . I DISTR=0 S PRCPFLAG=1 Q
  1. . I $G(DISTRALL),'$D(^TMP($J,"PRCPURS3","NO",DISTR)) K ^TMP($J,"PRCPURS3","YES",DISTR) S ^TMP($J,"PRCPURS3","NO",DISTR)=DISTRNM W !?10,"*** DE-selected !" Q
  1. . I $D(^TMP($J,"PRCPURS3","YES",DISTR)) K ^TMP($J,"PRCPURS3","YES",DISTR) S ^TMP($J,"PRCPURS3","NO",DISTR)=DISTRNM W !?10,"*** DE-selected !" Q
  1. . I $D(^TMP($J,"PRCPURS3","NO",DISTR)) K ^(DISTR) S ^TMP($J,"PRCPURS3","YES",DISTR)=DISTRNM W !?10,"*** RE-selected !" Q
  1. . S ^TMP($J,"PRCPURS3","YES",DISTR)=DISTRNM W !?10,"*** selected !"
  1. I $G(PRCPEXIT) K ^TMP($J,"PRCPURS3"),DISTRALL Q
  1. I $G(DISTRALL) K ^TMP($J,"PRCPURS3","YES")
  1. Q
  1. ;
  1. ;
  1. ALLDISTR() ; select all distribution points/recipients
  1. ; returns 1 for yes, 2 for no, 0 for ^
  1. I PRCP("DPTYPE")'="S" D
  1. . S XP="Do you want to select ALL distribution points"
  1. . S XH="Enter 'YES' to select ALL distr. points, 'NO' to not select all distr. points."
  1. I PRCP("DPTYPE")="S" D
  1. . S XP="Do you want ALL recipients"
  1. . S XH="Enter 'YES' to select ALL recipients, 'NO' to select individual recipients."
  1. Q $$YN^PRCPUYN(1)