STANDARD DATA DICTIONARY #8993 -- XULM LOCK DICTIONARY FILE                                                       3/24/25    PAGE 1
STORED IN ^XLM(8993,  (22 ENTRIES)   SITE: WWW.BMIRWIN.COM   UCI: VISTA,VISTA                                      (VERSION 8.0)   

DATA          NAME                  GLOBAL        DATA
ELEMENT       TITLE                 LOCATION      TYPE
-----------------------------------------------------------------------------------------------------------------------------------
This file contains descriptions and specifications for locks held by various applications.  The Lock Manager uses it to provide
information and guidance to the user about locks found in the lock table.  
 


IDENTIFIED BY: 
      "WRITE": W:$P($G(^(1)),"^",2) "^" W $E(^(0),1,245)

PRIMARY KEY:        A (#138)
  Uniqueness Index: C (#1553)
       File, Field: 1) LOCK TEMPLATE (8993,.01)

CROSS
REFERENCED BY: LOCK TEMPLATE(B), FILE(D)

INDEXED BY:    GLOBAL LOCK? & LOCK TEMPLATE (AC), LOCK TEMPLATE (C), GLOBAL LOCK? & LOCK TEMPLATE (E)


    LAST MODIFIED: NOV 8,2019@11:22:42

8993,.01      LOCK TEMPLATE          0;E1,245 FREE TEXT (Required) (Key field)

              INPUT TRANSFORM:  K:'$$SNTXLOCK^XULM1(.X) X I $E($G(X),1,2)["^" S X=$P(X,"^",2,999)
              OUTPUT TRANSFORM: S:$G(DA) Y=$S($P($G(^XLM(8993,DA,1)),"^",2):"^",1:"")_Y
              LAST EDITED:      AUG 29, 2012 
              HELP-PROMPT:      Answer must be 1-245 characters in length with valid syntax. For global locks, enter one space 
                                before the '^'. 
              DESCRIPTION:      Enter the locked data structure as set in the LOCK command, except: 
                                  1) If the lock is on a global data structure, enter a space before 
                                     the '^'.  
                                  2) If an array subscript is a variable, enter a legal variable name.  
                                   
                                In examples 2-4, note that a space is necessary before the '^' of the global reference.  
                                   
                                Example 1: 
                                   If the lock is on the local variable 'DPT', enter 'DPT'.  
                                   
                                Example 2: 
                                   If the lock is on the entire ^DPT global, enter ' ^DPT'.  
                                   
                                Example 3: 
                                   If the lock is on the 0 node of a record in the patient file then the 
                                   record number must be represented by a variable.  Select a variable, 
                                   lets say DFN. So if the lock is on '^DPT(,0)', 
                                   the lock template may be entered as ' ^DPT(DFN,0)'.  
                                    
                                Example 4: 
                                    The same as example 3, except that the ""POV"" node is locked.  Enter 
                                    the lock template as ' ^DPT(DFN,"POV")'.  
                                 

              NOTES:            XXXX--CAN'T BE ALTERED EXCEPT BY PROGRAMMER

              CROSS-REFERENCE:  8993^B 
                                1)= S ^XLM(8993,"B",$E(X,1,30),DA)=""
                                2)= K ^XLM(8993,"B",$E(X,1,30),DA)

              FIELD INDEX:      C (#1553)    REGULAR    IR    LOOKUP & SORTING
                   Unique for:  Key A (#138), File #8993
                  Short Descr:  Uniqueness Index for Key 'A' of File #8993
                    Set Logic:  S ^XLM(8993,"C",X,DA)=""
                   Kill Logic:  K ^XLM(8993,"C",X,DA)
                   Whole Kill:  K ^XLM(8993,"C")
                         X(1):  LOCK TEMPLATE  (8993,.01)  (Subscr 1)

              RECORD INDEXES:   AC (#1548), E (#1554)

8993,1.01     PACKAGE                1;1 POINTER TO PACKAGE FILE (#9.4)

              LAST EDITED:      JUL 18, 2012 
              HELP-PROMPT:      Select the package that owns this entry in the lock dictionary. 
              DESCRIPTION:      This is the package for which the lock is set.  Locks usually are used to control access to a
                                package's data.  
                                 
                                 


8993,1.02     GLOBAL LOCK?           1;2 SET (Required)

                                '0' FOR NO; 
                                '1' FOR YES; 
              LAST EDITED:      AUG 29, 2012 
              HELP-PROMPT:      Is this lock on a global? 
              DESCRIPTION:      Both local and global variables maybe locked.  This field explicitly identifies which type of
                                variable the lock applies to. Global variables start with '^'.  
                                 
                                 

              RECORD INDEXES:   AC (#1548), E (#1554)

8993,1.03     PARTIAL MATCH ALLOWED? 1;3 SET

                                '0' FOR NO; 
                                '1' FOR YES; 
              LAST EDITED:      AUG 29, 2012 
              HELP-PROMPT:      Should a lock that has additional subscripts be counted as a match to this template? 
              DESCRIPTION:      If this field is set to YES, then a lock that has additional subscripts will be considered a match
                                to this template as long as the first parts match.  A partial match will be allowed only if no full
                                match exists.  
                                 
                                For example, for the input template ^DPT(DFN), the lock on ^DPT(,0) will be considered a match
                                if this field is set to YES.  
                                 
                                 


8993,2        ARRAY SUBSCRIPTS       2;0 Multiple #8993.02

              LAST EDITED:      MAY 09, 2012 
              DESCRIPTION:      This multiple has an entry for each subscript in the locked data structure.  
                                 
                                For example, a lock on ^DPT(,0) has two subscripts so should have two entries in this
                                multiple.  
                                 

              TECHNICAL DESCR:
                                 

              IDENTIFIED BY:    SUBSCRIPT(#.02)[R]

8993.02,.01     SUBSCRIPT ORDER NUMBER 0;1 NUMBER (Multiply asked)

                INPUT TRANSFORM:  K:+X'=X!(X>99)!(X<1)!(X?.E1"."1.N) X
                LAST EDITED:      MAY 10, 2012 
                HELP-PROMPT:      Enter an integer indicating the order of the subscript within the locked data structure.  The 
                                  first subscript is 1, then 2, etc. 
                DESCRIPTION:      This field is the order number of the subscript in the locked data structure.  For example,  if
                                  the lock is on ^DPT(,0), the '0' should have 2 as its order number.  
                                   
                                   
                                   

                CROSS-REFERENCE:  8993.02^B 
                                  1)= S ^XLM(8993,DA(1),2,"B",$E(X,1,30),DA)=""
                                  2)= K ^XLM(8993,DA(1),2,"B",$E(X,1,30),DA)


8993.02,.02     SUBSCRIPT              0;2 FREE TEXT (Required)

                INPUT TRANSFORM:  K:$L(X)>240!($L(X)<1) X
                LAST EDITED:      MAY 09, 2012 
                HELP-PROMPT:      Enter the subscript exactly as it appears in the lock template. 
                DESCRIPTION:      This is the text parsed out of the LOCK TEMPLATE.  For example, if the lock template is
                                  ^DPT(DFN,0), the first subscript is DFN and the second subscript is 0.  
                                   


8993.02,.04     TYPE                   0;4 SET (Required)

                                  'L' FOR LITERAL; 
                                  'V' FOR VARIABLE; 
                LAST EDITED:      JUL 16, 2012 
                HELP-PROMPT:      What type of subscript is this? 
                DESCRIPTION:      Subscripts in the LOCK TEMPLATE can either be a literal or a variable.  A literal subscript is
                                  one whose value in the lock table will match the value in this field exactly.  A variable
                                  subscript is one whose value in the table need not match. 
                                   
                                  There are several fields within this file that provide for executable MUMPS code to be specified. 
                                  At the point the MUMPS code is executed, for each subscript defined as being type VARIABLE, the
                                  variable of that same name will be defined and be assigned the value that appears in the lock
                                  table for the subscript of the same position.  
                                   
                                  For example, given the lock template ^DPT(DFN,0), with DFN defined as a variable subscript and 0
                                  as a literal subscript.  
                                   
                                  An entry in the lock table of '^DPT(123,0)' might be considered a match to this lock template. 
                                  For any of the M code specified in the MUMPS fields, the variable DFN=123 would be defined at the
                                  point the M code is executed.  Assuming that the variable DFN was defined to the the IEN of a
                                  record in the patient file, then the variable could be used to supply information about the 
                                  patient record that the lock was on. 
                                   
                                   


8993.02,1       VARIABLE CHECK LOGIC   1;E1,245 MUMPS

                INPUT TRANSFORM:  K:$L(X)>245 X D:$D(X) ^DIM
                LAST EDITED:      AUG 29, 2012 
                HELP-PROMPT:      Enter standard MUMPS code that will check whether the value of the subscript is consistent with 
                                  the lock template or should be screened out. Matches should return Y=1, non-matches should return 
                                  Y=0. 
                DESCRIPTION:       This field applies only to subscripts that are represented as a variable in the lock template,
                                  and is optional even for variables.  
                                   
                                  If the subscript is represented by a variable, this field may contain MUMPS code that checks that
                                  the value is consistent with the use of the lock.  
                                   
                                  For example, suppose the lock template is ^DPT(DFN,0).  Does the lock on ^DPT("sally",0) match
                                  the lock template?  Yes, but that is not the intention.  In order to screen out erroneous matches
                                  this field may be used to specify a check.  
                                   
                                  All variables that appear in the LOCK TEMPLATE will be defined at the time the logic is executed
                                  with the values parsed from the lock table. It should return the value of Y=1 if the variable
                                  value is consistent with the lock template, or Y=0 if not.  
                                   
                                  For example:    S Y=$S((DFN)&&$D(^DPT(DFN,0)):1,1:0) 
                                   
                                  If the lock template contains more than one variable, it is only necessary to provide the check
                                  logic once.  For example, if the lock is on ^DPT(DFN,"INSURANCE",POLICY), you could associate the
                                  full check logic with either DFN or POLICY.  Both variables will be defined at the time the check
                                  logic is called.  
                                   

                WRITE AUTHORITY:  @



8993,3        COMPUTABLE FILE REFERENCES 3;0 POINTER Multiple #8993.03

              DESCRIPTION:      This multiple provides information about the VistA files referenced by the locked data structure.  
                                 


              PRIMARY KEY:      A (#139)
              Uniqueness Index: C (#1555)
                   File, Field: 1) FILE (8993.03,.01)

              INDEXED BY:       FILE (C)

8993.03,.01     FILE                   0;1 POINTER TO FILE FILE (#1) (Multiply asked) (Key field)

                LAST EDITED:      JUL 18, 2012 
                HELP-PROMPT:      Enter the file for which a reference may be computed based on the lock. 
                DESCRIPTION:      This field identifies a VistA file referenced directly or indirectly by the locked data
                                  structure. Most locks of interest to users of the Lock Manager will relate in some way to a
                                  specific patient, so most entries in the lock dictionary should contain a reference to the
                                  PATIENT file (#2) 
                                   

                CROSS-REFERENCE:  8993.03^B 
                                  1)= S ^XLM(8993,DA(1),3,"B",$E(X,1,30),DA)=""
                                  2)= K ^XLM(8993,DA(1),3,"B",$E(X,1,30),DA)

                CROSS-REFERENCE:  8993^D 
                                  1)= S ^XLM(8993,"D",$E(X,1,30),DA(1),DA)=""
                                  2)= K ^XLM(8993,"D",$E(X,1,30),DA(1),DA)
                                  This allows lock templates to be found that refer to a particular file. The lock may refer to the
                                  file either directly or indirectly via the navigation logic.  
                                   
                                   


                FIELD INDEX:      C (#1555)    REGULAR    IR    LOOKUP & SORTING
                     Unique for:  Key A (#139), File #8993.03
                    Short Descr:  Uniqueness Index for Key 'A' of Subfile #8993.03
                    Description:  This index guarantees that a particular file will be entered at most once in this multiple.  
                                   
                                  
                      Set Logic:  S ^XLM(8993,DA(1),3,"C",X,DA)=""
                     Kill Logic:  K ^XLM(8993,DA(1),3,"C",X,DA)
                     Whole Kill:  K ^XLM(8993,DA(1),3,"C")
                           X(1):  FILE  (8993.03,.01)  (Subscr 1)


8993.03,1       FILE REFERENCE LOGIC   1;E1,245 MUMPS (Required)

                INPUT TRANSFORM:  K:$L(X)>245 X D:$D(X) ^DIM
                LAST EDITED:      AUG 29, 2012 
                HELP-PROMPT:      Enter Standard MUMPS code that returns record identifiers for the record that is locked. The 
                                  variables in the LOCK TEMPLATE may be used within the code. 
                DESCRIPTION:      This field contains MUMPS code that references the file.  At the time this code is executed, all
                                  the variables defined in the lock template will be defined with the values found in the actual
                                  lock.  
                                   
                                  The MUMPS code should return the ien of the matching record and a list of identifiers that can be
                                  displayed to the user.  The identifiers will be displayed to the user.  
                                   
                                  The MUMPS code should NEW all variables it uses, other than the variables defined in the lock
                                  template and the variable ID.  
                                   
                                  The variable ID should be returned with the the ien and a list of identifiers that can be
                                  displayed to the user.  The format should be: 
                                   
                                  ID(0) =  ID("IEN")= If the record is not in a
                                  subfile, then: 
                                   
                                                 
                                   
                                             If the record is in a subfile, then: 
                                               <(IEN of top-most file record)^ 
                                                (IEN of record in top-most sub-file)^etc.> 
                                   
                                  ID(1) =