source: WorldVistAEHR/trunk/r/LEXICON_UTILITY-LEX-GMPT/LEXDCCS.m@ 861

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

initial load of WorldVistAEHR

File size: 3.3 KB
RevLine 
[613]1LEXDCCS ; ISL Default Display - Select ; 09-23-96
2 ;;2.0;LEXICON UTILITY;;Sep 23, 1996;Build 1
3 ;
4 ; Special Look-up in file 757.31 Display formats
5 ; Entry: S X=$$EN^LEXDCCS
6 ;
7 ; Function returns a two piece string
8 ;
9 ; $P 1 String of classifications coding
10 ; system mnemonics, i.e., "ICD/CPT",
11 ; and a legitimate value for LEXSHOW.
12 ; This will be null if input is "^"
13 ;
14 ; $P 2 Name of display string selected i.e.,
15 ; "ICD/CPT only" This will be null only
16 ; when user input is "^^"
17 ;
18 ; LEX Array containing pointers to 757.31
19 ; LEXA Users answer to selection
20 ; LEXC Counter
21 ; LEXD Display
22 ; LEXF Re-display starting from #LEXF
23 ; LEXI Incremental Counter
24 ; LEXL Last entry displayed
25 ; LEXLN Line counter
26 ; LEXR Internal Entry Number (Record) in #757.31
27 ; LEXS Selection
28 ; LEXT Re-display up through #LEXT
29 ;
30EN(LEXX) ; Select a predefined display string
31 N X,Y,LEX,LEXC,LEXL,LEXR,LEXA,LEXD D TOT
32 S LEXD="",(LEXA,LEXX,LEXC,LEXR)=0
33 F S LEXD=$O(^LEX(757.31,"B",LEXD)) Q:LEXD=""!(LEXA["^")!(+LEXX>0) D
34 . S LEXR=0
35 . F S LEXR=$O(^LEX(757.31,"B",LEXD,LEXR)) Q:+LEXR=0!(LEXA["^")!(+LEXX>0) D
36 . . S LEXC=LEXC+1,LEXL=LEXC
37 . . S LEX(LEXC)=LEXR,LEX(0)=LEXC
38 . . D W(LEXC,LEXR)
39 . . I LEXC#5=0,+LEXX=0 S LEXA=$$SEL S:+LEXA>0&(+LEXA<(LEXC+1)) LEXX=+LEXA
40 I +LEXX=0,LEXA'["^",LEXC#5'=0 S LEXA=$$SEL S:+LEXA>0&(+LEXA<(LEXC+1)) LEXX=+LEXA
41 S LEXX=+LEXX S:LEXX'=0&($D(LEX(LEXX))) LEXX=LEX(LEXX) K LEX
42 I +LEXX>0 S LEXX=$G(^LEX(757.31,+LEXX,1))_"^"_$P($G(^LEX(757.31,+LEXX,0)),"^",1) Q LEXX
43 S:LEXA'["^^" LEXX="^No display selected" S:LEXA["^^" LEXX="^^"
44 Q LEXX
45SEL(LEXS) ; Select from the array
46 S LEXS="" W ! N X,Y,DIRUT,DTOUT,DUOUT,DIROUT,DIR
47 S DIR(0)="NAO^1:"_LEXC
48 S DIR("A")="Select 1-"_LEXC_": ",(DIR("?"),DIR("??"))="^D SH^LEXDCCS"
49 D ^DIR W:$G(X)="" ! S LEXS=$S(X["^"&(X'["^^"):"^",X["^^":"^^",X'["^"&(+Y=0):"",1:+Y) Q LEXS
50SH ; Show help
51 I X'["?" D STD Q
52 N LEXR S LEXR=+($E(X,2,$L(X))) I $E(X,1)="?",LEXR>0,LEXR<(LEX(0)+1) D
53 . S LEXR=LEX(LEXR) D:'$D(^LEX(757.31,LEXR,2,1)) NODES,STD Q:'$D(^LEX(757.31,LEXR,2,1)) D DES
54 D:$E(X,1)="?"&(LEXR<1!(LEXR>LEX(0))) STD D:$E(X,1)'="?" STD D RD
55 Q
56STD ; Standard Help
57 W !!,"Enter 1-",LEXC," to select a Shortcut Context, or ""?"" for help, or ""?#"" for descriptive"
58 W !,"help on an entry flagged with an ""*"", or ""^"" to exit or <Return> for more."
59 Q
60DES ; Description Help
61 N LEXLN,LEXI S (LEXLN,LEXI)=0 W !!,?2,$P(^LEX(757.31,LEXR,0),"^",1),!
62 F S LEXI=$O(^LEX(757.31,LEXR,2,LEXI)) Q:+LEXI=0 D
63 . W !,?4,^LEX(757.31,LEXR,2,LEXI,0) S LEXLN=LEXLN+1
64 D:LEXLN>4 EOP W ! Q
65NODES ; No Description Help Available
66 W !!,?2,$P(^LEX(757.31,LEXR,0),"^",1)," does not have a description",! Q
67RD ; Re-Display List
68 N LEXF,LEXT S LEXT=+($G(LEXL)),LEXF=(+(LEXT#5)-1)
69 S:LEXF<0 LEXF=4 S LEXF=LEXT-LEXF S LEXF=LEXF-1
70 F S LEXF=$O(LEX(LEXF)) Q:+LEXF=0!(LEXF'<(LEXT+1)) D
71 . W:LEXF=1 ! D W(LEXF,LEX(LEXF))
72 Q
73W(LEXC,LEXR) ; Write entry
74 W !,$J(LEXC,4),". ",$P(^LEX(757.31,LEXR,0),"^",1)
75 W $S($D(^LEX(757.31,LEXR,2,1)):" *",1:"") Q
76TOT ; Total displays
77 N LEXD,LEXR,LEXC S LEXD="",LEXC=0
78 F S LEXD=$O(^LEX(757.31,"B",LEXD)) Q:LEXD="" S LEXR=0 D
79 . F S LEXR=$O(^LEX(757.31,"B",LEXD,LEXR)) Q:+LEXR=0 S LEXC=LEXC+1
80 W !!,LEXC," Displays found",!
81 Q
82EOP ; End of Page
83 W ! N X,Y,DIR,DTOUT,DUOUT,DIRUT,DIROUT S DIR(0)="E" D ^DIR S:X[U LEXA="^" W ! Q
Note: See TracBrowser for help on using the repository browser.