source: WorldVistAEHR/trunk/r/LEXICON_UTILITY-LEX-GMPT/LEXSC2.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.2 KB
RevLine 
[613]1LEXSC2 ; ISL Shortcuts Add/Delete ; 05/25/1998
2 ;;2.0;LEXICON UTILITY;**11**;Sep 23, 1996;Build 1
3 ;
4WRT(LEXSTR) ;
5 W ! N LEXI,LEXLEN S LEXLEN=70 F D Q:$L(LEXSTR)<LEXLEN
6 . F LEXI=(LEXLEN+1):-1:0 Q:$E(LEXSTR,LEXI)=" "!(LEXI=0)
7 . I LEXI>0 W !,?2,$E(LEXSTR,1,(LEXI-1)) S LEXSTR=$E(LEXSTR,(LEXI+1),$L(LEXSTR)) Q
8 . I LEXI=0 W:$L(LEXSTR) !,?2,LEXSTR S LEXSTR=""
9 I $L(LEXSTR) W !,?2,LEXSTR
10 W !
11 Q
12DELOK(X) ; Ok to delete?
13 N DIR,Y,DTOUT,DUOUT,DIRUT,DIROUT
14 S DIR("A")="Delete current shortcut: ",DIR("B")="NO",DIR(0)="YAO" D ^DIR
15 S:X[U LEXRP=U S:X["^^" LEXRP="^^" W ! S X=$S(+($G(Y))=1:1,1:0) Q X
16 Q
17ADDOK(X) ; Ok to add?
18 N DIR,Y,DTOUT,DUOUT,DIRUT,DIROUT
19 S DIR("A")="Add shortcut: ",DIR("B")="NO",DIR(0)="YAO" D ^DIR
20 S:X[U LEXRP=U S:X["^^" LEXRP="^^" W ! S X=$S(+($G(Y))=1:1,1:0) Q X
21SC(X) ; Get shortcut
22 S DIR("A")="Enter shortcut keyword(s): "
23 S DIR("?")="Enter one or more words (up to 63 characters) to use as a shortcut for a term"
24 S DIR("??")="^D SCHLP^LEXSC2" N Y S DIR(0)="FAO^2:63" D ^DIR
25 S:X="" LEXRP=U S:X[U LEXRP=U S:X["^^" LEXRP="^^" F Q:$E(X,1)'=" " S X=$E(X,2,$L(X))
26 W:$D(DTOUT) !,"Try later.",! S:$D(DTOUT) X="",LEXRP=U
27 S:X[U DUOUT=1 K DIR,DIRUT,DIROUT
28 Q X
29SCHLP ; Look-up help
30 W !!,"Enter one or more words (up to 63 characters) to use as a shortcut to quickly"
31 W !,"locate a single term without conducting a word search. This shortcut should"
32 W !,"be unique to the term as used in the context """,LEXCXN,""""
33 Q
34TERM(X) ; Get expression
35 N DIR,Y S DIR("A")="Select a term for the shortcut: "
36 S DIR("?")=" "_$$SQ^LEXHLP ; PCH 11
37 S DIR("??")="^D TERMHLP^LEXSC2" N Y S DIR(0)="FAO^2:245" D ^DIR
38 S DIC="^LEX(757.01," S:X[U LEXRP=U S:X["^^" LEXRP="^^" Q:LEXRP[U "^"
39 I X=" ",+($G(^DISV(DUZ,DIC)))>0 S X=@(DIC_+($G(^DISV(DUZ,DIC)))_",0)") W " ",X
40 F Q:$E(X,1)'=" " S X=$E(X,2,$L(X))
41 W:$D(DTOUT) !,"Try later.",! S:$D(DTOUT) X=""
42 S:X[U DUOUT=1 K DIR,DIRUT,DIROUT Q X
43TERMHLP ; Look-up help PCH 11
44 N X S X="" S:$L($G(DIR("?"))) X=$G(DIR("?")) S:'$L(X) X=" "_$$SQ^LEXHLP
45 W:$L(X) !!,X,!
46 W !," Best results occur using one to three full or partial words without"
47 W !," a suffix (i.e., ""DIABETES"",""DIAB MELL"",""DIAB MELL INSUL"") or"
48 W !," a classification code (ICD, CPT, HCPCS, etc)"
49 Q
Note: See TracBrowser for help on using the repository browser.