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

DINIT2BB.m

Go to the documentation of this file.
  1. DINIT2BB ;SFISC/MKO-SQLI FILES ;10:51 AM 30 Mar 1999
  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 ^DINIT2BC
  1. Q Q
  1. ;;^DIC(1.5218,0,"GL")
  1. ;;=^DMSQ("P",
  1. ;;^DIC("B","SQLI_PRIMARY_KEY",1.5218)
  1. ;;=
  1. ;;^DIC(1.5218,"%D",0)
  1. ;;=^^9^9^2970806^^^
  1. ;;^DIC(1.5218,"%D",1,0)
  1. ;;=A chosen set of columns which uniquely identify a table.
  1. ;;^DIC(1.5218,"%D",2,0)
  1. ;;=In the relational model (as in set theory) the columns of a primary key
  1. ;;^DIC(1.5218,"%D",3,0)
  1. ;;=are not ordered. In SQLI they must be, in order to map to the quasi-
  1. ;;^DIC(1.5218,"%D",4,0)
  1. ;;=hierarchical model of M globals.
  1. ;;^DIC(1.5218,"%D",5,0)
  1. ;;=
  1. ;;^DIC(1.5218,"%D",6,0)
  1. ;;=FileMan subfiles (multiples) have a primary key element for each parent
  1. ;;^DIC(1.5218,"%D",7,0)
  1. ;;=plus one for the subfile. Each contains a pointer to its primary key table
  1. ;;^DIC(1.5218,"%D",8,0)
  1. ;;=element (SQLI_TABLE-ELEMENT), a sequence and a column in the local base
  1. ;;^DIC(1.5218,"%D",9,0)
  1. ;;= table (SQL_COLUMN).
  1. ;;^DD(1.5218,0)
  1. ;;=FIELD^^7^8
  1. ;;^DD(1.5218,0,"DDA")
  1. ;;=N
  1. ;;^DD(1.5218,0,"DT")
  1. ;;=2961014
  1. ;;^DD(1.5218,0,"IX","B",1.5218,.01)
  1. ;;=
  1. ;;^DD(1.5218,0,"IX","C",1.5218,2)
  1. ;;=
  1. ;;^DD(1.5218,0,"IX","D",1.5218,1)
  1. ;;=
  1. ;;^DD(1.5218,0,"NM","SQLI_PRIMARY_KEY")
  1. ;;=
  1. ;;^DD(1.5218,0,"PT",1.5219,1)
  1. ;;=
  1. ;;^DD(1.5218,0,"VRPK")
  1. ;;=DI
  1. ;;^DD(1.5218,.01,0)
  1. ;;=P_TBL_ELEMENT^RP1.5216'^DMSQ("E",^0;1^Q
  1. ;;^DD(1.5218,.01,.1)
  1. ;;=Key Element
  1. ;;^DD(1.5218,.01,1,0)
  1. ;;=^.1
  1. ;;^DD(1.5218,.01,1,1,0)
  1. ;;=1.5218^B
  1. ;;^DD(1.5218,.01,1,1,1)
  1. ;;=S ^DMSQ("P","B",$E(X,1,30),DA)=""
  1. ;;^DD(1.5218,.01,1,1,2)
  1. ;;=K ^DMSQ("P","B",$E(X,1,30),DA)
  1. ;;^DD(1.5218,.01,3)
  1. ;;=
  1. ;;^DD(1.5218,.01,9)
  1. ;;=^
  1. ;;^DD(1.5218,.01,21,0)
  1. ;;=^^1^1^2960926^^
  1. ;;^DD(1.5218,.01,21,1,0)
  1. ;;=IEN of table element in SQLI_TABLE_ELEMENT
  1. ;;^DD(1.5218,.01,"DT")
  1. ;;=2960823
  1. ;;^DD(1.5218,1,0)
  1. ;;=P_COLUMN^RP1.5217'^DMSQ("C",^0;2^Q
  1. ;;^DD(1.5218,1,.1)
  1. ;;=Column
  1. ;;^DD(1.5218,1,1,0)
  1. ;;=^.1
  1. ;;^DD(1.5218,1,1,1,0)
  1. ;;=1.5218^D
  1. ;;^DD(1.5218,1,1,1,1)
  1. ;;=S ^DMSQ("P","D",$E(X,1,30),DA)=""
  1. ;;^DD(1.5218,1,1,1,2)
  1. ;;=K ^DMSQ("P","D",$E(X,1,30),DA)
  1. ;;^DD(1.5218,1,1,1,"DT")
  1. ;;=2960830
  1. ;;^DD(1.5218,1,9)
  1. ;;=^
  1. ;;^DD(1.5218,1,21,0)
  1. ;;=^^1^1^2960926^^^
  1. ;;^DD(1.5218,1,21,1,0)
  1. ;;=IEN of column in SQLI_COLUMN corresponding to this primary key
  1. ;;^DD(1.5218,1,"DT")
  1. ;;=2960830
  1. ;;^DD(1.5218,2,0)
  1. ;;=P_SEQUENCE^RNJ1,0^^0;3^K:+X'=X!(X>9)!(X<1)!(X?.E1"."1N.N) X
  1. ;;^DD(1.5218,2,.1)
  1. ;;=Seq
  1. ;;^DD(1.5218,2,1,0)
  1. ;;=^.1
  1. ;;^DD(1.5218,2,1,1,0)
  1. ;;=1.5218^C^MUMPS
  1. ;;^DD(1.5218,2,1,1,1)
  1. ;;=S ^DMSQ("P","C",$P(^DMSQ("P",DA,0),U),X,DA)=""
  1. ;;^DD(1.5218,2,1,1,2)
  1. ;;=K ^DMSQ("P","C",$P(^DMSQ("P",DA,0),U),X,DA)
  1. ;;^DD(1.5218,2,1,1,"%D",0)
  1. ;;=^^1^1^2960827^^
  1. ;;^DD(1.5218,2,1,1,"%D",1,0)
  1. ;;=Primary key by table by sequence
  1. ;;^DD(1.5218,2,1,1,"DT")
  1. ;;=2960823
  1. ;;^DD(1.5218,2,3)
  1. ;;=Type a Number between 1 and 9, 0 Decimal Digits
  1. ;;^DD(1.5218,2,9)
  1. ;;=^
  1. ;;^DD(1.5218,2,21,0)
  1. ;;=^^1^1^2960926^
  1. ;;^DD(1.5218,2,21,1,0)
  1. ;;=Sequence number of primary key
  1. ;;^DD(1.5218,2,23,0)
  1. ;;=^^1^1^2960926^
  1. ;;^DD(1.5218,2,23,1,0)
  1. ;;=Sequence is automatically generated and must not be changed.
  1. ;;^DD(1.5218,2,"DT")
  1. ;;=2960926
  1. ;;^DD(1.5218,3,0)
  1. ;;=P_START_AT^F^^0;4^K:$L(X)>30!($L(X)<1) X
  1. ;;^DD(1.5218,3,.1)
  1. ;;=Start
  1. ;;^DD(1.5218,3,3)
  1. ;;=Answer must be 1-30 characters in length.
  1. ;;^DD(1.5218,3,9)
  1. ;;=^
  1. ;;^DD(1.5218,3,21,0)
  1. ;;=^^1^1^2960926^
  1. ;;^DD(1.5218,3,21,1,0)
  1. ;;=Initial value of key before a $ORDER loop
  1. ;;^DD(1.5218,3,"DT")
  1. ;;=2960820
  1. ;;^DD(1.5218,4,0)
  1. ;;=P_END_IF^K^^1;E1,245^K:$L(X)>245 X D:$D(X) ^DIM
  1. ;;^DD(1.5218,4,.1)
  1. ;;=End If
  1. ;;^DD(1.5218,4,3)
  1. ;;=This is a Standard M expression returning False at end
  1. ;;^DD(1.5218,4,9)
  1. ;;=^
  1. ;;^DD(1.5218,4,21,0)
  1. ;;=^^1^1^2960926^
  1. ;;^DD(1.5218,4,21,1,0)
  1. ;;=M expression in key value, {K}, which, if false, ends the $ORDER loop
  1. ;;^DD(1.5218,4,"DT")
  1. ;;=2960926
  1. ;;^DD(1.5218,5,0)
  1. ;;=P_ROW_COUNT^NJ10,2^^0;5^K:+X'=X!(X>9999999)!(X<1)!(X?.E1"."3N.N) X
  1. ;;^DD(1.5218,5,.1)
  1. ;;=Rows
  1. ;;^DD(1.5218,5,3)
  1. ;;=Type a Number between 1 and 9999999, 2 Decimal Digits
  1. ;;^DD(1.5218,5,9)
  1. ;;=^
  1. ;;^DD(1.5218,5,21,0)
  1. ;;=^^1^1^2960926^^
  1. ;;^DD(1.5218,5,21,1,0)
  1. ;;=Estimated number of rows per record set at this level
  1. ;;^DD(1.5218,5,"DT")
  1. ;;=2960926
  1. ;;^DD(1.5218,6,0)
  1. ;;=P_PRESELECT^K^^2;E1,245^K:$L(X)>245 X D:$D(X) ^DIM
  1. ;;^DD(1.5218,6,.1)
  1. ;;=Preselect M Code
  1. ;;^DD(1.5218,6,3)
  1. ;;=This is Standard MUMPS code.
  1. ;;^DD(1.5218,6,9)
  1. ;;=^
  1. ;;^DD(1.5218,6,21,0)
  1. ;;=^^1^1^2960926^^
  1. ;;^DD(1.5218,6,21,1,0)
  1. ;;=Code to be executed before selecting this key, before optimization.
  1. ;;^DD(1.5218,6,"DT")
  1. ;;=2960926
  1. ;;^DD(1.5218,7,0)
  1. ;;=P_KEY_FORMAT^P1.5213'^DMSQ("KF",^0;6^Q
  1. ;;^DD(1.5218,7,9)
  1. ;;=^
  1. ;;^DD(1.5218,7,21,0)
  1. ;;=^^4^4^2961014^
  1. ;;^DD(1.5218,7,21,1,0)
  1. ;;=Key formats map internal storage values to their value when used as keys.
  1. ;;^DD(1.5218,7,21,2,0)
  1. ;;=In general, information is lost in the process; they can't be converted
  1. ;;^DD(1.5218,7,21,3,0)
  1. ;;=back. This means data must be converted to key format before it can be
  1. ;;^DD(1.5218,7,21,4,0)
  1. ;;=compared to such a key.
  1. ;;^DD(1.5218,7,"DT")
  1. ;;=2961014