source: WorldVistAEHR/trunk/r/LEXICON_UTILITY-LEX-GMPT/LEXDCCC.m@ 1361

Last change on this file since 1361 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 2.5 KB
RevLine 
[613]1LEXDCCC ; ISL Default Display - Create ; 09-23-96
2 ;;2.0;LEXICON UTILITY;;Sep 23, 1996;Build 1
3 ;
4 ; Entry: S X=$$EN^LEXDCCC
5 ;
6 ; Function returns a two piece string
7 ;
8 ; $P 1 String of classifications coding
9 ; system mnemonics, i.e., "ICD/CPT",
10 ; and a legitimate value for LEXSHOW.
11 ; This will be null if input is "^"
12 ;
13 ; $P 2 Name of display string selected i.e.,
14 ; "ICD/CPT only" This will be null only
15 ; when user input is "^^"
16 ;
17 ; LEXA Answer to prompt (Yes 1 No 0)
18 ; LEXC Counter
19 ; LEXI Incremental Counter
20 ; LEXS Source, i.e., ICD94, NAN90, CPT89
21 ; LEXSO Source abbreviation, i.e., ICD, CPT, DSM
22 ; LEXR Internal Entry (Record) Number in #757.31
23 ;
24 ; LEXFIL Flag, indicates that the
25 ; classification codes selected are
26 ; for building a filter - DIC("S")
27 ;
28T S X=$$EN W !!,X Q
29EN(LEXX) ; Entry point S X=$$EN^LEXDCCC
30BUILD ; Build the list to select from
31 K ^TMP("LEXX",$J) W @IOF
32 W:$D(LEXFIL) !,"Include terms linked to the following classification systems:",!!
33 W:'$D(LEXFIL) !,"Display codes belonging to the following classification systems:",!!
34 N LEXA,LEXC,LEXI,LEXSO,LEXR,LEXS
35 S LEXS=""
36 F S LEXS=$O(^LEX(757.03,"B",LEXS)) Q:LEXS="" D
37 . Q:'$D(^LEX(757.02,"ASRC",$E(LEXS,1,3)))
38 . S LEXSO=$E(LEXS,1,3) I LEXSO="UND" Q
39 . S LEXR=$O(^LEX(757.03,"B",LEXS,0))
40 . S LEXC=$S($D(^TMP("LEXX",$J,LEXSO)):LEXC+1,1:1)
41 . S ^TMP("LEXX",$J,LEXSO,0)=LEXC
42 . S ^TMP("LEXX",$J,LEXSO,LEXC)=$P(^LEX(757.03,LEXR,0),U,2,299)
43LIST ; Display the list to select from
44 S (LEXX,LEXA,LEXSO)=""
45 F S LEXSO=$O(^TMP("LEXX",$J,LEXSO)) Q:LEXSO=""!(LEXA[U) D
46 . W !,LEXSO F LEXI=1:1:^TMP("LEXX",$J,LEXSO,0) D
47 . . W ?5,$P(^TMP("LEXX",$J,LEXSO,LEXI),U,2),!
48ANS . ; Ask for user selection
49 . W:'$D(LEXFIL) "Display these codes during look-up"
50 . W:$D(LEXFIL) "Include terms linked to these codes during look-up"
51 . S %=2 D YN^DICN S LEXA=%Y I %=2 W ! Q
52 . I '%,'$D(LEXFIL) W !,"The codes from the selected coding systems may be displayed with the term.",! G ANS
53 . I '%,$D(LEXFIL) W !,"Searches will display terms linked to the selected coding systems",! G ANS
54 . I +($G(%))<0 S:%Y["^" LEXA="^" S:%Y["^^" LEXA="^^" W ! Q
55 . S LEXX=LEXX_"/"_LEXSO W ! Q
56 I $E(LEXX,1)="/" S LEXX=$E(LEXX,2,$L(LEXX))
57 S:$D(LEXFIL) LEXX=LEXX_"^" I '$D(LEXFIL) D
58 . N LEXNAM S LEXNAM=""
59 . S:$P(LEXX,U,1)'="" LEXNAM=$$NAME^LEXDM3
60 . S LEXX=LEXX_"^"_$S($L(LEXX):LEXNAM,1:"No display selected")
61 S:LEXA["^^" LEXX="^^"
62 K ^TMP("LEXX",$J),%,LEXA,LEXC,LEXI,LEXSO,LEXS,LEXR
63 Q LEXX
Note: See TracBrowser for help on using the repository browser.