| 1 | LEXDMGU ; ISL Defaults - Manager/User Group        ; 09-23-96
 | 
|---|
| 2 |  ;;2.0;LEXICON UTILITY;;Sep 23, 1996;Build 1
 | 
|---|
| 3 |  ;
 | 
|---|
| 4 |  ; LEXDICS(0)  Filter name
 | 
|---|
| 5 |  ; LEXSHOW(0)  Display name
 | 
|---|
| 6 |  ; LEXSUB(0)   Vocabulary name
 | 
|---|
| 7 |  ; LEXCTX(0)   Shortcut Context name
 | 
|---|
| 8 |  ;
 | 
|---|
| 9 |  ; LEXC        Counter
 | 
|---|
| 10 |  ; LEXI        Incremental counter
 | 
|---|
| 11 |  ; LEXL        Location
 | 
|---|
| 12 |  ; LEXS        Service
 | 
|---|
| 13 |  ; LEXMORE     Flag - Select more users (Y/N)
 | 
|---|
| 14 |  ; LEXOVER     Flag - Overwrite user defaults (Y/N)
 | 
|---|
| 15 |  ; LEXSEL      User input/selection
 | 
|---|
| 16 |  ; LEXUSR      Flag - User has been selected
 | 
|---|
| 17 |  ; LEXVER      Flag - Default values are verified (Y/N)
 | 
|---|
| 18 |  ; LEXX        Return value
 | 
|---|
| 19 |  ;
 | 
|---|
| 20 |  ; LEXLIM      Limits (parameter for LEXMETH)
 | 
|---|
| 21 |  ; LEXMETH     Method, singel user, by service, by location,
 | 
|---|
| 22 |  ;              by both service and location, or all users
 | 
|---|
| 23 |  ;
 | 
|---|
| 24 | USER(LEXX) ; User or user group by name or by type
 | 
|---|
| 25 |  N LEXUSR,LEXMETH,LEXLIM,LEXMORE,LEXOVER,LEXVER
 | 
|---|
| 26 | GRP ; Get user/user group
 | 
|---|
| 27 |  K DIC,DIR S LEXX=""
 | 
|---|
| 28 |  W ! D DM S (LEXX,LEXUSR)=$$USR I LEXX[U G EXIT
 | 
|---|
| 29 | GETUSER ; Get user or user group type (Service/Location)
 | 
|---|
| 30 |  S (LEXMETH,LEXLIM)=""
 | 
|---|
| 31 |  I +LEXX=1 W ! S LEXLIM=$$USER^LEXDM4,LEXMETH="ONE"
 | 
|---|
| 32 |  I +LEXX=2 W ! S LEXLIM=$$SERV^LEXDM4,LEXMETH="SEV"
 | 
|---|
| 33 |  I +LEXX=3 W ! S LEXLIM=$$LOC^LEXDM4,LEXMETH="LOC"
 | 
|---|
| 34 |  I +LEXX=4 D
 | 
|---|
| 35 |  . N LEXS,LEXL W ! S LEXS=$$SERV^LEXDM4
 | 
|---|
| 36 |  . I LEXS=U!(LEXS="^^")!(+LEXS'>0) S LEXLIM=LEXS Q
 | 
|---|
| 37 |  . W ! S LEXL=$$LOC^LEXDM4
 | 
|---|
| 38 |  . I LEXL=U!(LEXL="^^")!(+LEXL'>0) S LEXLIM=LEXL Q
 | 
|---|
| 39 |  . S LEXLIM=LEXS_";"_LEXL,LEXMETH="SAL"
 | 
|---|
| 40 |  I +LEXX=5 S LEXLIM=1,LEXMETH="ALL"
 | 
|---|
| 41 |  D LIMIT,METHOD
 | 
|---|
| 42 |  Q:+($G(LEXLIM))'>0 LEXLIM
 | 
|---|
| 43 |  ; Check defaults - DEFCK^LEXDMGV
 | 
|---|
| 44 |  D DEFCK^LEXDMGV
 | 
|---|
| 45 |  ; Check user - USERCK^LEXDMGV
 | 
|---|
| 46 |  D USERCK^LEXDMGV
 | 
|---|
| 47 |  ; Ask to overwrite defaults - $$OVER^LEXDMGO
 | 
|---|
| 48 |  S LEXOVER=$$OVER^LEXDMGO
 | 
|---|
| 49 |  Q:LEXOVER["^^" "^^"
 | 
|---|
| 50 |  ; Verify before setting global - $$VER^LEXDMGV
 | 
|---|
| 51 |  S LEXVER=$$VER^LEXDMGV
 | 
|---|
| 52 |  S:LEXVER[U LEXS=U S:LEXVER["^^" LEXX="^^" Q:LEXX[U LEXX
 | 
|---|
| 53 |  D:+($G(LEXVER))>0 UPDATE^LEXDMGT
 | 
|---|
| 54 |  ; More users
 | 
|---|
| 55 |  S LEXMORE=0 I +($G(LEXUSR))>0,+($G(LEXUSR))<5 S LEXMORE=1
 | 
|---|
| 56 |  I +($G(LEXMORE))>0,LEXX'["^^" D  G:+($G(LEXMORE))>0 GRP
 | 
|---|
| 57 |  . S LEXMORE=$$MOREUSR
 | 
|---|
| 58 |  Q LEXX
 | 
|---|
| 59 | LIMIT ; Check search limits
 | 
|---|
| 60 |  Q:+($G(LEXLIM))>0  S:LEXLIM["^^" LEXLIM="^^" Q:LEXLIM[U
 | 
|---|
| 61 |  S LEXLIM=U Q
 | 
|---|
| 62 | METHOD ; Check search method
 | 
|---|
| 63 |  Q:+($G(LEXLIM))>0  S:LEXLIM[U!($G(LEXLIM)="") LEXMETH="" Q
 | 
|---|
| 64 | EXIT ; Quit USER selection
 | 
|---|
| 65 |  Q LEXX
 | 
|---|
| 66 | MOREUSR(LEXX) ; Want to set the current defaults for more users?
 | 
|---|
| 67 |  N DIR,DTOUT,DUOUT,DIRUT,DIROUT,X,Y
 | 
|---|
| 68 |  S DIR("A",1)="Do you wish to set the currently selected user"
 | 
|---|
| 69 |  S DIR("A")="defaults to another user or group of users?  "
 | 
|---|
| 70 |  S DIR("B")="No",(DIR("?"),DIR("??"))="^D MOREHLP^LEXDMGU"
 | 
|---|
| 71 |  S DIR(0)="YAO" D ^DIR K DIR S LEXX=+Y Q:$D(DTOUT) "^" S:X[U LEXX=U
 | 
|---|
| 72 |  S:X["^^" LEXX="^^" Q:LEXX[U LEXX S LEXX=+Y Q LEXX
 | 
|---|
| 73 | MOREHLP ; More user help
 | 
|---|
| 74 |  D CD W !,"The defaults you selected may be applied to another user/user group",!
 | 
|---|
| 75 |  Q
 | 
|---|
| 76 | USR(LEXX) ; Get response for USER
 | 
|---|
| 77 |  W ! N Y,DTOUT,DUOUT,DIRUT,DIROUT S DIR("A")="Select 1-5:  "
 | 
|---|
| 78 |  S DIR("B")=1,(DIR("?"),DIR("??"))="^D USRHLP^LEXDMGU"
 | 
|---|
| 79 |  S DIR(0)="NAO^1:5:0" D ^DIR K DIR S LEXX=+Y
 | 
|---|
| 80 |  Q:$D(DTOUT) "^^" S:X[U LEXX=U S:X["^^" LEXX="^^" Q:LEXX[U LEXX
 | 
|---|
| 81 |  S:+Y>0&(+Y<6) LEXX=+Y Q LEXX
 | 
|---|
| 82 |  Q
 | 
|---|
| 83 | USRHLP ; Help for respons to USER
 | 
|---|
| 84 |  I X'["?",+X<1!(+X>5) D  Q
 | 
|---|
| 85 |  . W !!,"Press <Return> to continue, "
 | 
|---|
| 86 |  . W """^"" to exit or select (1-5)" D DM
 | 
|---|
| 87 |  I '$L(($G(LEXDICS(0))_$G(LEXSHOW(0))_$G(LEXSUB(0))_$G(LEXCTX(0)))) D  Q
 | 
|---|
| 88 |  . W !!,"Press <Return> to continue, "
 | 
|---|
| 89 |  . W """^"" to exit or select (1-5)" D DM
 | 
|---|
| 90 |  D CD W !,"The default selections listed above may be applied to either"
 | 
|---|
| 91 |  W !,"a single user, a user group based on service/location, or all"
 | 
|---|
| 92 |  W !,"users.  You may either select a user/user group (1-5), or "
 | 
|---|
| 93 |  W !,"press <Return> to continue, or ""^"" to exit." D DM
 | 
|---|
| 94 |  Q
 | 
|---|
| 95 | CD ; Current defaults
 | 
|---|
| 96 |  W !!,"Current default selections:",!
 | 
|---|
| 97 |  W !,"    Filter     - "
 | 
|---|
| 98 |  W $S($L($G(LEXDICS(0))):$G(LEXDICS(0)),1:"Not selected")
 | 
|---|
| 99 |  W !,"    Display    - "
 | 
|---|
| 100 |  W $S($L($G(LEXSHOW(0))):$G(LEXSHOW(0)),1:"Not selected")
 | 
|---|
| 101 |  W !,"    Vocabulary - "
 | 
|---|
| 102 |  W $S($L($G(LEXSUB(0))):$G(LEXSUB(0)),1:"Not selected")
 | 
|---|
| 103 |  W !,"    Shortcuts  - "
 | 
|---|
| 104 |  W $S($L($G(LEXCTX(0))):$G(LEXCTX(0)),1:"Not selected") W !
 | 
|---|
| 105 |  Q
 | 
|---|
| 106 | DM ; Display menu
 | 
|---|
| 107 |  W !!,"User/User groups:",!
 | 
|---|
| 108 |  N LEXC F LEXC=1:1:999 Q:$P($T(UM+LEXC^LEXDMGU),";",2)=""  D
 | 
|---|
| 109 |  . W !,"   ",$J($P($T(UM+LEXC^LEXDMGU),";",2),2),"  "
 | 
|---|
| 110 |  . W $P($T(UM+LEXC^LEXDMGU),";",3)
 | 
|---|
| 111 |  Q
 | 
|---|
| 112 | UM ;; User/user group menu data
 | 
|---|
| 113 |  ;1;Single User
 | 
|---|
| 114 |  ;2;Group based on Service
 | 
|---|
| 115 |  ;3;Group based on Hospital Location
 | 
|---|
| 116 |  ;4;Group based on both Service and Hospital Location
 | 
|---|
| 117 |  ;5;All Users
 | 
|---|
| 118 |  ;;
 | 
|---|