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

LEXSC2.m

Go to the documentation of this file.
  1. LEXSC2 ;ISL/KER - Shortcuts Add/Delete ;04/21/2014
  1. ;;2.0;LEXICON UTILITY;**11,80**;Sep 23, 1996;Build 1
  1. ;
  1. ; Global Variables
  1. ; ^DISV( ICR 510
  1. ;
  1. ; External References
  1. ; ^DIR ICR 10026
  1. ;
  1. WRT(LEXSTR) ;
  1. W ! N LEXI,LEXLEN S LEXLEN=70 F D Q:$L(LEXSTR)<LEXLEN
  1. . F LEXI=(LEXLEN+1):-1:0 Q:$E(LEXSTR,LEXI)=" "!(LEXI=0)
  1. . I LEXI>0 W !,?2,$E(LEXSTR,1,(LEXI-1)) S LEXSTR=$E(LEXSTR,(LEXI+1),$L(LEXSTR)) Q
  1. . I LEXI=0 W:$L(LEXSTR) !,?2,LEXSTR S LEXSTR=""
  1. I $L(LEXSTR) W !,?2,LEXSTR
  1. W !
  1. Q
  1. DELOK(X) ; Ok to delete?
  1. N DIR,Y,DTOUT,DUOUT,DIRUT,DIROUT
  1. S DIR("A")="Delete current shortcut: ",DIR("B")="NO",DIR(0)="YAO" D ^DIR
  1. S:X[U LEXRP=U S:X["^^" LEXRP="^^" W ! S X=$S(+($G(Y))=1:1,1:0) Q X
  1. Q
  1. ADDOK(X) ; Ok to add?
  1. N DIR,Y,DTOUT,DUOUT,DIRUT,DIROUT
  1. S DIR("A")="Add shortcut: ",DIR("B")="NO",DIR(0)="YAO" D ^DIR
  1. S:X[U LEXRP=U S:X["^^" LEXRP="^^" W ! S X=$S(+($G(Y))=1:1,1:0) Q X
  1. SC(X) ; Get shortcut
  1. S DIR("A")="Enter shortcut keyword(s): "
  1. S DIR("?")="Enter one or more words (up to 63 characters) to use as a shortcut for a term"
  1. S DIR("??")="^D SCHLP^LEXSC2" N Y S DIR(0)="FAO^2:63" D ^DIR
  1. S:X="" LEXRP=U S:X[U LEXRP=U S:X["^^" LEXRP="^^" F Q:$E(X,1)'=" " S X=$E(X,2,$L(X))
  1. W:$D(DTOUT) !,"Try later.",! S:$D(DTOUT) X="",LEXRP=U
  1. S:X[U DUOUT=1 K DIR,DIRUT,DIROUT
  1. Q X
  1. SCHLP ; Look-up help
  1. W !!,"Enter one or more words (up to 63 characters) to use as a shortcut to quickly"
  1. W !,"locate a single term without conducting a word search. This shortcut should"
  1. W !,"be unique to the term as used in the context """,LEXCXN,""""
  1. Q
  1. TERM(X) ; Get expression
  1. N DIR,Y S DIR("A")="Select a term for the shortcut: "
  1. S DIR("?")=" "_$$SQ^LEXHLP ; PCH 11
  1. S DIR("??")="^D TERMHLP^LEXSC2" N Y S DIR(0)="FAO^2:245" D ^DIR
  1. S DIC="^LEX(757.01," S:X[U LEXRP=U S:X["^^" LEXRP="^^" Q:LEXRP[U "^"
  1. I X=" ",+($G(^DISV(DUZ,DIC)))>0 S X=@(DIC_+($G(^DISV(DUZ,DIC)))_",0)") W " ",X
  1. F Q:$E(X,1)'=" " S X=$E(X,2,$L(X))
  1. W:$D(DTOUT) !,"Try later.",! S:$D(DTOUT) X=""
  1. S:X[U DUOUT=1 K DIR,DIRUT,DIROUT Q X
  1. TERMHLP ; Look-up help PCH 11
  1. N X S X="" S:$L($G(DIR("?"))) X=$G(DIR("?")) S:'$L(X) X=" "_$$SQ^LEXHLP
  1. W:$L(X) !!,X,!
  1. W !," Best results occur using one to three full or partial words without"
  1. W !," a suffix (i.e., ""DIABETES"",""DIAB MELL"",""DIAB MELL INSUL"") or"
  1. W !," a classification code (ICD, CPT, HCPCS, etc)"
  1. Q