[613] | 1 | LEXDFSB ; ISL Default Filter - Include/Exclude ; 09-23-96
|
---|
| 2 | ;;2.0;LEXICON UTILITY;;Sep 23, 1996;Build 1
|
---|
| 3 | ;
|
---|
| 4 | ; Entry: S X=$$EN^LEXDFSB
|
---|
| 5 | ;
|
---|
| 6 | ; Functions returns the Include/Exclude string for filters
|
---|
| 7 | ; which use the semantic class and types.
|
---|
| 8 | ;
|
---|
| 9 | ; String format:
|
---|
| 10 | ;
|
---|
| 11 | ; INC/INC/INC/INC/...ETC;EXC/EXC/EXC/EXC/...EXC
|
---|
| 12 | ;
|
---|
| 13 | ; Where INC is a semantic class or type to include
|
---|
| 14 | ; in searches, and EXC is a semantic class or type to
|
---|
| 15 | ; exclude from searches
|
---|
| 16 | ;
|
---|
| 17 | ; LEXC Counter
|
---|
| 18 | ; LEXI Include String
|
---|
| 19 | ; LEXE Exclude String
|
---|
| 20 | ; LEXA Local array containing include/exclude parameters
|
---|
| 21 | ; LEXX Include;Exclude string to be returned
|
---|
| 22 | ;
|
---|
| 23 | EN(LEXX) ; Create the Semantic Type String
|
---|
| 24 | I +$G(LEXA(0))>0 S LEXX="" D SET K LEXA Q LEXX
|
---|
| 25 | S LEXX=$$EN^LEXDFSI K:LEXX[U LEXA
|
---|
| 26 | I LEXX[U D Q LEXX
|
---|
| 27 | . S:LEXX["^^" LEXX="^^" Q:LEXX["^^" S:LEXX[U LEXX="^No filter selected" K LEXA
|
---|
| 28 | I $P(LEXX,U,1)="" S LEXX="^No filter selected" K LEXA Q LEXX
|
---|
| 29 | D:+$G(LEXA(0))>0 SET
|
---|
| 30 | K LEXA Q LEXX
|
---|
| 31 | ;
|
---|
| 32 | SET ; Create Semantic Include and Exclude strings from the array
|
---|
| 33 | ;
|
---|
| 34 | Q:+($G(LEXA(0)))=0
|
---|
| 35 | N LEXC,LEXT,LEXI,LEXE S (LEXI,LEXE)=""
|
---|
| 36 | F LEXC=1:1:LEXA(0) D
|
---|
| 37 | . I LEXA(LEXC,2,0)<LEXA(LEXC,1,0)!(LEXA(LEXC,2,0)=0) S LEXI=LEXI_"/"_LEXA(LEXC,0)
|
---|
| 38 | . I LEXA(LEXC,2,0)<LEXA(LEXC,1,0)&(LEXA(LEXC,2,0)'=0) D
|
---|
| 39 | . . F LEXT=1:1:LEXA(LEXC,2,0) D
|
---|
| 40 | . . . S LEXE=LEXE_"/"_LEXA(LEXC,2,LEXT,0)
|
---|
| 41 | . I LEXA(LEXC,2,0)'<LEXA(LEXC,1,0)&(LEXA(LEXC,2,0)'=0) D
|
---|
| 42 | . . F LEXT=1:1:LEXA(LEXC,1,0) D
|
---|
| 43 | . . . S LEXI=LEXI_"/"_LEXA(LEXC,1,LEXT,0)
|
---|
| 44 | S:LEXI'["UNK" LEXI=LEXI_"/UNK" S:$E(LEXI,1)="/" LEXI=$E(LEXI,2,$L(LEXI))
|
---|
| 45 | S:$E(LEXE,1)="/" LEXE=$E(LEXE,2,$L(LEXE)) S LEXX=LEXI_";"_LEXE
|
---|
| 46 | K LEXA Q
|
---|