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

XBDSET.m

Go to the documentation of this file.
  1. XBDSET ; IHS/ADC/GTH - BUILDS LIST OF FILEMAN FILES ; [ 12/11/2000 3:13 PM ]
  1. ;;3.0;IHS/VA UTILITIES;**8**;FEB 07, 1997
  1. ; XB*3*8 - IHS/ASDST/GTH 12-07-00 - Add ability to select from BUILD file.
  1. ;
  1. ; This routine selects FileMan dictionaries individually,
  1. ; by a range, or for a specific package. This routine can
  1. ; be called from another routine by setting the variables
  1. ; XBDSLO, XBDSHI and then D EN1^XBDSET.
  1. ;
  1. ; If the variable XBDSND exist upon entry no default menu
  1. ; option will be displayed.
  1. ;
  1. START ;
  1. S IOP=0
  1. D ^%ZIS
  1. KILL DIC,DIR,^UTILITY("XBDSET",$J)
  1. S (XBDSP,XBDSQ)=0
  1. F D GETFILES Q:XBDSQ
  1. D EOJ
  1. Q
  1. ;
  1. GETFILES ;
  1. W !
  1. ; S DIR(0)="SO^"_$S('XBDSP:"O:One file only;",1:"")_"S:Selected files;R:Range of files;P:Package;"_$S($D(^UTILITY("XBDSET",$J)):"L:List of files already selected; : ",1:" : "); XB*3*8
  1. S DIR(0)="SO^"_$S('XBDSP:"O:One file only;",1:"")_"S:Selected files;R:Range of files;P:Package;B:Build;"_$S($D(^UTILITY("XBDSET",$J)):"L:List of files already selected; : ",1:" : ") ; XB*3*8
  1. S DIR("A")="Choose one,"_$S(XBDSP!($D(XBDSND)):" RETURN to continue,",1:"")_" or ^ to cancel"
  1. I 'XBDSP,'$D(XBDSND) S DIR("B")="O"
  1. S DIR("?")=$S(XBDSP:"Do you want",1:"Do you want one file,")
  1. ; S DIR("?")=DIR("?")_" a range of files by number, files from a specific package, "_$S($D(^UTILITY("XBDSET",$J)):"individual files, or a list of files already selected?",1:"or individual files?") ; XB*3*8
  1. S DIR("?")=DIR("?")_" a range of files by number, files from a specific package or build, "_$S($D(^UTILITY("XBDSET",$J)):"individual files, or a list of files already selected?",1:"or individual files?") ; XB*3*8
  1. D ^DIR
  1. KILL DIR
  1. I $D(DIRUT) K:$D(DUOUT)!($D(DTOUT)) ^UTILITY("XBDSET",$J) S XBDSQ=1 Q
  1. D OPTION ; Get files for selected option
  1. I $D(^UTILITY("XBDSET",$J)) S XBDSP=1
  1. Q
  1. ;
  1. OPTION ; GET FILES FOR SELECTED OPTION
  1. W !
  1. I Y="O" D ONEFILE Q ; Get one file and exit
  1. I Y="S" D SELECT Q ; Get selected files
  1. I Y="R" D RANGE Q ; Get range of files
  1. I Y="P" D PACKAGE Q ; Get files from package
  1. I Y="L" D LIST Q ; List selected files
  1. I Y="B" D BUILD Q ; Get files from build ; XB*3*8
  1. Q
  1. ;
  1. ONEFILE ; GET ONE FILE AND EXIT
  1. S XBDSND=1
  1. S DIC="^DIC(",DIC(0)="AEMQ"
  1. D ^DIC
  1. KILL DIC
  1. Q:Y<0
  1. S ^UTILITY("XBDSET",$J,+Y)=""
  1. S XBDSQ=1
  1. Q
  1. ;
  1. SELECT ; GET SELECTED FILES
  1. S DIC="^DIC(",DIC(0)="AEMQ"
  1. F D ^DIC Q:Y<0 S ^UTILITY("XBDSET",$J,+Y)=""
  1. KILL DIC
  1. I '$O(^UTILITY("XBDSET",$J,""))!($D(DUOUT)) S XBDSQ=1 Q
  1. Q
  1. ;
  1. RANGE ; GET RANGE OF FILES
  1. S DIR(0)="NO^1:99999999:3",DIR("A")="From file number"
  1. D ^DIR
  1. KILL DIR
  1. I $D(DIRUT) S XBDSQ=1 Q
  1. S XBDSFF=+Y
  1. F S DIR(0)="NO^1:99999999:3",DIR("A")="Thru file number" D ^DIR KILL DIR Q:$D(DIRUT) D Q:'XBDSQ S XBDSQ=0
  1. . I +Y<XBDSFF W !," 'Thru FILE' number less than 'From FILE' number!",*7 S XBDSQ=9
  1. .Q
  1. I $D(DIRUT) S XBDSQ=1 Q
  1. S XBDSTF=+Y
  1. D RANGE2
  1. W !
  1. I XBDSC W !?4,XBDSC," file",$S(XBDSC=1:"",1:"s")," selected" I 1
  1. E W !?4,"No files selected",*7
  1. Q
  1. ;
  1. RANGE2 ; LABEL FOR EXTERNAL ENTRY POINT EN1
  1. S XBDSFILE=XBDSFF,XBDSC=0
  1. F D S XBDSFILE=$O(^DIC(XBDSFILE)) Q:XBDSFILE'=+XBDSFILE!(XBDSFILE>XBDSTF)
  1. . Q:'$D(^DIC(XBDSFILE,0))
  1. . S ^UTILITY("XBDSET",$J,XBDSFILE)=""
  1. . S XBDSC=XBDSC+1
  1. .Q
  1. Q
  1. ;
  1. PACKAGE ; GET FILES FROM SPECIFIC PACKAGE
  1. S DIC=9.4,DIC(0)="AEMQ"
  1. D ^DIC
  1. KILL DIC
  1. Q:Y<0
  1. S Y=+Y,X=0
  1. F S X=$O(^DIC(9.4,Y,4,X)) Q:X'=+X I $D(^DIC(^DIC(9.4,Y,4,X,0),0)) S ^UTILITY("XBDSET",$J,^DIC(9.4,Y,4,X,0))=""
  1. Q
  1. ;
  1. ; XB*3*8 start block
  1. BUILD ; Get files from selected BUILD
  1. S DIC=9.6,DIC(0)="AEMQ"
  1. D ^DIC
  1. KILL DIC
  1. Q:Y<0
  1. S Y=+Y,X=0
  1. F S X=$O(^XPD(9.6,Y,4,X)) Q:X'=+X I $D(^XPD(9.6,Y,4,X,0)) S ^UTILITY("XBDSET",$J,^XPD(9.6,Y,4,X,0))=""
  1. Q
  1. ; XB*3*8 end block
  1. ;
  1. LIST ; LIST FILES ALREADY SELECTED
  1. I '$D(^UTILITY("XBDSET",$J)) W !,"No files selected." Q
  1. W @IOF,"Files already selected:",!
  1. S XBDSX=""
  1. F S XBDSX=$O(^UTILITY("XBDSET",$J,XBDSX)) Q:XBDSX="" W !,XBDSX,?14,$P(^DIC(XBDSX,0),U,1) I $Y>(IOSL-3) D PXBSE Q:$D(DUOUT) W @IOF
  1. I '$D(DUOUT),$Y>(IOSL-10) D PXBSE
  1. Q
  1. ;
  1. PXBSE ; GIVE USER A CHANCE TO SEE LAST PAGE AND QUIT
  1. I IO=IO(0),$E(IOST,1,2)="C-" S Y=$$DIR^XBDIR("E")
  1. Q
  1. ;
  1. EN1 ;EP - Non-interactive selection of range of files.
  1. KILL ^UTILITY("XBDSET",$J)
  1. I '$D(XBDSLO)!('$D(XBDSHI)) Q
  1. S XBDSFF=XBDSLO,XBDSTF=XBDSHI
  1. D RANGE2
  1. D EOJ
  1. Q
  1. ;
  1. EOJ ;
  1. KILL XBDSC,XBDSFF,XBDSFILE,XBDSHI,XBDSL,XBDSLO,XBDSND,XBDSP,XBDSQ,XBDSTF,XBDSX
  1. KILL DIC,DIR,DIRUT,DTOUT,DUOUT,X,Y
  1. Q
  1. ;