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

ATSERCH7.m

Go to the documentation of this file.
ATSERCH7 ;TUCSON/DG;MATCH ENTRIES OR USE ENTRIES IN ONLY ONE TEMPLATE [ 10/25/91  1:37 PM ]
 ;;2.5;SEARCH TEMPLATE COMPARISON;;OCT 25, 1991
 ;
 D MATCH
 I ATSFLAG D EOJ Q
 D EOJ
 Q
 ;
MATCH ;ASKS USER IF WANTS TO MATCH ENTRIES IN EACH TEMPLATE OR
 ;WANTS ENTRIES IN ONE TEMPLATE AND NOT IN THE OTHER
 I ATSEARCH(1,"SRCHNAM")=ATSEARCH(2,"SRCHNAM") S (ATSMTCH,ATSNOT)="" Q
 I ATSEARCH(1,"SRCHFILENUM")=ATSEARCH(2,"SRCHFILENUM") S ATSFR=4
 E  S ATSFR=3
 S X="" F ATSL=0:0 Q:X=+X&(X'<1&(X'>ATSFR))  D:X["?" HELP D MATCH1 W !!,"Your choice (1-",ATSFR,"): 1// " R X:DTIME S:X=""&($T) X=1 S:'$T X="^" I X="^" S ATSFLAG=$S($D(^UTILITY("ATSEARCH",$J,"MERGED")):2,1:1) Q
 I X=4 D ^ATSERCHF S ATSFLAG=1
 I ATSFLAG Q
 E  S ATSMTCH=X,ATSNOT=$S(X=1:"",1:"'")
 Q
 ;
MATCH1 ;CONTINUATION OF MATCH, DISPLAYS MENU
 W !!,"Choose, by number, one of the following:",!!,1," Select entries in ",ATSEARCH(1,"SRCHNAM")," and also in ",ATSEARCH(2,"SRCHNAM")
 W !,2," Select entries in ",ATSEARCH(1,"SRCHNAM")," but not in ",ATSEARCH(2,"SRCHNAM")
 W !,3," Select entries in ",ATSEARCH(2,"SRCHNAM")," but not in ",ATSEARCH(1,"SRCHNAM")
 I ATSFR=4 W !,4," Select entries in ",ATSEARCH(2,"SRCHNAM")," or in ",ATSEARCH(1,"SRCHNAM"),"  (Join templates)"
 Q
 ;
NULL ; - EP - ASKS USER IF WANT NULL VALUES
 I ATSEARCH(1,"SRCHRESLTREF")=ATSEARCH(2,"SRCHRESLTREF") S ATSENLAG=1 Q  ;BOTH TEMPLATES THE SAME, CAN'T LINK TO PTED TO FILE (NULLS), ALREADY LINKED TO "HOST" FILE
 I ATSEARCH(1,"FIELD")=.01,ATSEARCH(2,"FIELD")=.01 S ATSENLAG=1 Q
 I ATSEARCH("PTRFILENUM")=ATSEARCH(1,"SRCHFILENUM")!(ATSEARCH("PTRFILENUM")=ATSEARCH(2,"SRCHFILENUM")) S ATSENLAG=1 Q
 ;IF ONE OF THE SEARCH FILES IS THE POINTED TO FILE, THERE IS NO WAY TO HAVE A NULL ENTRY IN ITS SEARCH TEMPLATE SINCE YOU HAVE TO USE TH E .01 FIELD OF THE PTED TO FILE AS ONE OF THE FIELDS TO COMPARE TO
 W !!,"Do you want to include those entries whose pointer field value is null" S %=2 D YN^DICN
 I %=2 S ATSENLAG=1 Q
 I %=1 S ATSENLAG=2 Q  ;INCLUDE NULL POINTER FIELD VALUES
 I %=0 S XQH="ATSEARCH-NULL",DIC(0)="X" D EN^XQH W @IOF Q
 I %=-1 S ATSENLAG=1,ATSFLAG=$S($D(^UTILITY("ATSEARCH",$J,"MERGED")):2,1:1)
 Q
 ;
HELP ;HELP FOR MENU
 S XQH="ATSEARCH-ENTRIES",DIC(0)="X" D EN^XQH
 W:$D(IOF) @IOF
 Q
 ;
EOJ ;
 K X,ATSFR
 Q
 ;