ATSERCHB ;TUCSON/DG;MENU FOR CHOICES TO LINK TO [ 10/25/91 1:22 PM ]
;;2.5;SEARCH TEMPLATE COMPARISON;;OCT 25, 1991
;
F ATSENB=1:1:3 S ATSEOP(ATSENB)=$P($T(OPTIONS+ATSENB),";",3)
I ATSEARCH(1,"SRCHFILENUM")=ATSEARCH(2,"SRCHFILENUM") D ASKFILE3,EOJ Q
D @$S(ATSNOT="":"ASKFILE4",1:"ASKFILE5"),EOJ Q ;IF TWO TEMPLATES LINKED TO DIFFERENT FILES
;
ASKFILE3 ;SRCHFILE1=SRCHFILE2, IF DIFFERENCE, THEN UTILIZE THE TEMPLATE THAT
;HAS THE ENTRIES YOU WILL STORE TO CREATE THE "MERGED" UTILITY NODES
W !!,"Results will be linked with the ",@ATSEOP(1)_" file" H 2
S ATSENB=$S(ATSMTCH=3:2,1:1) ; IF ATSMTCH=3 THEN USE TEMPLATE TWO
S ATSEARCH("FILELINK")=ATSEARCH(1,"SRCHFILENUM")
;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
;
ASKFILE4 ;PTRFILE,SRCHFILE1,SRCHFILE2 DIFF FILES, INTERSECTION OF TEMPLATES
S X="" F ATSL=0:0 Q:(X'<1&(X'>2))!(X="^")!(ATSFLAG) D:X["?" HELP D ASKLOOP4
I ATSFLAG Q
S ATSEARCH("FILELINK")=$S(X=1:ATSEARCH(1,"SRCHFILENUM"),1:ATSEARCH(2,"SRCHFILENUM")),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) R !!,"Your choice (1-2): ",X:DTIME
S:'$T X="^" I "^"[X S ATSFLAG=$S($D(^UTILITY("ATSEARCH",$J,"MERGED")):2,1:1)
Q
;
ASKFILE5 ;PTRFILE,SRCHFILE1,SRCHFILE2, DIFF FILES, DIFFERENCE BETWEEN TEMPLATES
S ATSENB=$S(ATSMTCH=2:1,1:2)
;
;CAN ONLY LINK TO TEMPLATE THAT HAS THE ENTRIES YOU WANT
;THE "NOT TEMPLATE" CANNOT BE CHOSEN
;NOR CAN THE POINTER FILE BE CHOSEN
;
W !!,"Results will be linked to the ",@ATSEOP(ATSENB)_" file" H 2
S ATSEARCH("FILELINK")=ATSEARCH(ATSENB,"SRCHFILENUM")
S ATSX=ATSENB
D ^ATSERCH4
Q
;
HELP ;CALL TO HELP FRAME
S XQH="ATSEARCH-LINK",DIC(0)="X" D EN^XQH
W:$D(IOF) @IOF
Q
;
EOJ ;
K ATSEOP,ATSENB,ATSEY
Q
;
OPTIONS ;MENU CHOICES
;;ATSEARCH(1,"SRCHFILENAM")
;;ATSEARCH(2,"SRCHFILENAM")
;;ATSEARCH("PTRFILENAM")
;;
ATSERCHB ;TUCSON/DG;MENU FOR CHOICES TO LINK TO [ 10/25/91 1:22 PM ]
+1 ;;2.5;SEARCH TEMPLATE COMPARISON;;OCT 25, 1991
+2 ;
+3 FOR ATSENB=1:1:3
SET ATSEOP(ATSENB)=$PIECE($TEXT(OPTIONS+ATSENB),";",3)
+4 IF ATSEARCH(1,"SRCHFILENUM")=ATSEARCH(2,"SRCHFILENUM")
DO ASKFILE3
DO EOJ
QUIT
+5 ;IF TWO TEMPLATES LINKED TO DIFFERENT FILES
DO @$SELECT(ATSNOT="":"ASKFILE4",1:"ASKFILE5")
DO EOJ
QUIT
+6 ;
ASKFILE3 ;SRCHFILE1=SRCHFILE2, IF DIFFERENCE, THEN UTILIZE THE TEMPLATE THAT
+1 ;HAS THE ENTRIES YOU WILL STORE TO CREATE THE "MERGED" UTILITY NODES
+2 WRITE !!,"Results will be linked with the ",@ATSEOP(1)_" file"
HANG 2
+3 ; IF ATSMTCH=3 THEN USE TEMPLATE TWO
SET ATSENB=$SELECT(ATSMTCH=3:2,1:1)
+4 SET ATSEARCH("FILELINK")=ATSEARCH(1,"SRCHFILENUM")
+5 ;FOR FILELINK, ATSEARCH(1,"SRCHFILENUM")=(2,"SRCHFILENUM")
+6 SET ATSX=ATSENB
+7 ;ATSX IS USEFUL ONLY IF USER WANTS RESULTS NOT LINKED TO PTR FILE
+8 DO ^ATSERCH4
+9 QUIT
+10 ;
ASKFILE4 ;PTRFILE,SRCHFILE1,SRCHFILE2 DIFF FILES, INTERSECTION OF TEMPLATES
+1 SET X=""
FOR ATSL=0:0
IF (X'<1&(X'>2))!(X="^")!(ATSFLAG)
QUIT
IF X["?"
DO HELP
DO ASKLOOP4
+2 IF ATSFLAG
QUIT
+3 SET ATSEARCH("FILELINK")=$SELECT(X=1:ATSEARCH(1,"SRCHFILENUM"),1:ATSEARCH(2,"SRCHFILENUM"))
SET ATSX=X
+4 DO ^ATSERCH4
+5 QUIT
+6 ;
ASKLOOP4 ;CONTINUATION OF FOR LOOP IN ASKFILE4
+1 WRITE !!,"Choose, by number, the file you want merged results linked to:",!!,1," ",@ATSEOP(1),!,2," ",@ATSEOP(2)
READ !!,"Your choice (1-2): ",X:DTIME
+2 IF '$TEST
SET X="^"
IF "^"[X
SET ATSFLAG=$SELECT($DATA(^UTILITY("ATSEARCH",$JOB,"MERGED")):2,1:1)
+3 QUIT
+4 ;
ASKFILE5 ;PTRFILE,SRCHFILE1,SRCHFILE2, DIFF FILES, DIFFERENCE BETWEEN TEMPLATES
+1 SET ATSENB=$SELECT(ATSMTCH=2:1,1:2)
+2 ;
+3 ;CAN ONLY LINK TO TEMPLATE THAT HAS THE ENTRIES YOU WANT
+4 ;THE "NOT TEMPLATE" CANNOT BE CHOSEN
+5 ;NOR CAN THE POINTER FILE BE CHOSEN
+6 ;
+7 WRITE !!,"Results will be linked to the ",@ATSEOP(ATSENB)_" file"
HANG 2
+8 SET ATSEARCH("FILELINK")=ATSEARCH(ATSENB,"SRCHFILENUM")
+9 SET ATSX=ATSENB
+10 DO ^ATSERCH4
+11 QUIT
+12 ;
HELP ;CALL TO HELP FRAME
+1 SET XQH="ATSEARCH-LINK"
SET DIC(0)="X"
DO EN^XQH
+2 IF $DATA(IOF)
WRITE @IOF
+3 QUIT
+4 ;
EOJ ;
+1 KILL ATSEOP,ATSENB,ATSEY
+2 QUIT
+3 ;
OPTIONS ;MENU CHOICES
+1 ;;ATSEARCH(1,"SRCHFILENAM")
+2 ;;ATSEARCH(2,"SRCHFILENAM")
+3 ;;ATSEARCH("PTRFILENAM")
+4 ;;