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

DINIT125.m

Go to the documentation of this file.
  1. DINIT125 ;SFISC/MKO-SORT TEMPLATE FILE ;1:13 PM 13 Nov 1998
  1. ;;22.0;VA FileMan;;Mar 30, 1999
  1. ;Per VHA Directive 10-93-142, this routine should not be modified.
  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 ^DINIT126
  1. Q Q
  1. ;;^DD(.4014,14,21,1,0)
  1. ;;=Fields are assigned a probability rating based on the number of hits
  1. ;;^DD(.4014,14,21,2,0)
  1. ;;=found for the query (or sort) condition. The probability rating is used
  1. ;;^DD(.4014,14,21,3,0)
  1. ;;=to determine the order in which query conditions should be executed
  1. ;;^DD(.4014,14,21,4,0)
  1. ;;=during the sort phase. Fields with a higher probability rating are
  1. ;;^DD(.4014,14,21,5,0)
  1. ;;=executed first to most quickly cut down the number of records that have
  1. ;;^DD(.4014,14,21,6,0)
  1. ;;=to be processed.
  1. ;;^DD(.4014,14,23,0)
  1. ;;=^^1^1^2930125^
  1. ;;^DD(.4014,14,23,1,0)
  1. ;;=Calculated by a call to the FileMan Query Optimizer routine ^DIOQ.
  1. ;;^DD(.4014,14,"DT")
  1. ;;=2930125
  1. ;;^DD(.4014,15,0)
  1. ;;=DATA TYPE FOR SORTING^P.81'^DI(.81,^0;10^Q
  1. ;;^DD(.4014,15,21,0)
  1. ;;=^^5^5^2930514^
  1. ;;^DD(.4014,15,21,1,0)
  1. ;;=This pointer to the FileMan DATA TYPE file is entered automatically by
  1. ;;^DD(.4014,15,21,2,0)
  1. ;;=FileMan during the sort/print. Note that if sorting by a pointer or a
  1. ;;^DD(.4014,15,21,3,0)
  1. ;;=variable pointer, FileMan will follow the pointer chain until it gets to
  1. ;;^DD(.4014,15,21,4,0)
  1. ;;=one of the other data types, in order to determine how to correctly set up
  1. ;;^DD(.4014,15,21,5,0)
  1. ;;=the sort logic.
  1. ;;^DD(.4014,15,23,0)
  1. ;;=^^1^1^2930514^
  1. ;;^DD(.4014,15,23,1,0)
  1. ;;=Pointer to DATA TYPE file, derived by FileMan in routine DTYP^DIP1.
  1. ;;^DD(.4014,15,"DT")
  1. ;;=2930514
  1. ;;^DD(.4014,16,0)
  1. ;;=COMPUTED FIELD CODE^K^^CM;E1,245^K:$L(X)>245 X D:$D(X) ^DIM
  1. ;;^DD(.4014,16,3)
  1. ;;=This is Standard MUMPS code, generated for sorting by computed fields or pointer fields.
  1. ;;^DD(.4014,16,9)
  1. ;;=@
  1. ;;^DD(.4014,16,21,0)
  1. ;;=^^3^3^2930201^
  1. ;;^DD(.4014,16,21,1,0)
  1. ;;=This field contains MUMPS code used to find the actual value of a field
  1. ;;^DD(.4014,16,21,2,0)
  1. ;;=that is computed or a pointer. The code is generated by DICOMP. This
  1. ;;^DD(.4014,16,21,3,0)
  1. ;;=code may execute code in OVERFLOW nodes as well.
  1. ;;^DD(.4014,16,23,0)
  1. ;;=^^1^1^2930201^
  1. ;;^DD(.4014,16,23,1,0)
  1. ;;=Generated by DICOMP. Put into the DPP array in C^DIP0.
  1. ;;^DD(.4014,16,"DT")
  1. ;;=2930201
  1. ;;^DD(.4014,17,0)
  1. ;;=MULTIPLE FIELD DATA^.40141^^1;0
  1. ;;^DD(.4014,18,0)
  1. ;;=RELATIONAL JUMP FIELD DATA^.401418^^2;0
  1. ;;^DD(.4014,19,0)
  1. ;;=OVERFLOW DATA^.401419^^3;0
  1. ;;^DD(.4014,19,21,0)
  1. ;;=^^5^5^2930201^
  1. ;;^DD(.4014,19,21,1,0)
  1. ;;=This field contains the first subscript from the part of the DPP array
  1. ;;^DD(.4014,19,21,2,0)
  1. ;;=that contains overflow code executed when sorting by a field that is
  1. ;;^DD(.4014,19,21,3,0)
  1. ;;=gotten to relationally or a computed field. Overflow code is generated
  1. ;;^DD(.4014,19,21,4,0)
  1. ;;=when needed by DICOMP. This field will typically look something like
  1. ;;^DD(.4014,19,21,5,0)
  1. ;;="OVF0".
  1. ;;^DD(.4014,19,23,0)
  1. ;;=^^1^1^2930201^
  1. ;;^DD(.4014,19,23,1,0)
  1. ;;=Generated by DICOMP from DIP0 during the sort/print option.
  1. ;;^DD(.4014,19,"DT")
  1. ;;=2930201
  1. ;;^DD(.4014,20,0)
  1. ;;=SUBHEADER OUTPUT TRANSFORM^K^^OUT;E1,245^K:$L(X)>245 X D:$D(X) ^DIM
  1. ;;^DD(.4014,20,3)
  1. ;;=This is Standard MUMPS code. This is used only when sorting by a user-specified cross-reference in input variable BY(0).
  1. ;;^DD(.4014,20,9)
  1. ;;=@
  1. ;;^DD(.4014,20,21,0)
  1. ;;=^^6^6^2930204^
  1. ;;^DD(.4014,20,21,1,0)
  1. ;;=Defined only when using the BY(0) input variable to the FileMan print,
  1. ;;^DD(.4014,20,21,2,0)
  1. ;;=EN1^DIP, which allows the user to specify a cross-reference to sort on.
  1. ;;^DD(.4014,20,21,3,0)
  1. ;;=The user is allowed to specify MUMPS code that can be used as an output
  1. ;;^DD(.4014,20,21,4,0)
  1. ;;=transform for any of the subheaders (i.e., subscripts in the
  1. ;;^DD(.4014,20,21,5,0)
  1. ;;=cross-reference) in the S input array. This output transform code is
  1. ;;^DD(.4014,20,21,6,0)
  1. ;;=stored in this field.
  1. ;;^DD(.4014,20,23,0)
  1. ;;=^^4^4^2930204^
  1. ;;^DD(.4014,20,23,1,0)
  1. ;;=Stores output transform code from the third piece of S(0,N) where N is
  1. ;;^DD(.4014,20,23,2,0)
  1. ;;=the sort level. This is an input array used in conjunction with BY(0)
  1. ;;^DD(.4014,20,23,3,0)
  1. ;;=when user specifies a specific cross-reference to use for the sort, in
  1. ;;^DD(.4014,20,23,4,0)
  1. ;;=in the FileMan print routine EN1^DIP.
  1. ;;^DD(.4014,20,"DT")
  1. ;;=2930204
  1. ;;^DD(.4014,21,0)
  1. ;;=TEXT SORT FLAG^S^SORT:SORT LIKE TEXT;RANGE:TREAT RANGE LIKE TEXT;^SRTTXT;1^Q
  1. ;;^DD(.4014,21,21,0)
  1. ;;=^^12^12^2931221^
  1. ;;^DD(.4014,21,21,1,0)
  1. ;;=This flag will be set in one of two cases.
  1. ;;^DD(.4014,21,21,2,0)
  1. ;;= 1) If the user entered the ;TXT qualifier, the flag will be set to
  1. ;;^DD(.4014,21,21,3,0)
  1. ;;="SORT", and will cause a space to be inserted at the beginning of each
  1. ;;^DD(.4014,21,21,4,0)
  1. ;;=sort value, causing even numeric fields to be sorted as if they were text.
  1. ;;^DD(.4014,21,21,5,0)
  1. ;;= 2) If the user entered a FROM or TO value that is a non-canonic number,
  1. ;;^DD(.4014,21,21,6,0)
  1. ;;=the flag will be set to RANGE, and will cause sort values that are numeric
  1. ;;^DD(.4014,21,21,7,0)
  1. ;;=to be treated as if they were text, when seeing whether they fall within
  1. ;;^DD(.4014,21,21,8,0)
  1. ;;=the from/to range. However, they will still sort like numbers (MUMPS sort
  1. ;;^DD(.4014,21,21,9,0)
  1. ;;=sequence).
  1. ;;^DD(.4014,21,21,10,0)
  1. ;;=
  1. ;;^DD(.4014,21,21,11,0)
  1. ;;=The flag is set automatically when the user is entering the sort fields in
  1. ;;^DD(.4014,21,21,12,0)
  1. ;;=^DIP, and the from/to values in ^DIP1.
  1. ;;^DD(.4014,21,"DT")
  1. ;;=2931221
  1. ;;^DD(.40141,0)
  1. ;;=MULTIPLE FIELD DATA SUB-FIELD^^1^2
  1. ;;^DD(.40141,0,"DT")
  1. ;;=2930201
  1. ;;^DD(.40141,0,"IX","B",.40141,.01)
  1. ;;=
  1. ;;^DD(.40141,0,"NM","MULTIPLE FIELD DATA")
  1. ;;=
  1. ;;^DD(.40141,0,"UP")
  1. ;;=.4014
  1. ;;^DD(.40141,.01,0)
  1. ;;=MULT.FILE OR SUBFILE NO.^MNJ13,5^^0;1^K:+X'=X!(X>9999999.99999)!(X<0)!(X?.E1"."6N.N) X
  1. ;;^DD(.40141,.01,1,0)
  1. ;;=^.1
  1. ;;^DD(.40141,.01,1,1,0)
  1. ;;=.40141^B
  1. ;;^DD(.40141,.01,1,1,1)
  1. ;;=S ^DIBT(DA(2),2,DA(1),1,"B",$E(X,1,30),DA)=""
  1. ;;^DD(.40141,.01,1,1,2)
  1. ;;=K ^DIBT(DA(2),2,DA(1),1,"B",$E(X,1,30),DA)
  1. ;;^DD(.40141,.01,3)
  1. ;;=Type a Number between 0 and 9999999.99999, 5 Decimal Digits. This is the file/subfile number when sorting by a multiple field.
  1. ;;^DD(.40141,.01,21,0)
  1. ;;=^^4^4^2930201^
  1. ;;^DD(.40141,.01,21,1,0)
  1. ;;=All files or subfiles needed to get back up to the top level from a
  1. ;;^DD(.40141,.01,21,2,0)
  1. ;;=multiple field will be represented by an entry in this field. The
  1. ;;^DD(.40141,.01,21,3,0)
  1. ;;=file or subfile number will be used as a subscript in the DPP array