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

TIUPLST.m

Go to the documentation of this file.
  1. TIUPLST ; SLC/JER - Enter/edit personal document pick-list ;13-JUL-2000 10:43:41
  1. ;;1.0;TEXT INTEGRATION UTILITIES;**91,103**;Jun 20, 1997
  1. MAIN ; Control branching
  1. N DA,TIUFPRIV,DUOUT,DTOUT
  1. S TIUFPRIV=1
  1. D INTROTXT
  1. I $S($D(DUOUT):1,$D(DTOUT):1,$D(DIROUT):1,1:0) Q
  1. D GETEDIT
  1. Q
  1. INTROTXT ; Write Introductory Text for the Option
  1. W !
  1. D JUSTIFY^TIUU("--- Personal Document Lists ---","C")
  1. W !!,"This option allows you to create and maintain lists of TITLES for any of the"
  1. W !,"active CLASSES of documents supported by TIU at your site.",!
  1. I '$$READ^TIUU("Y","Explain Details","NO") Q
  1. W !!,"When you use the option to enter a document belonging to a given class"
  1. W !,"you will be asked to select a TITLE belonging to that class."
  1. W !!,"For any particular class, you may find that you only wish to choose from"
  1. W !,"among a few highly specific titles (e.g., if you are a Pulmonologist"
  1. W !,"entering a PROGRESS NOTE, you may wish to choose from a short list of"
  1. W !,"three or four titles related to Pulmonary Function, or Pulmonary Disease)."
  1. W !,"Rather than presenting you with a list of hundreds of unrelated titles,"
  1. W !,"TIU will present you with the list you name here."
  1. W !!,"In the event that you need to select a TITLE which doesn't appear on your"
  1. W !,"list, you will always be able to do so."
  1. W !!,"NOTE: If you expect to enter a single title, or would be unduely restricted"
  1. W !,"by use of a short list, then we recommend that you bypass the creation of"
  1. W !,"a list, and simply enter a DEFAULT TITLE for the class...This option will"
  1. W !,"afford you the opportunity to do so.",!
  1. Q
  1. GETEDIT ; Get record in picklist file, determine action
  1. N D,DIC,TIUNM,X,Y,CREATE,PROMPT
  1. S TIUNM=$P(^VA(200,+$G(DUZ),0),U)
  1. W !," Enter/edit Personal Document List"
  1. I +$O(^TIU(8925.98,"B",DUZ,0))'>0 D Q
  1. . S Y=+$$NEWLIST(TIUNM,1)
  1. . I +Y>0 D EDIT(+Y)
  1. W !!,"You already have one or more Personal Lists...",!
  1. S PROMPT="You may (E)dit, (D)elete, or (C)reate a List: "
  1. S CREATE=$P($$READ^TIUU("SA^E:edit;D:delete;C:create",PROMPT,"EDIT"),U)
  1. I $S(CREATE="":1,$D(DUOUT):1,$D(DTOUT):1,$D(DIROUT):1,1:0) Q
  1. I CREATE="C" S Y=+$$NEWLIST(TIUNM) D:+Y>0 EDIT(+Y) Q
  1. W !!,"Please choose a list to ",$S(CREATE="E":"Edit",1:"Delete"),"...",!
  1. S DIC=8925.98,DIC(0)="ENZ",D="B",X=DUZ
  1. S DIC("S")="I +$G(^TIU(8925.98,+Y,0))=DUZ"
  1. S DIC("W")="W ?21,"" "",$E($$DOCNAME^TIUPLST($P(^TIU(8925.98,+Y,0),U,2)),1,34)"
  1. D IX^DIC
  1. ;TIU*1*91 limit NEWLIST to CREATE=E (If include D & get good Y from NEWLIST, still deletes, never get to edit):
  1. I +Y'>0,CREATE="E" W !!,"No List Selected...",! S Y=+$$NEWLIST(TIUNM,1)
  1. I +Y'>0 W !!,"No changes made..." Q
  1. I CREATE="D" D DELETE(+Y) Q
  1. D EDIT(+Y)
  1. Q
  1. DOCNAME(TIUDA) ; Get the NAME (.01) field of the document
  1. Q $P($G(^TIU(8925.1,+TIUDA,0)),U)
  1. NEWLIST(TIUNM,ASK) ; Create a new List for the user
  1. N ASKNEW,DIC,DLAYGO,Y
  1. S DIC="^TIU(8925.98,",DLAYGO=8925.98,DIC(0)="UNXLZ",ASKNEW=1
  1. I +$G(ASK) S ASKNEW=$$READ^TIUU("Y","Add a new Personal Document List","YES")
  1. I +ASKNEW'>0 S Y=-1 G NEWX
  1. S X=DUZ,D="B"
  1. S X=""""_"`"_X_""""
  1. W !!,"Creating a new Personal Document List...",!
  1. D IX^DIC
  1. ;TIU*1*91 If DIC adds new entry, can get anyone w/ same name:
  1. I Y>0,+Y(0)'=DUZ N DA,DIK D
  1. . W !!," Sorry, you can create lists for YOURSELF only. Please try again."
  1. . I $P(Y,U,3)=1 S DA=+Y,DIK="^TIU(8925.98," D ^DIK S Y=-1
  1. NEWX Q +$G(Y)
  1. ;
  1. DELETE(DA) ; Call ^DIK to delete the list
  1. N YASURE,TIUNAME S YASURE=0
  1. S TIUNAME=$$UP^XLFSTR($$PNAME^TIULC1($P(^TIU(8925.98,+DA,0),U,2)))
  1. I TIUNAME'="UNKNOWN" D
  1. . W !!,"You are about to DELETE your entry for CLASS "
  1. . W TIUNAME,!
  1. . S YASURE=$$READ^TIUU("Y","Are you SURE","NO")
  1. I TIUNAME="UNKNOWN" D
  1. . W !!,"You must specify a CLASS in order to maintain the list.",!
  1. . S YASURE=1
  1. I +YASURE'>0 W !!,"Nothing deleted...No harm done!" Q
  1. D DIK(DA,TIUNAME)
  1. Q
  1. DIK(DA,TIUNAME) ; Remove a list
  1. N DIK
  1. S DIK="^TIU(8925.98,"
  1. D ^DIK
  1. I $G(TIUNAME)]"" W !,TIUNAME," List DELETED."
  1. Q
  1. EDIT(DA) ; Call ^DIE to edit the record
  1. N DIE,DIRUT,DIROUT,DTOUT,DR,X,Y,TIUCLASS,TIUASK
  1. S DIE=8925.98
  1. S DR="[TIU ENTER/EDIT PERSONAL LIST]"
  1. D ^DIE Q:$D(Y)!$D(DTOUT)
  1. I $G(TIUCLASS)="" D DIK(DA,"")
  1. Q
  1. ALREADY(TIUCLASS) ; Indicate that a List for TIUCLASS already exists
  1. W !!,$C(7),"You already have a list for class ",$$PNAME^TIULC1(TIUCLASS),"."
  1. W !!,"Please Edit that list instead..."
  1. Q