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

LEXDCCC.m

Go to the documentation of this file.
  1. LEXDCCC ;ISL/KER - Default Display - Create ;04/21/2014
  1. ;;2.0;LEXICON UTILITY;**80**;Sep 23, 1996;Build 10
  1. ;
  1. ; Global Variables
  1. ; ^TMP("LEXX") SACC 2.3.2.5.1
  1. ;
  1. ; External References
  1. ; YN^DICN ICR 10009
  1. ;
  1. ; Entry: S X=$$EN^LEXDCCC
  1. ;
  1. ; Function returns a two piece string
  1. ;
  1. ; $P 1 String of classifications coding
  1. ; system mnemonics, i.e., "ICD/CPT",
  1. ; and a legitimate value for LEXSHOW.
  1. ; This will be null if input is "^"
  1. ;
  1. ; $P 2 Name of display string selected i.e.,
  1. ; "ICD/CPT only" This will be null only
  1. ; when user input is "^^"
  1. ;
  1. ; LEXA Answer to prompt (Yes 1 No 0)
  1. ; LEXC Counter
  1. ; LEXI Incremental Counter
  1. ; LEXS Source, i.e., ICD94, NAN90, CPT89
  1. ; LEXSO Source abbreviation, i.e., ICD, CPT, DSM
  1. ; LEXR Internal Entry (Record) Number in #757.31
  1. ;
  1. ; LEXFIL Flag, indicates that the
  1. ; classification codes selected are
  1. ; for building a filter - DIC("S")
  1. ;
  1. T S X=$$EN W !!,X Q
  1. EN(LEXX) ; Entry point S X=$$EN^LEXDCCC
  1. BUILD ; Build the list to select from
  1. K ^TMP("LEXX",$J) W @IOF
  1. W:$D(LEXFIL) !,"Include terms linked to the following classification systems:",!!
  1. W:'$D(LEXFIL) !,"Display codes belonging to the following classification systems:",!!
  1. N LEXA,LEXC,LEXI,LEXSO,LEXR,LEXS
  1. S LEXS=""
  1. F S LEXS=$O(^LEX(757.03,"B",LEXS)) Q:LEXS="" D
  1. . Q:'$D(^LEX(757.02,"ASRC",$E(LEXS,1,3)))
  1. . S LEXSO=$E(LEXS,1,3) I LEXSO="UND" Q
  1. . S LEXR=$O(^LEX(757.03,"B",LEXS,0))
  1. . S LEXC=$S($D(^TMP("LEXX",$J,LEXSO)):LEXC+1,1:1)
  1. . S ^TMP("LEXX",$J,LEXSO,0)=LEXC
  1. . S ^TMP("LEXX",$J,LEXSO,LEXC)=$P(^LEX(757.03,LEXR,0),U,2,299)
  1. LIST ; Display the list to select from
  1. S (LEXX,LEXA,LEXSO)=""
  1. F S LEXSO=$O(^TMP("LEXX",$J,LEXSO)) Q:LEXSO=""!(LEXA[U) D
  1. . W !,LEXSO F LEXI=1:1:^TMP("LEXX",$J,LEXSO,0) D
  1. . . W ?5,$P(^TMP("LEXX",$J,LEXSO,LEXI),U,2),!
  1. ANS . ; Ask for user selection
  1. . W:'$D(LEXFIL) "Display these codes during look-up"
  1. . W:$D(LEXFIL) "Include terms linked to these codes during look-up"
  1. . S %=2 D YN^DICN S LEXA=%Y I %=2 W ! Q
  1. . I '%,'$D(LEXFIL) W !,"The codes from the selected coding systems may be displayed with the term.",! G ANS
  1. . I '%,$D(LEXFIL) W !,"Searches will display terms linked to the selected coding systems",! G ANS
  1. . I +($G(%))<0 S:%Y["^" LEXA="^" S:%Y["^^" LEXA="^^" W ! Q
  1. . S LEXX=LEXX_"/"_LEXSO W ! Q
  1. I $E(LEXX,1)="/" S LEXX=$E(LEXX,2,$L(LEXX))
  1. S:$D(LEXFIL) LEXX=LEXX_"^" I '$D(LEXFIL) D
  1. . N LEXNAM S LEXNAM=""
  1. . S:$P(LEXX,U,1)'="" LEXNAM=$$NAME^LEXDM3
  1. . S LEXX=LEXX_"^"_$S($L(LEXX):LEXNAM,1:"No display selected")
  1. S:LEXA["^^" LEXX="^^"
  1. K ^TMP("LEXX",$J),%,LEXA,LEXC,LEXI,LEXSO,LEXS,LEXR
  1. Q LEXX