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

ATSERCH9.m

Go to the documentation of this file.
ATSERCH9 ;TUCSON/DG;MENU FOR CHOICES TO LINK TO  [ 10/25/91  1:40 PM ]
 ;;2.5;SEARCH TEMPLATE COMPARISON;;OCT 25, 1991
 ;
 F ATSENB=1:1:3 S ATSEOP(ATSENB)=$P($T(OPTIONS+ATSENB),";",3)
 I ($D(ATSNPT)&(ATSNOT=""))!(ATSEARCH(1,"SRCHRESLTREF")=ATSEARCH(2,"SRCHRESLTREF")) D PTRONLY,EOJ Q
 I ATSEARCH("PTRFILENUM")=ATSEARCH(2,"SRCHFILENUM")!(ATSEARCH("PTRFILENUM")=ATSEARCH(1,"SRCHFILENUM")) D ASKFILE,EOJ Q
 I ATSEARCH(1,"SRCHFILENUM")=ATSEARCH(2,"SRCHFILENUM"),ATSEARCH(1,"FIELD")=.01,ATSEARCH(1,"SECONDPCE")["P" D ASKFILE3,EOJ Q  ;.01 FIELD IS A POINTER
 I ATSEARCH(1,"SRCHFILENUM")=ATSEARCH(2,"SRCHFILENUM") D ASKFILE3,EOJ Q
 D @$S(ATSNOT="":"ASKFILE4",1:"ASKFILE5^ATSERCHH"),EOJ Q  ;IF TWO TEMPLATES LINKED TO DIFFERENT FILES
 ;
ASKFILE ;PTRFILE=SRCHFILE1 OR SRCHFILE2
 S X="" F ATSL=0:0 Q:X=1!(X=2)!(X="^")!(ATSFLAG)  D:X["?" HELP D @$S(ATSNOT="":"ASKLOOP",1:"ASKLOOP2")
 I ATSFLAG Q
 S ATSEARCH("FILELINK")=ATSEARCH(X,"SRCHFILENUM"),ATSX=X
 D ^ATSERCH4
 Q
 ;
ASKLOOP ;CONTINUATION OF FOR LOOP IN ASKFILE IF INTERSECTION OF TEMPLATES
 I ATSEARCH("PTRFILENUM")=ATSEARCH(1,"SRCHFILENUM") S ATSEY=1
 E  S ATSEY=2
 W !!,"Choose, by number, the file you want merged results linked to:",!!,1," ",@ATSEOP(1),!,2," ",@ATSEOP(2) W !!,"Your choice (1 or 2): ",ATSEY,"// " R X:DTIME
 S:X=""&($T) X=ATSEY S:'$T X="^" I "^"=X S ATSFLAG=$S($D(^UTILITY("ATSEARCH",$J,"MERGED")):2,1:1)
 Q
 ;
ASKLOOP2 ;PTRFILE=SRCHFILE1 OR SRCHFILE2, DIFFERENCE BETWEEN TEMPLATES
 W !!,"Results will be linked with the ",@$S(ATSMTCH=2:ATSEOP(1),1:ATSEOP(2))_" file" H 2
 S X=$S(ATSMTCH=2:1,1:2)
 ;
 ;IF MATCH=2 THEN CAN ONLY LINK TO TEMPLATE 1
 ;IF MATCH=3 THEN CAN ONLY LINK TO TEMPLATE 2
 ;
 Q
 ;
PTRONLY ;LINKS ONLY TO PTRFILE IF TEMPLATES LINKED TO SAME FILE
 S ATSEARCH("FILELINK")=ATSEARCH("PTRFILENUM")
 W !!,"Results will be linked with the ",ATSEARCH("PTRFILENAM")," file" H 2
 D ^ATSERCH4
 Q
 ;
ASKFILE3 ;SRCHFILE1=SRCHFILE2, IF DIFFERENCE, THEN UTILIZE THE TEMPLATE THAT
 ;HAS THE ENTRIES YOU WILL STORE TO CREATE THE "MERGED" UTILITY NODES
 S X="" F ATSL=0:0 Q:X=1!(X=2)!(X="^")!(ATSFLAG)  D:X["?" HELP D ASKLOOP3
 I ATSFLAG Q
 S ATSENB=$S(ATSMTCH=3:2,1:1) ; IF ATSMTCH=3 THEN USE TEMPLATE TWO
 S ATSEARCH("FILELINK")=$S(X=1:ATSEARCH(1,"SRCHFILENUM"),1:ATSEARCH("PTRFILENUM"))
 ;FOR FILELINK, ATSEARCH(1,"SRCHFILENUM")=(2,"SRCHFILENUM")
 S ATSX=ATSENB
 ;ATSX IS USEFUL ONLY IF USER WANTS RESULTS NOT LINKED TO PTR FILE
 D ^ATSERCH4
 Q
 ;
ASKLOOP3 ;CONTINUATION OF FOR LOOP IN ASKFILE3
 W !!,"Choose, by number, the file you want results linked to:",!!,1," ",@ATSEOP(1),!,2," ",@ATSEOP(3) R !!,"Your choice (1 or 2): 2// ",X:DTIME
 S:X=""&($T) X=2 S:'$T X="^" I "^"=X S ATSFLAG=$S($D(^UTILITY("ATSEARCH",$J,"MERGED")):2,1:1)
 Q
 ;
ASKFILE4 ;PTRFILE,SRCHFILE1,SRCHFILE2 DIFF FILES, INTERSECTION OF TEMPLATES
 S X="" F ATSL=0:0 Q:(X'<1&(X'>3))!(X="^")!(ATSFLAG)  D:X["?" HELP D ASKLOOP4
 I ATSFLAG Q
 S ATSEARCH("FILELINK")=$S(X=1:ATSEARCH(1,"SRCHFILENUM"),X=2:ATSEARCH(2,"SRCHFILENUM"),1:ATSEARCH("PTRFILENUM")),ATSX=X
 D ^ATSERCH4
 Q
 ;
ASKLOOP4 ;CONTINUATION OF FOR LOOP IN ASKFILE4
 W !!,"Choose, by number, the file you want merged results linked to:",!!,1," ",@ATSEOP(1),!,2," ",@ATSEOP(2),!,3," ",@ATSEOP(3) R !!,"Your choice (1-3): 3// ",X:DTIME
 S:X=""&($T) X=3 S:'$T X="^" I "^"=X S ATSFLAG=$S($D(^UTILITY("ATSEARCH",$J,"MERGED")):2,1:1)
 Q
 ;
HELP ; - EP - CALL TO HELP FRAME
 S XQH="ATSEARCH-LINK",DIC(0)="X" D EN^XQH
 W:$D(IOF) @IOF
 Q
 ;
EOJ ;
 K ATSEOP,ATSENB,ATSEY,ATSNPT
 Q
 ;
OPTIONS ;MENU CHOICES
 ;;ATSEARCH(1,"SRCHFILENAM")
 ;;ATSEARCH(2,"SRCHFILENAM")
 ;;ATSEARCH("PTRFILENAM")
 ;;