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

LEXDFSS.m

Go to the documentation of this file.
  1. LEXDFSS ;ISL/KER - Default Filter - Semantics/Sources ;04/21/2014
  1. ;;2.0;LEXICON UTILITY;**80**;Sep 23, 1996;Build 10
  1. ;
  1. ; Global Variables
  1. ; ^TMP("LEXTSAB") SACC 2.3.2.5.1
  1. ;
  1. ; External References
  1. ; ^DIR ICR 10026
  1. ;
  1. ; Entry: S X=$$EN^LEXDFSS
  1. ;
  1. ; LEXFIL Filter (executable)
  1. ; LEXNAM Filter Name
  1. ; LEXPRO Y/N response to proceed with building filter
  1. ; LEXSTR Filter parameters (string)
  1. ; LEXSRC Classification system (sources) portion of filter
  1. ; LEXSTY Semantic Class/Type portion of filter
  1. ; LEXX Filter returned
  1. ;
  1. EN(LEXX) ; Entry point S X=$$EN^LEXDFSS
  1. N LEXSTY,LEXSRC,LEXFIL,LEXPRO
  1. S (LEXSTY,LEXSRC,LEXX)="",LEXFIL=0 D INTRO S LEXPRO=$$PRO
  1. Q:LEXPRO["^" LEXPRO Q:LEXPRO'=1 "^No filter selected"
  1. S LEXSTY=$$EN^LEXDFSB Q:LEXSTY["^^" "^^"
  1. S LEXFIL=0 S LEXSRC=$$EN^LEXDCCC Q:LEXSRC["^^" "^^"
  1. Q:$P(LEXSTY,"^",1)="" "^No filter selected"
  1. S LEXSTY=$P(LEXSTY,"^",1),LEXSRC=$P(LEXSRC,"^",1)
  1. Q:'$L((LEXSTY_LEXSRC)) "^No filter selected"
  1. S LEXFIL=1 I $L(LEXSTY),'$L(LEXSRC) D
  1. . N DIR,X,Y,DTOUT,DUOUT,DIRUT,DIROUT W !
  1. . S DIR("A",1)="You have selected semantic classes/types to Include/Exclude in your filter"
  1. . S DIR("A",2)="but have not selected any classification coding systems to include in the"
  1. . S DIR("A",3)="filter. Do you want to contine to build the filter based solely on the"
  1. . S DIR("A")="semantic classes/types you selected? "
  1. . S DIR("B")="YES",DIR("?")="Answer Yes or No",DIR(0)="YAO" D ^DIR
  1. . K DIR S LEXFIL=0,LEXX="^^" S:+Y>0 LEXFIL=+Y,LEXX=""
  1. D:LEXFIL ASSEM Q LEXX
  1. INTRO ; Introduction/Proceed
  1. N LEXSAB D SAB W @IOF
  1. ;W !,"FILTER BY BOTH SEMANTIC CLASSES/TYPES AND CLASSIFICATION CODES"
  1. W !!,"This search filter is in two segments. The first segment limits the search"
  1. W !,"based on the semantical classification of the terms. The second segment "
  1. W !,"limits the search based on classification coding systems."
  1. W !!,"First, you will be provided with ",($P(^LEX(757.11,0),U,4))-1," semantic classes. By selecting"
  1. W !,"a semantic class, each term which is found during a search of the "
  1. W !,"Lexicon, and belongs to that class, will be displayed for your selection."
  1. W !,"Additionally, each semantic class contains semantic types (or sub-categories)"
  1. W !,"which may be excluded during the search Terms belonging to an ""included"" "
  1. W !,"semantic class will be displayed unless they also belong to an ""excluded"" "
  1. W !,"semantic type. This segment is mandatory (can not be null)."
  1. ;
  1. W !!,"Secondly, you will be presented with ",LEXSAB," classification systems to include."
  1. W !,"By selecting a classification system to include (i.e., ICD), any term which"
  1. W !,"is linked to a code from that system will be displayed for selection. "
  1. W !,"Inclusion by classification code will over ride ""exclusion by sematical"
  1. W !,"class or type"". This segment is optional (may be null)."
  1. K LEXSAB
  1. Q
  1. SAB N LEXI S LEXI="",LEXSAB=0
  1. F S LEXI=$O(^LEX(757.03,"B",LEXI)) Q:LEXI="" D
  1. . Q:'$D(^LEX(757.02,"ASRC",$E(LEXI,1,3)))
  1. . S:'$D(^TMP("LEXTSAB",$J,$E(LEXI,1,3))) ^TMP("LEXTSAB",$J,$E(LEXI,1,3))="",LEXSAB=LEXSAB+1
  1. K ^TMP("LEXTSAB",$J)
  1. Q
  1. PRO(LEXX) ; OK to proceed Y/N
  1. N DIR,X,Y,DTOUT,DUOUT,DIRUT,DIROUT W !!
  1. S DIR("A")="Do you wish to continue: ",DIR("B")="YES"
  1. S DIR("?")="Answer Yes or No",DIR("??")="^D PROH^LEXDFSS"
  1. S DIR(0)="YAO" D ^DIR S LEXX=Y Q LEXX
  1. PROH ; Proceed help
  1. W !!,?2,"Answer"
  1. W !!,?4,"Yes Build a filter based Semantic Types and Classification Codes"
  1. W !,?4,"No Exit without building a filter",! Q
  1. ASSEM ; Assemble the return value FILTER^NAME
  1. N LEXSTR,LEXNAM,LEXFIL S (LEXNAM,LEXFIL)=""
  1. I $L($G(LEXSTY)),$D(LEXSRC) D
  1. . S LEXSTR=LEXSTY
  1. . I $L($G(LEXSRC)),$G(LEXSRC)'[U S LEXSTR=LEXSTY_";"_LEXSRC
  1. . S LEXFIL="I $$SC^LEXU(Y,"_""""_LEXSTR_""""_")"
  1. I LEXFIL[U S LEXNAM=$$NAME^LEXDM3 I LEXNAM="^^" S LEXX="^^"
  1. S:LEXX["^^" LEXFIL="",LEXNAM="^" S LEXX=LEXFIL_"^"_LEXNAM Q