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

LEXDFSB.m

Go to the documentation of this file.
  1. LEXDFSB ;ISL/KER - Default Filter - Include/Exclude ;04/21/2014
  1. ;;2.0;LEXICON UTILITY;**80**;Sep 23, 1996;Build 1
  1. ;
  1. ; Entry: S X=$$EN^LEXDFSB
  1. ;
  1. ; Functions returns the Include/Exclude string for filters
  1. ; which use the semantic class and types.
  1. ;
  1. ; String format:
  1. ;
  1. ; INC/INC/INC/INC/...ETC;EXC/EXC/EXC/EXC/...EXC
  1. ;
  1. ; Where INC is a semantic class or type to include
  1. ; in searches, and EXC is a semantic class or type to
  1. ; exclude from searches
  1. ;
  1. ; LEXC Counter
  1. ; LEXI Include String
  1. ; LEXE Exclude String
  1. ; LEXA Local array containing include/exclude parameters
  1. ; LEXX Include;Exclude string to be returned
  1. ;
  1. EN(LEXX) ; Create the Semantic Type String
  1. I +$G(LEXA(0))>0 S LEXX="" D SET K LEXA Q LEXX
  1. S LEXX=$$EN^LEXDFSI K:LEXX[U LEXA
  1. I LEXX[U D Q LEXX
  1. . S:LEXX["^^" LEXX="^^" Q:LEXX["^^" S:LEXX[U LEXX="^No filter selected" K LEXA
  1. I $P(LEXX,U,1)="" S LEXX="^No filter selected" K LEXA Q LEXX
  1. D:+$G(LEXA(0))>0 SET
  1. K LEXA Q LEXX
  1. ;
  1. SET ; Create Semantic Include and Exclude strings from the array
  1. ;
  1. Q:+($G(LEXA(0)))=0
  1. N LEXC,LEXT,LEXI,LEXE S (LEXI,LEXE)=""
  1. F LEXC=1:1:LEXA(0) D
  1. . I LEXA(LEXC,2,0)<LEXA(LEXC,1,0)!(LEXA(LEXC,2,0)=0) S LEXI=LEXI_"/"_LEXA(LEXC,0)
  1. . I LEXA(LEXC,2,0)<LEXA(LEXC,1,0)&(LEXA(LEXC,2,0)'=0) D
  1. . . F LEXT=1:1:LEXA(LEXC,2,0) D
  1. . . . S LEXE=LEXE_"/"_LEXA(LEXC,2,LEXT,0)
  1. . I LEXA(LEXC,2,0)'<LEXA(LEXC,1,0)&(LEXA(LEXC,2,0)'=0) D
  1. . . F LEXT=1:1:LEXA(LEXC,1,0) D
  1. . . . S LEXI=LEXI_"/"_LEXA(LEXC,1,LEXT,0)
  1. S:LEXI'["UNK" LEXI=LEXI_"/UNK" S:$E(LEXI,1)="/" LEXI=$E(LEXI,2,$L(LEXI))
  1. S:$E(LEXE,1)="/" LEXE=$E(LEXE,2,$L(LEXE)) S LEXX=LEXI_";"_LEXE
  1. K LEXA Q