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

ATSERCH6.m

Go to the documentation of this file.
ATSERCH6 ;TUCSON/DG;DISPLAYS THE RESULTS FROM THE COMBINED SEARCH.  ALSO ASKS USER FOR AND  [ 10/25/91  1:22 PM ]
 ;;2.5;SEARCH TEMPLATE COMPARISON;;OCT 25, 1991
 ;PROVIDES INSTRUCTION RE:COMPARE COMBINED RESULTS TO ANOTHER TEMPLATE
 ;OR TO CREATE A SEARCH TEMPLATE TO BE LINKED TO THE FILE CHOSEN
 ;
 W:$D(IOF) @IOF
 D MATCHES
 I ATSFLAG D EOJ Q
 D DISPLAY
 K ATSAGAN
 D ^ATSERCH8
 W:$D(IOF) @IOF
 D EOJ
 Q
 ;
MATCHES ;
 I ATSEARCH("MERGE COUNT")'=1 W !!,"There were ",ATSEARCH("MERGE COUNT")," matches associated with the ",$P(^DIC(ATSEARCH("FILELINK"),0),U)," file." I 'ATSEARCH("MERGE COUNT") W *7 H 3
 I ATSEARCH("MERGE COUNT")=1 W !!,"There was ",ATSEARCH("MERGE COUNT")," match associated with the ",$P(^DIC(ATSEARCH("FILELINK"),0),U)," file."
 I ATSEARCH("MERGE COUNT")=0 S ATSFLAG=$S(ATSLOOP=1:1,1:2) S:ATSFLAG=2 ATSEARCH("FILELINK")=^UTILITY("ATSEARCH",$J,"FILELINK")
 ;IF FIRST TIME THROUGH AND NO MATCHES, QUIT.  IF LATER COMPARE, GIVE USER A CHANCE TO SAVE RESULTS UP UNTIL LAST COMPARE SO AS TO SAVE INTERMEDIATE RESULTS
 Q
 ;
DISPLAY ;DISPLAYS ALL SEARCH PARAMETERS
 K % ;IN CASE LEFT FROM DI* ROUTINES
 I ATSMTCH=""&(ATSEINRL) W !!,"INTERMEDIATE RESULTS compared to itself via the",!,"   "_ATSEARCH(1,"FIELD")_"  "_ATSEARCH(1,"FIELDNAME")_" field   ["_ATSEARCH(1,"SRCHFILENAM")_"]"
 I ATSMTCH]"" W !!,"For entries in:",!,$S(ATSMTCH=1:ATSEARCH(1,"SRCHNAM")_" and also in "_ATSEARCH(2,"SRCHNAM"),ATSMTCH=2:ATSEARCH(1,"SRCHNAM")_" but not in "_ATSEARCH(2,"SRCHNAM"),1:ATSEARCH(2,"SRCHNAM")_" but not in "_ATSEARCH(1,"SRCHNAM"))
 D @$S(ATSMTCH]"":"DISPLAY2",ATSMTCH=""&ATSEINRL:"^ATSERCHC",1:"DISPLAYX")
 F L=0:0 Q:ATSLOOP'>1!($D(ATSAGAN))  D PARAMS
 Q
 ;
DISPLAY2 ;DISPLAY PARAMETERS
 I ATSLOOP=1 W !!,"Search specifications are as follows for the two templates:",!
 E  W !!,"Search specifications are as follows for the ",ATSEARCH(2,"SRCHNAM")," template."
 F ATSI=ATSLOOP Q:'$D(ATSEARCH("SEARCHSPECS",ATSI))  S ATSCT=0 F L=0:0 S ATSCT=$O(ATSEARCH("SEARCHSPECS",ATSI,ATSCT)) Q:ATSCT'=+ATSCT  D DISPLAY3
 Q
 ;
DISPLAYX ;IF TEMPLATES BEING COMPARED ARE THE SAME (ATSMTCH="")
 F ATSI=ATSLOOP Q:'$D(ATSEARCH("SEARCHSPECS",ATSI))  S ATSCT=0 F L=0:0 S ATSCT=$O(ATSEARCH("SEARCHSPECS",ATSI,ATSCT)) Q:ATSCT'=+ATSCT  D DISPLAY3
 Q
 ;
DISPLAY3 ;CONTINUATION OF FOR LOOP
 S ATSVAR=0 F ATSL=0:0 S ATSVAR=$O(@(ATSEARCH("SEARCHSPECS",ATSI,ATSCT)_ATSVAR_")")) Q:ATSVAR'=+ATSVAR  W:ATSLOOP=1&(ATSCT=2)&(ATSVAR=1) ! D LOOPCONT W !,@(ATSEARCH("SEARCHSPECS",ATSI,ATSCT)_ATSVAR_",0"_")")_ATSXVAR D ^ATSERCHC
 Q
 ;
LOOPCONT ;CONTS LOOP IN DISPLAY3 JUST BEFORE WRITE SEARCH PARAMETER
 ;DETERMINES WHAT FILE THE SEARCH PARAMETER IS LINKED TO
 S ATSXVAR=$S(ATSI=1&(ATSCT=1)&(ATSVAR=1):"   ["_ATSEARCH(1,"SRCHFILENAM")_"]",ATSI=1&(ATSCT=2)&(ATSVAR=1):"   ["_ATSEARCH(2,"SRCHFILENAM")_"]",ATSI>1&(ATSVAR=1):"   ["_ATSEARCH(2,"SRCHFILENAM")_"]",1:"")
 Q
 ;
PARAMS ;ASKS USER IF WANTS DISPLAY OF ALL DONE SO FAR
 ;IF SO, DISPLAYS PREVIOUS COMPARISONS
 W !!,"Do you want a display of all you have done so far" S %=2 D YN^DICN
 I %=2!(%=-1) S ATSAGAN="" Q
 I %=0 S XQH="ATSEARCH-DISPLAY-SEARCH-SPECS" D EN^XQH W:$D(IOF) @IOF Q
 W:$D(IOF) @IOF
 F ATSI=1:1 Q:'$D(^UTILITY("ATSPECS",$J,ATSI))  W !!,ATSI,". ",$P(^UTILITY("ATSPECS",$J,ATSI,0),U) W:ATSI'=1 !,$P(^(0),U,2) S ATSP=0 F L=0:0 S ATSP=$O(^UTILITY("ATSPECS",$J,ATSI,ATSP)) Q:ATSP'=+ATSP  W !,"     ",^UTILITY("ATSPECS",$J,ATSI,ATSP)
 S ATSAGAN=""
 Q
 ;
EOJ ;
 K ATSI,ATSAGAN,ATSP,%,ATSCT
 Q
 ;