ORXTABS1 ; SLC/PKS - Edit tab parameters preferences.  [9/11/00 1:40pm]
 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**9,47,84**;Dec 17, 1997
 ;
 ; Additional control code for Tab Preferences Editing - works in
 ;    conjunction with the main routine, ORXTABS.
 ;
 ; NOTE: Most ORX* variables used herein NEW'd in calling routine.
 ;
 Q
 ;
EDIT ; Display list of this tab's parameter values, allow edit selection.
 ;
 ; Variables used herein:
 ;
 ;    ORXCNT2  = Loop counter for concantenated user input.
 ;    ORXHI    = High end of hyphenated entry.
 ;    ORXINPUT = Input string (DIR's Y var) from user's entry.
 ;    ORXLO    = Low end of hyphenated entry.
 ;    ORXNUM2  = Number of pieces in concantenated user input.
 ;    ORXTEMP  = Temporary value holder.
 ;    ORXTOT   = Total holder.
 ;
 N ORXCNT2,ORXHI,ORXINPUT,ORXLO,ORXNUM2,ORXTEMP,ORXTOT
 ;
 ; Create overall control loop:
 K ORXPCS                                  ; Clear each time.
 S ORXANY=0                                ; Set to check for changes.
 F  Q:ORXSTOP  D
 .;
 .; Get matching prompt strings:
 .K ORXPSTR,ORXPRO,ORXPDIS                 ; Prompts variables.
 .S ORXTAG="PROMPTS+"_ORXTCNT_"^ORXTABS"   ; Data tag for prompts.
 .S ORXPSTR=$P($T(@ORXTAG),";;",2)         ; Current prompts line.
 .S ORXPDIR=$P(ORXPSTR,U)                  ; Get first prompt piece.
 .I ORXPDIR'=ORXTNM D  Q                   ; Check for mismatch.
 ..W !!,"   Problem reading PROMPTS data!" ; On error, leave message.
 ..S ORXSTOP=1                             ; Set flag for abort.
 .S ORXPSTR=$P(ORXPSTR,U,2)                ; Get prompts list string.
 .S ORXPCS=$P($G(ORXPARS(ORXTCNT)),U,3)    ; Get "pieces" map string.
 .;
 .; Clear, reset DIR variables:
 .K DIR,X,Y
 .S DIR("T")=120 ; Two minute maximum timeout for response.
 .S DIR("A")="   Select "_ORXPDIR_" value to edit"
 .S DIR("?")="   Enter individual item number or comma-delimited string (within ranges listed)"
 .;
 .; Assign individual DIR display array items:
 .S ORXVAL=""
 .S ORXNUM=$L(ORXSETS,";")             ; # pieces = loop end counter.
 .F ORXCNT=1:1:ORXNUM  D               ; Each piece of param setting.
 ..S ORXVAL=$P($G(ORXSETS),";",ORXCNT) ; Each setting.
 ..S ORXVAL=$$LJ^XLFSTR(ORXVAL,9)      ; Format for 9 characters.
 ..S ORXPRO=$P(ORXPSTR,";",ORXCNT)     ; Prompt for this piece.
 ..S ORXPRO=$$LJ^XLFSTR(ORXPRO,24)     ; Format for 24 characters.
 ..;
 ..; Assign DIR display values:
 ..S ORXCDIS=ORXCNT                    ; Set display counter to same.
 ..S ORXCDIS=$$RJ^XLFSTR(ORXCDIS,2)    ; Right justify to 2 places.
 ..S DIR("A",ORXCNT)="     "_ORXCDIS_"     "_ORXVAL_"     "_ORXPRO
 .;
 .; Add one additional choice for editing "ALL" items:
 .I (ORXCNT>1) D
 ..S ORXCNT=ORXCNT+1                   ; Increment counter.
 ..S ORXNUM=ORXCNT                     ; Keep totaller up to date.
 ..S ORXCDIS=ORXCNT                    ; Set display counter to match.
 ..S ORXCDIS=$$RJ^XLFSTR(ORXCDIS,2)    ; Right justify to 2 places.
 ..S DIR("A",ORXCNT)="     "_ORXCDIS_"     ALL      "_"     Edit All Above Items"
 .;
 .; Define DIR input requirements:
 .S DIR(0)="LO^1:"_ORXNUM              ; List, from 1 to max choices.
 .;
 .; Call DIR for user choice:
 .W !! ; Spacing for screen display.
 .I ORXPDIR="REPORTS" D                ; Special note for reports.
 ..W !,"     NOTE: At present, the following settings affect only the list of"
 ..W !,"           Imaging report selections shown under Reports:"
 ..W !,"           ---------------------------------------------"
 .D ^DIR
 .;
 .; Check user response:
 .I '$L($G(Y)) S ORXSTOP=1 Q           ; Punt if Y isn't assigned.
 .I Y="" S ORXSTOP=1 Q                 ; Punt if Y is null.
 .I Y="^" S ORXSTOP=1 Q                ; Punt if Y is "^" character.
 .;
 .; Entry valid - assign ORXINPUT variable to user entry:
 .K ORXINPUT                           ; Clean up each time through.
 .S ORXINPUT=Y                         ; Now holds input string.
 .K DIR,X,Y                            ; Clean up after call to DIR.
 .;
 .; If user made a concantenated entry, deal with it:
 .I (($L($P(ORXINPUT,",",2)))!($L($P(ORXINPUT,"-",2)))) D  Q
 ..;
 ..; Deal with an entry string:
 ..S ORXTOT=1                                 ; Initial setting.
 ..S ORXNUM2=($L(ORXINPUT,",")-1)             ; Total pieces entered.
 ..;
 ..; Establish loop to tear the string apart:
 ..F ORXCNT=1:1:ORXNUM2  D                    ; Each piece in entry.
 ...I ORXCNT>ORXTOT S ORXTOT=ORXCNT           ; Reset higher?
 ...S ORXTEMP=$P(ORXINPUT,",",ORXCNT)         ; Get each entry piece.
 ...;
 ...; Check for a hyphenated entry:
 ...I $L($P(ORXTEMP,"-",2)) D  Q              ; To next piece after.
 ....S ORXLO=$P(ORXTEMP,"-")                  ; Lower number.
 ....S ORXHI=$P(ORXTEMP,"-",2)                ; Higher number.
 ....S ORXHI=+ORXHI                           ; Eliminate comma.
 ....I ORXHI>ORXTOT S ORXTOT=ORXHI            ; Reset higher?
 ....;
 ....; Use another loop to assign the range of hyphenated elements:
 ....F ORXCNT2=ORXLO:1:ORXHI D
 .....S ORXINPUT(ORXCNT2)=ORXCNT2             ; ORXCNT2 is default #.
 ...;
 ...; If piece isn't hyphenated, use it directly:
 ...S ORXINPUT(+ORXTEMP)=+ORXTEMP
 ...I +ORXTEMP>ORXTOT S ORXTOT=+ORXTEMP       ; Reset higher?
 ..;
 ..; Check and eliminate "ALL" selection if necessary:
 ..I ORXTOT=ORXNUM K ORXINPUT(ORXTOT) S ORXTOT=ORXTOT-1
 ..;
 ..; ORXTOT should now equal the highest-numbered user selection.
 ..; Each assigned ORXINPUT(xx) element should resemble:
 ..;    ORXINPUT(5)=5
 ..;
 ..; Call tag to process the entries:
 ..D SOME
 .;
 .; No more than one entry, so assign ORXCNT and proceed:
 .S ORXCNT=+ORXINPUT
 .;
 .; Unless "ALL" was selected, assign current value variables:
 .I ORXCNT<ORXNUM D
 ..S ORXNOW=$P($G(ORXCUR),";",$P($G(ORXPCS),";",ORXCNT))
 ..S ORXPDIS=$P(ORXPSTR,";",ORXCNT)     ; Display prompt, this piece.
 .;
 .; Deal with "ALL" choice:
 .I ORXCNT=ORXNUM S ORXSTOP=1 D ALL  Q  ; "ALL" choice.
 .;
 .; Process individual selections:
 .S ORXVAL=$P($G(ORXSETS),";",ORXCNT)   ; Any of individual choices.
 .D EACH
 ;
 Q
 ;
ALL ; Process each value (piece) of selected parameter in turn.
 ;
 S ORXNEW=""                                 ; Reset.
 ;
 ; Establish control loop:
 F ORXCNT=1:1:(ORXNUM-1) Q:ORXNEW="^"  D
 .;
 .; Set tag to match each value:
 .S ORXVAL=$P($G(ORXSETS),";",ORXCNT)
 .;
 .; Assign current value and prompt variables each time:
 .S ORXNOW=$P($G(ORXCUR),";",$P($G(ORXPCS),";",ORXCNT))
 .S ORXPDIS=$P(ORXPSTR,";",ORXCNT)
 .;
 .; Process each value:
 .W !!,"     (Entry of ^ will cancel entry process.)"
 .D EACH
 ;
 Q
 ;
SOME ; Process specific values of selected parameter in turn.
 ;
 S ORXNEW=""                                 ; Reset.
 ;
 ; Establish control loop:
 S ORXCNT=0                                  ; Initialize.
 F  Q:((ORXCNT>(ORXTOT))!(ORXNEW="^"))  D
 .S ORXCNT=ORXCNT+1                          ; Increment each time.
 .I '$D(ORXINPUT(ORXCNT)) Q                  ; Non-existant entries.
 .;
 .; Set tag to match each value:
 .S ORXVAL=$P($G(ORXSETS),";",ORXCNT)        ; ORXCNT is # by default.
 .;
 .; Assign current value and prompt variables each time:
 .S ORXNOW=$P($G(ORXCUR),";",$P($G(ORXPCS),";",ORXCNT))
 .S ORXPDIS=$P(ORXPSTR,";",ORXCNT)
 .;
 .; Process each value:
 .W !!,"     (Entry of ^ will cancel entry process.)"
 .D EACH
 ;
 Q
 ;
EACH ; Process and update an edited value.
 ;
 ; Get tag name in ORXTABS2 to process the user's entry:
 K DIR,X,Y
 S ORXANY=ORXANY+1
 ;
 ; Assign command string with passed variable for execution:
 S ORXNEW="S ORXNEW=$$"_ORXVAL_"^ORXTABS2("_""""_ORXNOW_""""_")"
 ;
 X ORXNEW                               ; Execute call to tag.
 ;
 ; Don't update value if user opted out with "^" entry:
 I ORXNEW="^" S ORXANY=ORXANY-1 Q
 ;
 ; Stuff new value into current value string:
 S $P(ORXCUR,";",$P($G(ORXPCS),";",ORXCNT))=ORXNEW
 ;
 Q
 ;
SAVE ; Obtain user input, then save or discard changes.
 ;
 S ORXANY=$$CONFIRM                       ; Re-use ORXANY variable.
 I 'ORXANY W !!,"   No changes saved...." Q
 ;
 ; Write changes back to parameters file:
 K ORXERR
 D PUT^XPAR(DUZ_";VA(200,",ORXPNAM,,ORXCUR,.ORXERR)
 ;
 ; Check for an error in the write process:
 I (+ORXERR'=0) D  Q
 .W !,"   ERROR: Parameter not updated!"  ; Notify user of error.
 .W !,"   ("_$P(ORXERR,U,2)_")"           ; Display error message.
 ;
 W !!,"Tab parameter setting(s) updated/saved."
 W !,"(GUI Users must close, re-start application to activate changes.)",!
 ;
 Q 
 ;
CONFIRM() ; Confirm to save changes.
 ;
 ; Clear, reset DIR variables:
 K DIR,X,Y
 S DIR("T")=120 ; Two minute maximum timeout for response.
 S DIR("A")="   Save changes"
 S DIR("?")="   Write changes to parameter file? (Y/N)"
 S DIR("A",1)="     YES"
 S DIR("A",2)="     NO"
 S DIR("B")="YES"
 ;
 ; Define DIR input requirements:
 S DIR(0)="YO^1:2:0"
 ;
 ; Call DIR for user choice:
 W !! ; Spacing for screen display.
 D ^DIR
 ;
 ; Check user response:
 I '$L($G(Y)) Q 0                      ; Skip if Y isn't assigned.
 I Y="" Q 0                            ; Skip if Y is null.
 I Y="^" Q 0                           ; Skip if Y is "^" character.
 I Y<1 Q 0                             ; Skip if Y is less than one.
 I Y>2 Q 0                             ; "No" choice.
 I Y=1 Q 1                             ; "Yes" choice.
 ;
 Q 0                                   ; Default return of "No."
 ;
 
--- Routine Detail   --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HORXTABS1   9639     printed  Sep 23, 2025@20:14:28                                                                                                                                                                                                    Page 2
ORXTABS1  ; SLC/PKS - Edit tab parameters preferences.  [9/11/00 1:40pm]
 +1       ;;3.0;ORDER ENTRY/RESULTS REPORTING;**9,47,84**;Dec 17, 1997
 +2       ;
 +3       ; Additional control code for Tab Preferences Editing - works in
 +4       ;    conjunction with the main routine, ORXTABS.
 +5       ;
 +6       ; NOTE: Most ORX* variables used herein NEW'd in calling routine.
 +7       ;
 +8        QUIT 
 +9       ;
EDIT      ; Display list of this tab's parameter values, allow edit selection.
 +1       ;
 +2       ; Variables used herein:
 +3       ;
 +4       ;    ORXCNT2  = Loop counter for concantenated user input.
 +5       ;    ORXHI    = High end of hyphenated entry.
 +6       ;    ORXINPUT = Input string (DIR's Y var) from user's entry.
 +7       ;    ORXLO    = Low end of hyphenated entry.
 +8       ;    ORXNUM2  = Number of pieces in concantenated user input.
 +9       ;    ORXTEMP  = Temporary value holder.
 +10      ;    ORXTOT   = Total holder.
 +11      ;
 +12       NEW ORXCNT2,ORXHI,ORXINPUT,ORXLO,ORXNUM2,ORXTEMP,ORXTOT
 +13      ;
 +14      ; Create overall control loop:
 +15      ; Clear each time.
           KILL ORXPCS
 +16      ; Set to check for changes.
           SET ORXANY=0
 +17       FOR 
               if ORXSTOP
                   QUIT 
               Begin DoDot:1
 +18      ;
 +19      ; Get matching prompt strings:
 +20      ; Prompts variables.
                   KILL ORXPSTR,ORXPRO,ORXPDIS
 +21      ; Data tag for prompts.
                   SET ORXTAG="PROMPTS+"_ORXTCNT_"^ORXTABS"
 +22      ; Current prompts line.
                   SET ORXPSTR=$PIECE($TEXT(@ORXTAG),";;",2)
 +23      ; Get first prompt piece.
                   SET ORXPDIR=$PIECE(ORXPSTR,U)
 +24      ; Check for mismatch.
                   IF ORXPDIR'=ORXTNM
                       Begin DoDot:2
 +25      ; On error, leave message.
                           WRITE !!,"   Problem reading PROMPTS data!"
 +26      ; Set flag for abort.
                           SET ORXSTOP=1
                       End DoDot:2
                       QUIT 
 +27      ; Get prompts list string.
                   SET ORXPSTR=$PIECE(ORXPSTR,U,2)
 +28      ; Get "pieces" map string.
                   SET ORXPCS=$PIECE($GET(ORXPARS(ORXTCNT)),U,3)
 +29      ;
 +30      ; Clear, reset DIR variables:
 +31               KILL DIR,X,Y
 +32      ; Two minute maximum timeout for response.
                   SET DIR("T")=120
 +33               SET DIR("A")="   Select "_ORXPDIR_" value to edit"
 +34               SET DIR("?")="   Enter individual item number or comma-delimited string (within ranges listed)"
 +35      ;
 +36      ; Assign individual DIR display array items:
 +37               SET ORXVAL=""
 +38      ; # pieces = loop end counter.
                   SET ORXNUM=$LENGTH(ORXSETS,";")
 +39      ; Each piece of param setting.
                   FOR ORXCNT=1:1:ORXNUM
                       Begin DoDot:2
 +40      ; Each setting.
                           SET ORXVAL=$PIECE($GET(ORXSETS),";",ORXCNT)
 +41      ; Format for 9 characters.
                           SET ORXVAL=$$LJ^XLFSTR(ORXVAL,9)
 +42      ; Prompt for this piece.
                           SET ORXPRO=$PIECE(ORXPSTR,";",ORXCNT)
 +43      ; Format for 24 characters.
                           SET ORXPRO=$$LJ^XLFSTR(ORXPRO,24)
 +44      ;
 +45      ; Assign DIR display values:
 +46      ; Set display counter to same.
                           SET ORXCDIS=ORXCNT
 +47      ; Right justify to 2 places.
                           SET ORXCDIS=$$RJ^XLFSTR(ORXCDIS,2)
 +48                       SET DIR("A",ORXCNT)="     "_ORXCDIS_"     "_ORXVAL_"     "_ORXPRO
                       End DoDot:2
 +49      ;
 +50      ; Add one additional choice for editing "ALL" items:
 +51               IF (ORXCNT>1)
                       Begin DoDot:2
 +52      ; Increment counter.
                           SET ORXCNT=ORXCNT+1
 +53      ; Keep totaller up to date.
                           SET ORXNUM=ORXCNT
 +54      ; Set display counter to match.
                           SET ORXCDIS=ORXCNT
 +55      ; Right justify to 2 places.
                           SET ORXCDIS=$$RJ^XLFSTR(ORXCDIS,2)
 +56                       SET DIR("A",ORXCNT)="     "_ORXCDIS_"     ALL      "_"     Edit All Above Items"
                       End DoDot:2
 +57      ;
 +58      ; Define DIR input requirements:
 +59      ; List, from 1 to max choices.
                   SET DIR(0)="LO^1:"_ORXNUM
 +60      ;
 +61      ; Call DIR for user choice:
 +62      ; Spacing for screen display.
                   WRITE !!
 +63      ; Special note for reports.
                   IF ORXPDIR="REPORTS"
                       Begin DoDot:2
 +64                       WRITE !,"     NOTE: At present, the following settings affect only the list of"
 +65                       WRITE !,"           Imaging report selections shown under Reports:"
 +66                       WRITE !,"           ---------------------------------------------"
                       End DoDot:2
 +67               DO ^DIR
 +68      ;
 +69      ; Check user response:
 +70      ; Punt if Y isn't assigned.
                   IF '$LENGTH($GET(Y))
                       SET ORXSTOP=1
                       QUIT 
 +71      ; Punt if Y is null.
                   IF Y=""
                       SET ORXSTOP=1
                       QUIT 
 +72      ; Punt if Y is "^" character.
                   IF Y="^"
                       SET ORXSTOP=1
                       QUIT 
 +73      ;
 +74      ; Entry valid - assign ORXINPUT variable to user entry:
 +75      ; Clean up each time through.
                   KILL ORXINPUT
 +76      ; Now holds input string.
                   SET ORXINPUT=Y
 +77      ; Clean up after call to DIR.
                   KILL DIR,X,Y
 +78      ;
 +79      ; If user made a concantenated entry, deal with it:
 +80               IF (($LENGTH($PIECE(ORXINPUT,",",2)))!($LENGTH($PIECE(ORXINPUT,"-",2))))
                       Begin DoDot:2
 +81      ;
 +82      ; Deal with an entry string:
 +83      ; Initial setting.
                           SET ORXTOT=1
 +84      ; Total pieces entered.
                           SET ORXNUM2=($LENGTH(ORXINPUT,",")-1)
 +85      ;
 +86      ; Establish loop to tear the string apart:
 +87      ; Each piece in entry.
                           FOR ORXCNT=1:1:ORXNUM2
                               Begin DoDot:3
 +88      ; Reset higher?
                                   IF ORXCNT>ORXTOT
                                       SET ORXTOT=ORXCNT
 +89      ; Get each entry piece.
                                   SET ORXTEMP=$PIECE(ORXINPUT,",",ORXCNT)
 +90      ;
 +91      ; Check for a hyphenated entry:
 +92      ; To next piece after.
                                   IF $LENGTH($PIECE(ORXTEMP,"-",2))
                                       Begin DoDot:4
 +93      ; Lower number.
                                           SET ORXLO=$PIECE(ORXTEMP,"-")
 +94      ; Higher number.
                                           SET ORXHI=$PIECE(ORXTEMP,"-",2)
 +95      ; Eliminate comma.
                                           SET ORXHI=+ORXHI
 +96      ; Reset higher?
                                           IF ORXHI>ORXTOT
                                               SET ORXTOT=ORXHI
 +97      ;
 +98      ; Use another loop to assign the range of hyphenated elements:
 +99                                       FOR ORXCNT2=ORXLO:1:ORXHI
                                               Begin DoDot:5
 +100     ; ORXCNT2 is default #.
                                                   SET ORXINPUT(ORXCNT2)=ORXCNT2
                                               End DoDot:5
                                       End DoDot:4
                                       QUIT 
 +101     ;
 +102     ; If piece isn't hyphenated, use it directly:
 +103                              SET ORXINPUT(+ORXTEMP)=+ORXTEMP
 +104     ; Reset higher?
                                   IF +ORXTEMP>ORXTOT
                                       SET ORXTOT=+ORXTEMP
                               End DoDot:3
 +105     ;
 +106     ; Check and eliminate "ALL" selection if necessary:
 +107                      IF ORXTOT=ORXNUM
                               KILL ORXINPUT(ORXTOT)
                               SET ORXTOT=ORXTOT-1
 +108     ;
 +109     ; ORXTOT should now equal the highest-numbered user selection.
 +110     ; Each assigned ORXINPUT(xx) element should resemble:
 +111     ;    ORXINPUT(5)=5
 +112     ;
 +113     ; Call tag to process the entries:
 +114                      DO SOME
                       End DoDot:2
                       QUIT 
 +115     ;
 +116     ; No more than one entry, so assign ORXCNT and proceed:
 +117              SET ORXCNT=+ORXINPUT
 +118     ;
 +119     ; Unless "ALL" was selected, assign current value variables:
 +120              IF ORXCNT<ORXNUM
                       Begin DoDot:2
 +121                      SET ORXNOW=$PIECE($GET(ORXCUR),";",$PIECE($GET(ORXPCS),";",ORXCNT))
 +122     ; Display prompt, this piece.
                           SET ORXPDIS=$PIECE(ORXPSTR,";",ORXCNT)
                       End DoDot:2
 +123     ;
 +124     ; Deal with "ALL" choice:
 +125     ; "ALL" choice.
                   IF ORXCNT=ORXNUM
                       SET ORXSTOP=1
                       DO ALL
                       QUIT 
 +126     ;
 +127     ; Process individual selections:
 +128     ; Any of individual choices.
                   SET ORXVAL=$PIECE($GET(ORXSETS),";",ORXCNT)
 +129              DO EACH
               End DoDot:1
 +130     ;
 +131      QUIT 
 +132     ;
ALL       ; Process each value (piece) of selected parameter in turn.
 +1       ;
 +2       ; Reset.
           SET ORXNEW=""
 +3       ;
 +4       ; Establish control loop:
 +5        FOR ORXCNT=1:1:(ORXNUM-1)
               if ORXNEW="^"
                   QUIT 
               Begin DoDot:1
 +6       ;
 +7       ; Set tag to match each value:
 +8                SET ORXVAL=$PIECE($GET(ORXSETS),";",ORXCNT)
 +9       ;
 +10      ; Assign current value and prompt variables each time:
 +11               SET ORXNOW=$PIECE($GET(ORXCUR),";",$PIECE($GET(ORXPCS),";",ORXCNT))
 +12               SET ORXPDIS=$PIECE(ORXPSTR,";",ORXCNT)
 +13      ;
 +14      ; Process each value:
 +15               WRITE !!,"     (Entry of ^ will cancel entry process.)"
 +16               DO EACH
               End DoDot:1
 +17      ;
 +18       QUIT 
 +19      ;
SOME      ; Process specific values of selected parameter in turn.
 +1       ;
 +2       ; Reset.
           SET ORXNEW=""
 +3       ;
 +4       ; Establish control loop:
 +5       ; Initialize.
           SET ORXCNT=0
 +6        FOR 
               if ((ORXCNT>(ORXTOT))!(ORXNEW="^"))
                   QUIT 
               Begin DoDot:1
 +7       ; Increment each time.
                   SET ORXCNT=ORXCNT+1
 +8       ; Non-existant entries.
                   IF '$DATA(ORXINPUT(ORXCNT))
                       QUIT 
 +9       ;
 +10      ; Set tag to match each value:
 +11      ; ORXCNT is # by default.
                   SET ORXVAL=$PIECE($GET(ORXSETS),";",ORXCNT)
 +12      ;
 +13      ; Assign current value and prompt variables each time:
 +14               SET ORXNOW=$PIECE($GET(ORXCUR),";",$PIECE($GET(ORXPCS),";",ORXCNT))
 +15               SET ORXPDIS=$PIECE(ORXPSTR,";",ORXCNT)
 +16      ;
 +17      ; Process each value:
 +18               WRITE !!,"     (Entry of ^ will cancel entry process.)"
 +19               DO EACH
               End DoDot:1
 +20      ;
 +21       QUIT 
 +22      ;
EACH      ; Process and update an edited value.
 +1       ;
 +2       ; Get tag name in ORXTABS2 to process the user's entry:
 +3        KILL DIR,X,Y
 +4        SET ORXANY=ORXANY+1
 +5       ;
 +6       ; Assign command string with passed variable for execution:
 +7        SET ORXNEW="S ORXNEW=$$"_ORXVAL_"^ORXTABS2("_""""_ORXNOW_""""_")"
 +8       ;
 +9       ; Execute call to tag.
           XECUTE ORXNEW
 +10      ;
 +11      ; Don't update value if user opted out with "^" entry:
 +12       IF ORXNEW="^"
               SET ORXANY=ORXANY-1
               QUIT 
 +13      ;
 +14      ; Stuff new value into current value string:
 +15       SET $PIECE(ORXCUR,";",$PIECE($GET(ORXPCS),";",ORXCNT))=ORXNEW
 +16      ;
 +17       QUIT 
 +18      ;
SAVE      ; Obtain user input, then save or discard changes.
 +1       ;
 +2       ; Re-use ORXANY variable.
           SET ORXANY=$$CONFIRM
 +3        IF 'ORXANY
               WRITE !!,"   No changes saved...."
               QUIT 
 +4       ;
 +5       ; Write changes back to parameters file:
 +6        KILL ORXERR
 +7        DO PUT^XPAR(DUZ_";VA(200,",ORXPNAM,,ORXCUR,.ORXERR)
 +8       ;
 +9       ; Check for an error in the write process:
 +10       IF (+ORXERR'=0)
               Begin DoDot:1
 +11      ; Notify user of error.
                   WRITE !,"   ERROR: Parameter not updated!"
 +12      ; Display error message.
                   WRITE !,"   ("_$PIECE(ORXERR,U,2)_")"
               End DoDot:1
               QUIT 
 +13      ;
 +14       WRITE !!,"Tab parameter setting(s) updated/saved."
 +15       WRITE !,"(GUI Users must close, re-start application to activate changes.)",!
 +16      ;
 +17       QUIT 
 +18      ;
CONFIRM() ; Confirm to save changes.
 +1       ;
 +2       ; Clear, reset DIR variables:
 +3        KILL DIR,X,Y
 +4       ; Two minute maximum timeout for response.
           SET DIR("T")=120
 +5        SET DIR("A")="   Save changes"
 +6        SET DIR("?")="   Write changes to parameter file? (Y/N)"
 +7        SET DIR("A",1)="     YES"
 +8        SET DIR("A",2)="     NO"
 +9        SET DIR("B")="YES"
 +10      ;
 +11      ; Define DIR input requirements:
 +12       SET DIR(0)="YO^1:2:0"
 +13      ;
 +14      ; Call DIR for user choice:
 +15      ; Spacing for screen display.
           WRITE !!
 +16       DO ^DIR
 +17      ;
 +18      ; Check user response:
 +19      ; Skip if Y isn't assigned.
           IF '$LENGTH($GET(Y))
               QUIT 0
 +20      ; Skip if Y is null.
           IF Y=""
               QUIT 0
 +21      ; Skip if Y is "^" character.
           IF Y="^"
               QUIT 0
 +22      ; Skip if Y is less than one.
           IF Y<1
               QUIT 0
 +23      ; "No" choice.
           IF Y>2
               QUIT 0
 +24      ; "Yes" choice.
           IF Y=1
               QUIT 1
 +25      ;
 +26      ; Default return of "No."
           QUIT 0
 +27      ;