ATSERCH8 ;TUCSON/DG;DISPLAYS OR PRINTS RESULTS TO THIS POINT [ 10/25/91 1:22 PM ]
;;2.5;SEARCH TEMPLATE COMPARISON;;OCT 25, 1991
;
S ATSEAGAN=0
S ATSENDIS=1000 ;WILL NOT DISPLAY INTERMEDIATE RESULTS IF TOO GREAT A COUNT
S ATSESURE=100 ;WILL ASK IF YOU'RE SURE IF ABOVE A CERTAIN COUNT
F L=0:0 Q:ATSEAGAN D ASK
I ATSEAGAN=2 D EOJ Q
S ATSEAGAN=0 ; RESET IN CASE ASK USER IF SURE THEY WANT A PRINTOUT
I ATSEARCH("MERGE COUNT")>ATSESURE F L=0:0 Q:ATSEAGAN D SURE
I ATSEAGAN=2 D EOJ Q
D PRINT
D @$S(POP:"EOJ",1:"^ATSERCHA")
I $S('$D(POP):1,'POP:1,1:0) D EOJ
Q
;
ASK ;ASKS USER IF WANTS TO DISPLAY/PRINT RESULTS TO THIS POINT
I ATSEARCH("MERGE COUNT")>ATSENDIS S ATSEAGAN=2 Q
W !!,"Do you want to print the results to this point" S %=2 D YN^DICN
I %=2!(%=-1) S ATSEAGAN=2 Q
I %=0 D HELP Q
I %=1 S ATSEAGAN=1 Q
Q
;
SURE ;IF GREATER THAN 90 MATCHES, USER ASKED IF THEY ARE SURE THEY WANT A DISPLAY
W !!,*7,"There are ",ATSEARCH("MERGE COUNT")," matches.",!,"Are you sure you want to print or display the results so far" S %=1 D YN^DICN
I %=2!(%=-1) S ATSEAGAN=2 Q
I %=1 S ATSEAGAN=1 Q
Q
;
PRINT ;
W !! S %IS="P" D ^%ZIS
Q
;
HELP ;
S XQH="ATSEARCH-PRINT",DIC(0)="X" D EN^XQH
W:$D(IOF) @IOF
Q
;
EOJ ;
I ATSEAGAN'=2,$I'=IO(0) X ^%ZIS("C")
K ATSEAGAN,ATSENDIS,ATSESURE
Q
;
ATSERCH8 ;TUCSON/DG;DISPLAYS OR PRINTS RESULTS TO THIS POINT [ 10/25/91 1:22 PM ]
+1 ;;2.5;SEARCH TEMPLATE COMPARISON;;OCT 25, 1991
+2 ;
+3 SET ATSEAGAN=0
+4 ;WILL NOT DISPLAY INTERMEDIATE RESULTS IF TOO GREAT A COUNT
SET ATSENDIS=1000
+5 ;WILL ASK IF YOU'RE SURE IF ABOVE A CERTAIN COUNT
SET ATSESURE=100
+6 FOR L=0:0
IF ATSEAGAN
QUIT
DO ASK
+7 IF ATSEAGAN=2
DO EOJ
QUIT
+8 ; RESET IN CASE ASK USER IF SURE THEY WANT A PRINTOUT
SET ATSEAGAN=0
+9 IF ATSEARCH("MERGE COUNT")>ATSESURE
FOR L=0:0
IF ATSEAGAN
QUIT
DO SURE
+10 IF ATSEAGAN=2
DO EOJ
QUIT
+11 DO PRINT
+12 DO @$SELECT(POP:"EOJ",1:"^ATSERCHA")
+13 IF $SELECT('$DATA(POP):1,'POP:1,1:0)
DO EOJ
+14 QUIT
+15 ;
ASK ;ASKS USER IF WANTS TO DISPLAY/PRINT RESULTS TO THIS POINT
+1 IF ATSEARCH("MERGE COUNT")>ATSENDIS
SET ATSEAGAN=2
QUIT
+2 WRITE !!,"Do you want to print the results to this point"
SET %=2
DO YN^DICN
+3 IF %=2!(%=-1)
SET ATSEAGAN=2
QUIT
+4 IF %=0
DO HELP
QUIT
+5 IF %=1
SET ATSEAGAN=1
QUIT
+6 QUIT
+7 ;
SURE ;IF GREATER THAN 90 MATCHES, USER ASKED IF THEY ARE SURE THEY WANT A DISPLAY
+1 WRITE !!,*7,"There are ",ATSEARCH("MERGE COUNT")," matches.",!,"Are you sure you want to print or display the results so far"
SET %=1
DO YN^DICN
+2 IF %=2!(%=-1)
SET ATSEAGAN=2
QUIT
+3 IF %=1
SET ATSEAGAN=1
QUIT
+4 QUIT
+5 ;
PRINT ;
+1 WRITE !!
SET %IS="P"
DO ^%ZIS
+2 QUIT
+3 ;
HELP ;
+1 SET XQH="ATSEARCH-PRINT"
SET DIC(0)="X"
DO EN^XQH
+2 IF $DATA(IOF)
WRITE @IOF
+3 QUIT
+4 ;
EOJ ;
+1 IF ATSEAGAN'=2
IF $IO'=IO(0)
XECUTE ^%ZIS("C")
+2 KILL ATSEAGAN,ATSENDIS,ATSESURE
+3 QUIT
+4 ;