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

ORXTABS.m

Go to the documentation of this file.
  1. ORXTABS ; SLC/PKS - Edit tab parameters preferences. [10/17/00 2:44pm]
  1. ;;3.0;ORDER ENTRY/RESULTS REPORTING;**9,47,84**;Dec 17, 1997
  1. ;
  1. ; Main control routine is herein for Tab Preferences Editing.
  1. ; Works with routines ORXTABS1 and ORXTABS2. ORXTABS1 contains
  1. ; additional control tags that work in conjunction with the
  1. ; control code at the top of this routine, in order to keep this
  1. ; one below 10K size maximum. ORXTABS2 contains tags to handle
  1. ; individual preference edit/input, making calls to ORXTABS3,
  1. ; ORXTABS4, etc., where code for individual dialogues reside.
  1. ;
  1. Q
  1. ;
  1. EN ; Entry point - called by option [ORX PARAM TAB PREF].
  1. ;
  1. ; Variables used:
  1. ;
  1. ; DIR,X,Y = FM user input variables.
  1. ; ORXANY = Flag for number of changes.
  1. ; ORXCDIS = Display holder for counter display.
  1. ; ORXCHC = User's choice of parameter value to edit.
  1. ; ORXCNT = Loop counter; re-used in various tags.
  1. ; ORXCUR = Existing settings for a parameter.
  1. ; ORXERR = Error array used in call to XPAR.
  1. ; ORXNEW = New value entered by user.
  1. ; ORXNOW = Cuttent setting of a parameter piece value.
  1. ; ORXNUM = Array count holder.
  1. ; ORXPAR = Working variable for parameter definitions, etc.
  1. ; ORXPARS = Becomes array of parameters from TABS tag.
  1. ; ORXPCS = Array of formal parameter string's piece settings.
  1. ; ORXPDIR = Display prompt piece (first piece).
  1. ; ORXPDIS = Holder for prompt piece of each value.
  1. ; ORXPNAM = Stores name of current parameter definition.
  1. ; ORXPRO = Current prompt.
  1. ; ORXPSTR = String of prompts.
  1. ; ORXSETS = Setting(s) pieces for a parameter.
  1. ; ORXSTOP = Flag to stop editing.
  1. ; ORXTAB = Becomes current tab, as exists in last part of formal
  1. ; parameter definition string.
  1. ; ORXTAG = Current data tag.
  1. ; ORXTCNT = Current tab line counter.
  1. ; ORXTNM = First piece of current tab from text entry.
  1. ; ORXVAL = Value holder.
  1. ;
  1. N DIR,X,Y,ORXANY,ORXCDIS,ORXCHC,ORXCNT,ORXCUR,ORXERR,ORXNEW,ORXNOW,ORXNUM,ORXPAR,ORXPARS,ORXPCS,ORXPDIR,ORXPDIS,ORXPNAM,ORXPRO,ORXPSTR,ORXSETS,ORXSTOP,ORXTAB,ORXTAG,ORXTCNT,ORXTNM,ORXVAL
  1. ;
  1. S ORXSTOP=0 ; Preset flag before starting.
  1. ;
  1. ; Establish control loop for entire editing process.
  1. F Q:ORXSTOP D
  1. .D BLDLIST Q:ORXSTOP ; ORXSTOP here = list problem.
  1. .D CHOOSE Q:ORXSTOP ; ORXSTOP here = user punted.
  1. .D PARAMS(ORXTAB) ; ORXTAB set by CHOOSE tag.
  1. .D EDIT^ORXTABS1 ; User editing.
  1. .;
  1. .; ORXANY will be set by EACH, SOME, or ALL calls in ORXTABS1:
  1. .I ORXANY D SAVE^ORXTABS1 ; If changes made, save?
  1. .S ORXSTOP=0 ; Assure loop restart.
  1. ;
  1. Q
  1. ;
  1. BLDLIST ; Get list of tabs with editable parameters for display.
  1. ;
  1. K ORXPARS ; Clean out array each time.
  1. S ORXTAG="TABS" ; Data tag herein.
  1. S ORXCNT=0 ; Initialize counter.
  1. F D Q:ORXPARS(ORXCNT)="" ; Get each tag's entry.
  1. .S ORXCNT=ORXCNT+1 ; Increment counter.
  1. .S ORXPARS(ORXCNT)=$P($T(@ORXTAG+ORXCNT),";;",2)
  1. ;
  1. ; Check for no parameters listed or problem with reading data:
  1. I ORXCNT<2 S ORXSTOP=1
  1. ;
  1. Q
  1. ;
  1. CHOOSE ; Display tabs, allow user to choose.
  1. ;
  1. ; Clear, reset DIR variables:
  1. K DIR,X,Y
  1. S DIR("A")=" Select tab for preferences editing"
  1. S DIR("?")=" Select by entry of item number:"
  1. ;
  1. ; Assign array [DIR("A")] items for display:
  1. S ORXCNT=0
  1. S ORXVAL=""
  1. F D Q:ORXVAL=""
  1. .S ORXCNT=ORXCNT+1 ; Increment counter.
  1. .S ORXVAL=$P($G(ORXPARS(ORXCNT)),U) ; Get first piece of string.
  1. .;
  1. .; Assign the actual display line:
  1. .S ORXCDIS=ORXCNT
  1. .S ORXCDIS=$$RJ^XLFSTR(ORXCDIS,2) ; Right justify to 2 places.
  1. .S:(ORXVAL'="") DIR("A",ORXCNT)=" "_ORXCDIS_" "_ORXVAL
  1. ;
  1. ; Check for errors:
  1. I ORXCNT<2 W !!," Problem reading TABS data!" S ORXSTOP=1 Q
  1. ;
  1. ; Define DIR input requirements:
  1. S DIR(0)="NO^1:"_(ORXCNT-1)_":0"
  1. ;
  1. ; Call DIR for user choice:
  1. W !! ; Spacing for screen display.
  1. D ^DIR
  1. ;
  1. ; Check user response:
  1. I '$L($G(Y)) S ORXSTOP=1 Q ; Punt if Y not assigned.
  1. I Y="" S ORXSTOP=1 Q ; Punt if Y is null.
  1. I Y="^" S ORXSTOP=1 Q ; Punt if Y is "^" character.
  1. I Y<1 S ORXSTOP=1 Q ; Punt if Y is less than one.
  1. I Y>(ORXCNT-1) S ORXSTOP=1 Q ; Punt if Y isn't within range.
  1. S (ORXTCNT,ORXTAB)=Y ; Otherwise, get entry and go.
  1. ;
  1. Q
  1. ;
  1. PARAMS(ORXPAR) ; Retrieve selected tab's current parameter values.
  1. ;
  1. S ORXTAB=$P(ORXPARS(ORXPAR),U) ; Tab name from user display.
  1. S ORXTNM=ORXTAB ; Comparison value holder.
  1. S ORXSETS=$P(ORXPARS(ORXPAR),U,2) ; Settings info.
  1. S ORXTAB=$$EXCX ; Display name differences.
  1. S ORXPAR="ORCH CONTEXT "_ORXTAB ; Construct formal param name.
  1. S ORXPNAM=ORXPAR ; Store for saving changes.
  1. ;
  1. ; Get current parameter values from Parameters file:
  1. S ORXCUR=""
  1. S ORXCUR=$$GET^XPAR("ALL",ORXPAR)
  1. ;
  1. Q
  1. ;
  1. EXCX() ; Deal with exceptions in spelling.
  1. ;
  1. I ORXTAB="D/C SUMMARIES" S ORXTAB="SUMMRIES" ; Shorter spelling.
  1. I ORXTAB="IMAGING" S ORXTAB="XRAYS" ; IMAGING is XRAYS.
  1. I ORXTAB="INPATIENT LABS" S ORXTAB="INPT LABS" ; Shorter spelling.
  1. I ORXTAB="OUTPATIENT LABS" S ORXTAB="OUTPT LABS" ; Shorter spelling.
  1. ;
  1. Q ORXTAB
  1. ;
  1. ;
  1. ; NOTES ON ENTRIES FOR THE FOLLOWING "TABS" TAG:
  1. ; Each TABS entry MUST have a corresponding PROMPTS entry in
  1. ; PROMPTS^ORXTABS, in the same order and with matching first
  1. ; pieces. There MUST ALSO be a tag in ORXTABS2, to get user
  1. ; input, which matches the actual name of the parameter in the
  1. ; Parameter Definition [^XTV(8989.51,] file. For example,
  1. ; the NOTES entry in TABS below is the last word of the "ORCH
  1. ; CONTEXT NOTES" entry in the Parameter Definition file. If
  1. ; the first piece listed in the TABS tag below differs from the
  1. ; actual Parameter Definition file entry - as is the case for
  1. ; XRAYS, which is the IMAGING entry below - add code in the EXCX
  1. ; tag above to deal with it. The third "^" piece in each TABS
  1. ; entry represents the positions in the parameter string entry
  1. ; itself, i.e. in the Parameters [^XTV(8989.5,] file, where
  1. ; each individual value is stored, in the order listed in the
  1. ; second "^" piece of the TABS entry. IMPORTANT: Keep all "BEG"
  1. ; and "END" pairs together consecutively - with "BEG" first, and
  1. ; all "STATUS" and "AUTHOR" pairs together - with "STATUS" first.
  1. ;
  1. TABS ; Data strings for parameters/preferences.
  1. ;;CONSULTS^BEG;END;STATUS;SERVICE^1;2;3;4
  1. ;;INPATIENT LABS^BEG;END;TYPE^1;2;3
  1. ;;OUTPATIENT LABS^BEG;END;TYPE^1;2;3
  1. ;;MEDS^BEG;END;OUTPT^1;2;3
  1. ;;NOTES^BEG;END;STATUS;AUTHOR;OCCLIM;SUBJECT^1;2;3;4;5;6
  1. ;;ORDERS^BEG;END;STATUS;DISPGRP;FORMAT^1;2;3;4;5
  1. ;;PROBLEMS^STATUS;COMMENTS^3;4
  1. ;;REPORTS^BEG;END;MAX^1;2;5
  1. ;;D/C SUMMARIES^BEG;END;STATUS;AUTHOR^1;2;3;4
  1. ;;IMAGING^BEG;END;MAX^1;2;5
  1. ;
  1. Q
  1. ;
  1. ; NOTES ON ENTRIES FOR "PROMPTS" TAG:
  1. ; Each PROMPTS entry below needs a corresponding TABS entry
  1. ; in TABS^ORXTABS, must be listed in the same order, and with
  1. ; a matching number of pieces.
  1. ;
  1. PROMPTS ; 24 char-max Prompts - MUST match TABS^ORXTABS entries/piece counts!
  1. ;;CONSULTS^Begin Date;End Date;Status;Service
  1. ;;INPATIENT LABS^Begin Date;End Date;Type
  1. ;;OUTPATIENT LABS^Begin Date;End Date;Type
  1. ;;MEDS^Begin Date;End Date;Outpatient or Inpatient Meds Default Display
  1. ;;NOTES^Begin Date;End Date;Status;Author;Occurrence Limit;Show/Hide Subject
  1. ;;ORDERS^Begin Date;End Date;Status;Service/Section;Format
  1. ;;PROBLEMS^Status;Comments
  1. ;;REPORTS^Begin Date;End Date;Maximum
  1. ;;D/C SUMMARIES^Begin Date;End Date;Status;Author
  1. ;;IMAGING^Begin Date;End Date;Maximum
  1. ;
  1. Q
  1. ;