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

ORXTABS4.m

Go to the documentation of this file.
  1. ORXTABS4 ; SLC/PKS - Edit calls, tab parameters preferences. [9/28/00 3:05pm]
  1. ;;3.0;ORDER ENTRY/RESULTS REPORTING;**9,47,84**;Dec 17, 1997
  1. ;
  1. ; NOTES: The routines herein are called by those of the same tag
  1. ; name in ORXTABS2. Most variables are NEW'd and assigned
  1. ; by one or more routines in the preceding call chains.
  1. ; Refer to comments and notes there for additional infor-
  1. ; mation.
  1. ;
  1. ; Each tag in this routine must return one of the following:
  1. ;
  1. ; 1 - A new value entered or selected by the user,
  1. ; 2 - A null string,
  1. ; 3 - The string "*Invalid*" - to repeat due to invalid entry,
  1. ; 4 - The "^" character, indicating user's cancel action.
  1. ;
  1. Q
  1. ;
  1. STATUS(TYPE) ; Status, for various tabs.
  1. ;
  1. ; Internal variables used:
  1. ;
  1. ; ORXAUTH = Holds current value of AUTHOR value for some TYPEs.
  1. ; ORXFLAG = Used in set/reset of ORDSTS^ORCHANG2 values.
  1. ; ORXP1 = Prompt piece holder.
  1. ; ORXP2 = Prompt piece holder.
  1. ; ORXSCNT = Loop counter.
  1. ; ORXSETC = Set of codes for assignment to DIR(0) variable.
  1. ; ORXSTAGS = Orders STATUS tags, in routine ORXCHANG2 or herein.
  1. ; TYPE = Type of STATUS being processed; must be one of:
  1. ;
  1. ; - ORDERS
  1. ; - CONSULTS
  1. ; - NOTES
  1. ; - D/C SUMMARIES
  1. ; - PROBLEMS
  1. ;
  1. N ORXAUTH,ORXFLAG,ORXP1,ORXP2,ORXSCNT,ORXSETC,ORXSTAGS
  1. ;
  1. ; Process DIR call through IF statements below, based on TYPE.
  1. ;
  1. ; Orders and Consults:
  1. ;
  1. ; NOTE: Displayed choices are numerically sequential as coded.
  1. ; Actual storage number values come from routine data tags.
  1. ; Thus, the default entry must be converted before
  1. ; display, reset before updates - as is done below.
  1. ;
  1. I ((TYPE="ORDERS")!(TYPE="CONSULTS")) D
  1. .K ORXSTAGS ; Clean up each time.
  1. .S ORXSCNT=0 ; Initialize counter.
  1. .S ORXFLAG=1 ; Start true each time.
  1. .;
  1. .; Establish loop for tag entries:
  1. .F D Q:(ORXSTAGS(ORXSCNT)="")!(ORXSTAGS(ORXSCNT)["ZZZ")
  1. ..S ORXSCNT=ORXSCNT+1 ; Increment counter.
  1. ..;
  1. ..; Assign retrieved values to ORXSTAGS array:
  1. ..S ORXSTAGS="ORDSTS+"_ORXSCNT_"^ORCHANG2" ; ORDERS data tag.
  1. ..;
  1. ..; For CONSULTS set a different data tag:
  1. ..I TYPE="CONSULTS" S ORXSTAGS="CORDSTS+"_ORXSCNT
  1. ..;
  1. ..S ORXSTAGS(ORXSCNT)=ORXSCNT_";"_$P($T(@ORXSTAGS),";;",2)
  1. ..I (ORXSTAGS(ORXSCNT)="")!(ORXSTAGS(ORXSCNT)["ZZZ") Q
  1. ..;
  1. ..; Reset ORXNOW (current value) number when found:
  1. ..I ORXFLAG D
  1. ...I $P(ORXSTAGS(ORXSCNT),";",2)=ORXNOW S ORXNOW=$P(ORXSTAGS(ORXSCNT),";",1) S ORXFLAG=0 ; Do only once each time.
  1. ..;
  1. ..; Continue building prompt strings from retrieved values:
  1. ..S ORXP1=$P(ORXSTAGS(ORXSCNT),";",1) ; First prompt piece.
  1. ..S ORXP1=$$LJ^XLFSTR(ORXP1,9) ; Format for 9 chars.
  1. ..S ORXP2=$P(ORXSTAGS(ORXSCNT),";",3) ; Second prompt piece.
  1. ..S ORXP2=$$LJ^XLFSTR(ORXP2,24) ; Format for 24 chars.
  1. ..;
  1. ..; Assign DIR("A") display array:
  1. ..S DIR("A",ORXSCNT)=ORXP1_ORXP2 ; Complete prompt string.
  1. .;
  1. .; Check for bad/missing tag data:
  1. .I ORXSCNT<2 W !!,"ERROR: Bad data tag entry(ies)." S ORXNOW="^" Q
  1. .;
  1. .; Assign remaining DIR variables:
  1. .S DIR("T")=120 ; Two minute maximum timeout for response.
  1. .S DIR("A")=" Enter # for type of "_ORXPDIS_" to display: "
  1. .S DIR("?")=" Entry must be between 1 and "_(ORXSCNT-1)
  1. .S DIR(0)="NA^1:"_(ORXSCNT-1) ; Numerical, required.
  1. .;
  1. .; Call tag to get/assign input:
  1. .D INPUT^ORXTABS2
  1. .;
  1. .; Check for user abort:
  1. .I ORXNOW="^" Q
  1. .;
  1. .; Reset user entry to actual number from data tag in use:
  1. .S:ORXNOW'="" ORXNOW=$P(ORXSTAGS(ORXNOW),";",2)
  1. ;
  1. ; Notes and D/C Summaries:
  1. I ((TYPE="NOTES")!(TYPE="D/C SUMMARIES")) D
  1. .;
  1. .; Assign values retrieved to ORXSTAGS array:
  1. .S ORXP1="1" ; First piece.
  1. .S ORXP1=$$LJ^XLFSTR(ORXP1,9) ; Format for 9 chars.
  1. .S ORXP2="All Signed" ; Second piece.
  1. .S ORXP2=$$LJ^XLFSTR(ORXP2,24) ; Format for 24 chars.
  1. .S DIR("A",1)=ORXP1_ORXP2 ; First prompt string.
  1. .S ORXP1="2" ; First piece.
  1. .S ORXP1=$$LJ^XLFSTR(ORXP1,9) ; Format for 9 chars.
  1. .S ORXP2="My Unsigned" ; Second piece.
  1. .S ORXP2=$$LJ^XLFSTR(ORXP2,24) ; Format for 24 chars.
  1. .S DIR("A",2)=ORXP1_ORXP2 ; Second prompt string.
  1. .S ORXP1="3" ; First piece.
  1. .S ORXP1=$$LJ^XLFSTR(ORXP1,9) ; Format for 9 chars.
  1. .S ORXP2="My Un-cosigned" ; Second piece.
  1. .S ORXP2=$$LJ^XLFSTR(ORXP2,24) ; Format for 24 chars.
  1. .S DIR("A",3)=ORXP1_ORXP2 ; Third prompt string.
  1. .S ORXP1="4" ; First piece.
  1. .S ORXP1=$$LJ^XLFSTR(ORXP1,9) ; Format for 9 chars.
  1. .S ORXP2="Signed/Author" ; Second piece.
  1. .S ORXP2=$$LJ^XLFSTR(ORXP2,24) ; Format for 24 chars.
  1. .S DIR("A",4)=ORXP1_ORXP2 ; Fourth prompt string.
  1. .S ORXP1="5" ; First piece.
  1. .S ORXP1=$$LJ^XLFSTR(ORXP1,9) ; Format for 9 chars.
  1. .S ORXP2="Signed/Dates" ; Second piece.
  1. .S ORXP2=$$LJ^XLFSTR(ORXP2,24) ; Format for 24 chars.
  1. .S DIR("A",5)=ORXP1_ORXP2 ; Fifth prompt string.
  1. .;
  1. .; Assign remaining DIR variables:
  1. .S DIR("T")=120 ; Two minute maximum timeout for response.
  1. .S DIR("A")=" Enter # for type of "_ORXPDIS_" to display: "
  1. .S DIR("?")=" Entry must be between 1 and 5"
  1. .S DIR(0)="NA^1:5" ; Numerical, required.
  1. .;
  1. .; Call tag to get/assign input:
  1. .D INPUT^ORXTABS2
  1. .;
  1. .; Check for user abort:
  1. .I ORXNOW="^" Q
  1. .;
  1. .; Use ORXAUTH twice to Check for valid entry:
  1. .I ORXNOW'="" D
  1. ..I (ORXCNT+1)<1 W !!,"ERROR: Improper TABS entry." S ORXNOW="^" Q
  1. ..S ORXAUTH=$P($G(ORXSETS),";",ORXCNT+1)
  1. ..I ORXAUTH'="AUTHOR" W !!,"ERROR: Improper TABS entry." S ORXNOW="^" Q
  1. ..S ORXAUTH=$P($G(ORXCUR),";",$P($G(ORXPCS),";",ORXCNT+1))
  1. ..I ((ORXAUTH="")&(ORXNOW=4)) S $P(ORXCUR,";",$P($G(ORXPCS),";",ORXCNT+1))=+DUZ Q ; STATUS 4 = DUZ AUTHOR.
  1. ..I ORXAUTH="" Q ; Stop if already null.
  1. ..;
  1. ..; For all other entries, set matching AUTHOR value to null:
  1. ..S $P(ORXCUR,";",$P($G(ORXPCS),";",ORXCNT+1))=""
  1. .;
  1. .; Check for deletion entry:
  1. .I ORXNOW="@" S ORXNOW=""
  1. ;
  1. ; Problems:
  1. I TYPE="PROBLEMS" D
  1. .K ORXSTAGS ; Clean up each time.
  1. .S ORXSETC="" ; Clear each time.
  1. .S ORXSCNT=0 ; Initialize counter.
  1. .;
  1. .; Establish loop for tag entries:
  1. .F D Q:(ORXSTAGS(ORXSCNT)="")!(ORXSTAGS(ORXSCNT)["ZZZ")
  1. ..S ORXSCNT=ORXSCNT+1 ; Increment counter.
  1. ..;
  1. ..; Assign retrieved values to ORXSTAGS array:
  1. ..S ORXSTAGS="PLSTS+"_ORXSCNT_"^ORCHANG2" ; Data tags.
  1. ..S ORXSTAGS(ORXSCNT)=$P($T(@ORXSTAGS),";;",2)
  1. ..I (ORXSTAGS(ORXSCNT)="")!(ORXSTAGS(ORXSCNT)["ZZZ") Q
  1. ..S ORXP1=$P(ORXSTAGS(ORXSCNT),";",1) ; First prompt piece.
  1. ..S:ORXSCNT=1 ORXSETC=ORXP1_":" ; DIR codes string.
  1. ..S:ORXSCNT>1 ORXSETC=ORXSETC_";"_ORXP1_":" ; "
  1. ..S ORXP1=$$LJ^XLFSTR(ORXP1,9) ; Format for 9 chars.
  1. ..S ORXP2=$P(ORXSTAGS(ORXSCNT),";",2) ; Second prompt piece.
  1. ..S ORXSETC=ORXSETC_ORXP2 ; DIR codes string.
  1. ..S ORXP2=$$LJ^XLFSTR(ORXP2,24) ; Format for 24 chars.
  1. ..;
  1. ..; Assign DIR("A") display array:
  1. ..S DIR("A",ORXSCNT)=ORXP1_ORXP2 ; Complete prompt string.
  1. .;
  1. .; Check for bad/missing data:
  1. .I ORXSCNT<2 W !!,"ERROR: Bad PLSTS tag data." S ORXNOW="^" Q
  1. .;
  1. .; Assign remaining DIR variables:
  1. .S DIR("T")=120 ; Two minute maximum timeout for response.
  1. .S DIR("A")=" Enter types of "_ORXPDIS_" to display: "
  1. .S DIR(0)="SAO^"_ORXSETC ; Optional, Set of Codes.
  1. .;
  1. .; Call tag to get/assign input:
  1. .D INPUT^ORXTABS2
  1. .;
  1. .; Check for user abort:
  1. .I ORXNOW="^" Q
  1. .;
  1. .; Check for deletion entry:
  1. .I ORXNOW="@" S ORXNOW=""
  1. ;
  1. Q
  1. ;
  1. ;
  1. ; NOTES ON ENTRIES FOR "CORDSTS" TAG:
  1. ; CORDSTS entries below match previous LM CONSULTS ORDERS
  1. ; "STATUS" settings allowed. They are also listed in the
  1. ; ORQ1 routine. The listings consist of 2 pieces:
  1. ;
  1. ; ValueToBeStoredInParam;ListingDescription
  1. ;
  1. CORDSTS ; Consults ORDERS "STATUS" settings.
  1. ;;1;Discontinued
  1. ;;2;Complete
  1. ;;5;Pending
  1. ;;6;Active
  1. ;;8;Scheduled
  1. ;;9;Partial Results
  1. ;;13;Cancelled
  1. ;;;All Statuses
  1. ;;;ZZZZ
  1. ;
  1. Q
  1. ;