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

DINIT2A2.m

Go to the documentation of this file.
  1. DINIT2A2 ;SFISC/MKO-KEY AND INDEX FILES ;11:29 AM 19 Nov 2012
  1. ;;22.2;VA FileMan;;Jan 05, 2016;Build 42
  1. ;;Per VA Directive 6402, this routine should not be modified.
  1. ;;Submitted to OSEHRA 5 January 2015 by the VISTA Expertise Network.
  1. ;;Based on Medsphere Systems Corporation's MSC FileMan 1051.
  1. ;;Licensed under the terms of the Apache License, Version 2.0.
  1. ;
  1. F I=1:2 S X=$T(Q+I) Q:X="" S Y=$E($T(Q+I+1),4,999),X=$E(X,4,999) S:$A(Y)=126 I=I+1,Y=$E(Y,2,999)_$E($T(Q+I+1),5,99) S:$A(Y)=61 Y=$E(Y,2,999) S @X=Y
  1. G ^DINIT2A3
  1. Q Q
  1. ;;^DD(.11,2.1,9)
  1. ;;=@
  1. ;;^DD(.11,2.1,21,0)
  1. ;;=^^16^16^2990430^
  1. ;;^DD(.11,2.1,21,1,0)
  1. ;;=Answer with the M code that FileMan should execute when the values of
  1. ;;^DD(.11,2.1,21,2,0)
  1. ;;=fields that make up the cross-reference are changed or deleted. When field
  1. ;;^DD(.11,2.1,21,3,0)
  1. ;;=values are changed, FileMan executes first the KILL LOGIC, then the SET
  1. ;;^DD(.11,2.1,21,4,0)
  1. ;;=LOGIC.
  1. ;;^DD(.11,2.1,21,5,0)
  1. ;;=
  1. ;;^DD(.11,2.1,21,6,0)
  1. ;;=Assume the DA array describes the record to be cross-referenced, and that
  1. ;;^DD(.11,2.1,21,7,0)
  1. ;;=the X(order#) array contains values after the transform for storage is
  1. ;;^DD(.11,2.1,21,8,0)
  1. ;;=applied, but before the truncation to the maximum length. The variable X
  1. ;;^DD(.11,2.1,21,9,0)
  1. ;;=also equals X(order#) of the lowest order number.
  1. ;;^DD(.11,2.1,21,10,0)
  1. ;;=
  1. ;;^DD(.11,2.1,21,11,0)
  1. ;;=When fields that make up a cross-reference are edited and the kill and set
  1. ;;^DD(.11,2.1,21,12,0)
  1. ;;=logic are executed, the X1(order#) array contains the old field values,
  1. ;;^DD(.11,2.1,21,13,0)
  1. ;;=and the X2(order#) array contains the new field values. If a record is
  1. ;;^DD(.11,2.1,21,14,0)
  1. ;;=being added, and there is an X1(order#) array element that corresponds to
  1. ;;^DD(.11,2.1,21,15,0)
  1. ;;=the .01 field, it is set to null. When a record is deleted, all X2(order#)
  1. ;;^DD(.11,2.1,21,16,0)
  1. ;;=array elements are null.
  1. ;;^DD(.11,2.1,"DT")
  1. ;;=2960116
  1. ;;^DD(.11,2.2,0)
  1. ;;=OVERFLOW KILL LOGIC^.112^^2.2;0
  1. ;;^DD(.11,2.2,"DT")
  1. ;;=2960124
  1. ;;^DD(.11,2.3,0)
  1. ;;=KILL CONDITION^F^^2.3;E1,245^K:$L(X)>245!($L(X)<1) X
  1. ;;^DD(.11,2.3,3)
  1. ;;=Answer must be a valid FileMan computed expression. Answer '??' for more help.
  1. ;;^DD(.11,2.3,21,0)
  1. ;;=^^5^5^2960124^
  1. ;;^DD(.11,2.3,21,1,0)
  1. ;;=Answer with a FileMan computed expression that will evaluate to Boolean
  1. ;;^DD(.11,2.3,21,2,0)
  1. ;;=true (according to the M rules for Boolean interpretation). FileMan will
  1. ;;^DD(.11,2.3,21,3,0)
  1. ;;=evaluate this expression whenever it would normally execute the
  1. ;;^DD(.11,2.3,21,4,0)
  1. ;;=cross-reference's Kill Logic, and will not execute the Kill Logic unless
  1. ;;^DD(.11,2.3,21,5,0)
  1. ;;=this condition evaluates to true.
  1. ;;^DD(.11,2.3,"DT")
  1. ;;=2960116
  1. ;;^DD(.11,2.4,0)
  1. ;;=KILL CONDITION CODE^K^^2.4;E1,245^K:$L(X)>245 X D:$D(X) ^DIM
  1. ;;^DD(.11,2.4,3)
  1. ;;=This is Standard MUMPS code. Answer '??' for more help.
  1. ;;^DD(.11,2.4,9)
  1. ;;=@
  1. ;;^DD(.11,2.4,21,0)
  1. ;;=^^15^15^2990430^
  1. ;;^DD(.11,2.4,21,1,0)
  1. ;;=This is MUMPS code, that sets the variable X. The KILL LOGIC is executed
  1. ;;^DD(.11,2.4,21,2,0)
  1. ;;=only if the KILL CONDITION, if present, sets X such the X evaluates to
  1. ;;^DD(.11,2.4,21,3,0)
  1. ;;=true, (according to M rules for Boolean interpretation)
  1. ;;^DD(.11,2.4,21,4,0)
  1. ;;=
  1. ;;^DD(.11,2.4,21,5,0)
  1. ;;=Assume the DA array describes the record to be cross-referenced, and that
  1. ;;^DD(.11,2.4,21,6,0)
  1. ;;=the X(order#) array contains values after the transform for storage is
  1. ;;^DD(.11,2.4,21,7,0)
  1. ;;=applied, but before the truncation to the maximum length. The variable X
  1. ;;^DD(.11,2.4,21,8,0)
  1. ;;=also equals X(order#) of the lowest order number.
  1. ;;^DD(.11,2.4,21,9,0)
  1. ;;=
  1. ;;^DD(.11,2.4,21,10,0)
  1. ;;=When fields that make up a cross-reference are edited and the kill and set
  1. ;;^DD(.11,2.4,21,11,0)
  1. ;;=conditions are executed, the X1(order#) array contains the old field
  1. ;;^DD(.11,2.4,21,12,0)
  1. ;;=values, and the X2(order#) array contains the new field values. If a
  1. ;;^DD(.11,2.4,21,13,0)
  1. ;;=record is being added, and there is an X1(order#) array element that
  1. ;;^DD(.11,2.4,21,14,0)
  1. ;;=corresponds to the .01 field, it is set to null. When a record is deleted,
  1. ;;^DD(.11,2.4,21,15,0)
  1. ;;=all X2(order#) array elements are null.
  1. ;;^DD(.11,2.4,"DT")
  1. ;;=2970117
  1. ;;^DD(.11,2.5,0)
  1. ;;=KILL ENTIRE INDEX CODE^K^^2.5;E1,245^K:$L(X)>245 X D:$D(X) ^DIM
  1. ;;^DD(.11,2.5,3)
  1. ;;=This is Standard MUMPS code. Answer '??' for more help.
  1. ;;^DD(.11,2.5,9)
  1. ;;=@
  1. ;;^DD(.11,2.5,21,0)
  1. ;;=^^4^4^2980911^
  1. ;;^DD(.11,2.5,21,1,0)
  1. ;;=This is a kill statement that can be executed to remove an entire index for
  1. ;;^DD(.11,2.5,21,2,0)
  1. ;;=all records in a file. When an entire file is reindexed, FileMan executes
  1. ;;^DD(.11,2.5,21,3,0)
  1. ;;=this code instead of looping through all the entries in a file and
  1. ;;^DD(.11,2.5,21,4,0)
  1. ;;=executing the kill logic once for each entry.
  1. ;;^DD(.11,666,0)
  1. ;;=RE-INDEXING^SI^1:NO RE-INDEXING ALLOWED;0:ALLOW REINDEXING^NOREINDEX;1
  1. ;;^DD(.11,666,3)
  1. ;;=Should the re-indexing of this cross reference be prohibited?
  1. ;;^DD(.11,666,21,0)
  1. ;;=^^5^5
  1. ;;^DD(.11,666,21,1,0)
  1. ;;=If you answer '1', this cross reference will not be re-indexed during a
  1. ;;^DD(.11,666,21,2,0)
  1. ;;=general re-indexing of this file, whether it's done via API or
  1. ;;^DD(.11,666,21,3,0)
  1. ;;=interactively. If you answer '0', which is the default, it will.
  1. ;;^DD(.11,666,21,4,0)
  1. ;;=A 'NO RE-INDEXING' cross-reference will ONLY be re-indexed
  1. ;;^DD(.11,666,21,5,0)
  1. ;;=if it is specifically named in an API call
  1. ;;^DD(.11,11.1,0)
  1. ;;=CROSS-REFERENCE VALUES^.114IA^^11.1;0
  1. ;;^DD(.11,11.1,"DT")
  1. ;;=2960221
  1. ;;^DD(.1101,0)
  1. ;;=DESCRIPTION SUB-FIELD^^.01^1
  1. ;;^DD(.1101,0,"DT")
  1. ;;=2960116
  1. ;;^DD(.1101,0,"NM","DESCRIPTION")
  1. ;;=
  1. ;;^DD(.1101,0,"UP")
  1. ;;=.11
  1. ;;^DD(.1101,.01,0)
  1. ;;=DESCRIPTION^W^^0;1^Q
  1. ;;^DD(.1101,.01,3)
  1. ;;=Answer '??' for more help.
  1. ;;^DD(.1101,.01,21,0)
  1. ;;=^^3^3^2960123^
  1. ;;^DD(.1101,.01,21,1,0)
  1. ;;=Answer should describe the purpose of this index, along with any technical
  1. ;;^DD(.1101,.01,21,2,0)
  1. ;;=information that might be useful to advanced users, developers,
  1. ;;^DD(.1101,.01,21,3,0)
  1. ;;=troubleshooters, or system managers.
  1. ;;^DD(.1101,.01,"DT")
  1. ;;=2960116
  1. ;;^DD(.111,0)
  1. ;;=OVERFLOW SET LOGIC SUB-FIELD^^1^2
  1. ;;^DD(.111,0,"DT")
  1. ;;=2960124
  1. ;;^DD(.111,0,"NM","OVERFLOW SET LOGIC")
  1. ;;=
  1. ;;^DD(.111,0,"UP")
  1. ;;=.11
  1. ;;^DD(.111,.01,0)
  1. ;;=OVERFLOW SET LOGIC NODE^MNJ6,0X^^0;1^K:+X'=X!(X>999999)!(X<1)!(X?.E1"."1N.N) X S:$D(X) DINUM=X
  1. ;;^DD(.111,.01,3)
  1. ;;=Type a Number between 1 and 999999, 0 Decimal Digits. Answer '??' for more help.
  1. ;;^DD(.111,.01,21,0)
  1. ;;=^^3^3^2980911^
  1. ;;^DD(.111,.01,21,1,0)
  1. ;;=Answer must be the number of the node under which the additional line of
  1. ;;^DD(.111,.01,21,2,0)
  1. ;;=set logic will be filed. Use the overflow nodes if the set logic is too
  1. ;;^DD(.111,.01,21,3,0)
  1. ;;=long to fit in the SET LOGIC field.
  1. ;;^DD(.111,.01,"DT")
  1. ;;=2980910
  1. ;;^DD(.111,1,0)
  1. ;;=OVERFLOW SET LOGIC^RK^^1;E1,245^K:$L(X)>245 X D:$D(X) ^DIM
  1. ;;^DD(.111,1,3)
  1. ;;=Answer must be Standard M code. Answer '??' for more help.
  1. ;;^DD(.111,1,9)
  1. ;;=@
  1. ;;^DD(.111,1,21,0)
  1. ;;=^^6^6^2980911^
  1. ;;^DD(.111,1,21,1,0)
  1. ;;=Answer with the M code of the additional set logic stored at this node.
  1. ;;^DD(.111,1,21,2,0)
  1. ;;=FileMan will not automatically execute this additional code, so the set
  1. ;;^DD(.111,1,21,3,0)
  1. ;;=logic must invoke the additional code stored in this overflow node.
  1. ;;^DD(.111,1,21,4,0)
  1. ;;=
  1. ;;^DD(.111,1,21,5,0)
  1. ;;=The M code can assume that DIXR contains the internal entry number of the