- DINIT2BC ;SFISC/MKO-SQLI FILES ;10:51 AM 30 Mar 1999
- ;;22.2;VA FileMan;;Jan 05, 2016;Build 42
- ;;Per VA Directive 6402, this routine should not be modified.
- ;;Submitted to OSEHRA 5 January 2015 by the VISTA Expertise Network.
- ;;Based on Medsphere Systems Corporation's MSC FileMan 1051.
- ;;Licensed under the terms of the Apache License, Version 2.0.
- ;
- 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
- G ^DINIT2BD
- Q Q
- ;;^DIC(1.5219,0,"GL")
- ;;=^DMSQ("F",
- ;;^DIC("B","SQLI_FOREIGN_KEY",1.5219)
- ;;=
- ;;^DIC(1.5219,"%D",0)
- ;;=^^6^6^2970806^^^^
- ;;^DIC(1.5219,"%D",1,0)
- ;;=A set of columns in a table that match the primary key of another table.
- ;;^DIC(1.5219,"%D",2,0)
- ;;= They represent an explicit join of the two tables. Each foreign key
- ;;^DIC(1.5219,"%D",3,0)
- ;;= element points to it's table element (SQLI_TABLE_ELEMENT),
- ;;^DIC(1.5219,"%D",4,0)
- ;;=a column in the local table (SQLI_COLUMN) and a primary key element of a
- ;;^DIC(1.5219,"%D",5,0)
- ;;= foreign table (SQLI_PRIMARY_KEY). The primary key table element of the
- ;;^DIC(1.5219,"%D",6,0)
- ;;=foreign table has the domain of that table, which makes the connection.
- ;;^DD(1.5219,0)
- ;;=FIELD^^2^3
- ;;^DD(1.5219,0,"DDA")
- ;;=N
- ;;^DD(1.5219,0,"DT")
- ;;=2960820
- ;;^DD(1.5219,0,"IX","B",1.5219,.01)
- ;;=
- ;;^DD(1.5219,0,"NM","SQLI_FOREIGN_KEY")
- ;;=
- ;;^DD(1.5219,0,"VRPK")
- ;;=DI
- ;;^DD(1.5219,.01,0)
- ;;=F_TBL_ELEMENT^RP1.5216'^DMSQ("E",^0;1^Q
- ;;^DD(1.5219,.01,.1)
- ;;=Foreign Key
- ;;^DD(1.5219,.01,1,0)
- ;;=^.1
- ;;^DD(1.5219,.01,1,1,0)
- ;;=1.5219^B
- ;;^DD(1.5219,.01,1,1,1)
- ;;=S ^DMSQ("F","B",$E(X,1,30),DA)=""
- ;;^DD(1.5219,.01,1,1,2)
- ;;=K ^DMSQ("F","B",$E(X,1,30),DA)
- ;;^DD(1.5219,.01,3)
- ;;=
- ;;^DD(1.5219,.01,9)
- ;;=^
- ;;^DD(1.5219,.01,21,0)
- ;;=^^1^1^2960926^^^^
- ;;^DD(1.5219,.01,21,1,0)
- ;;=IEN of foreign key table element in SQLI_TABLE_ELEMENT
- ;;^DD(1.5219,.01,"DT")
- ;;=2960828
- ;;^DD(1.5219,1,0)
- ;;=F_PK_ELEMENT^RP1.5218'^DMSQ("P",^0;2^Q
- ;;^DD(1.5219,1,.1)
- ;;=Primary Key
- ;;^DD(1.5219,1,9)
- ;;=^
- ;;^DD(1.5219,1,21,0)
- ;;=^^1^1^2960926^
- ;;^DD(1.5219,1,21,1,0)
- ;;=IEN of primary key element in SQLI_PRIMARY_KEY of foreign table
- ;;^DD(1.5219,1,"DT")
- ;;=2960926
- ;;^DD(1.5219,2,0)
- ;;=F_CLM_ELEMENT^RP1.5217'^DMSQ("C",^0;3^Q
- ;;^DD(1.5219,2,.1)
- ;;=Column
- ;;^DD(1.5219,2,9)
- ;;=^
- ;;^DD(1.5219,2,21,0)
- ;;=^^1^1^2960926^
- ;;^DD(1.5219,2,21,1,0)
- ;;=IEN of column of this table in SQLI_COLUMN which matches foreign PK
- ;;^DD(1.5219,2,"DT")
- ;;=2960926
- --- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HDINIT2BC 2640 printed Feb 19, 2025@00:17:59 Page 2
- DINIT2BC ;SFISC/MKO-SQLI FILES ;10:51 AM 30 Mar 1999
- +1 ;;22.2;VA FileMan;;Jan 05, 2016;Build 42
- +2 ;;Per VA Directive 6402, this routine should not be modified.
- +3 ;;Submitted to OSEHRA 5 January 2015 by the VISTA Expertise Network.
- +4 ;;Based on Medsphere Systems Corporation's MSC FileMan 1051.
- +5 ;;Licensed under the terms of the Apache License, Version 2.0.
- +6 ;
- +7 FOR I=1:2
- SET X=$TEXT(Q+I)
- if X=""
- QUIT
- SET Y=$EXTRACT($TEXT(Q+I+1),4,999)
- SET X=$EXTRACT(X,4,999)
- if $ASCII(Y)=126
- SET I=I+1
- SET Y=$EXTRACT(Y,2,999)_$EXTRACT($TEXT(Q+I+1),5,99)
- if $ASCII(Y)=61
- SET Y=$EXTRACT(Y,2,999)
- SET @X=Y
- +8 GOTO ^DINIT2BD
- Q QUIT
- +1 ;;^DIC(1.5219,0,"GL")
- +2 ;;=^DMSQ("F",
- +3 ;;^DIC("B","SQLI_FOREIGN_KEY",1.5219)
- +4 ;;=
- +5 ;;^DIC(1.5219,"%D",0)
- +6 ;;=^^6^6^2970806^^^^
- +7 ;;^DIC(1.5219,"%D",1,0)
- +8 ;;=A set of columns in a table that match the primary key of another table.
- +9 ;;^DIC(1.5219,"%D",2,0)
- +10 ;;= They represent an explicit join of the two tables. Each foreign key
- +11 ;;^DIC(1.5219,"%D",3,0)
- +12 ;;= element points to it's table element (SQLI_TABLE_ELEMENT),
- +13 ;;^DIC(1.5219,"%D",4,0)
- +14 ;;=a column in the local table (SQLI_COLUMN) and a primary key element of a
- +15 ;;^DIC(1.5219,"%D",5,0)
- +16 ;;= foreign table (SQLI_PRIMARY_KEY). The primary key table element of the
- +17 ;;^DIC(1.5219,"%D",6,0)
- +18 ;;=foreign table has the domain of that table, which makes the connection.
- +19 ;;^DD(1.5219,0)
- +20 ;;=FIELD^^2^3
- +21 ;;^DD(1.5219,0,"DDA")
- +22 ;;=N
- +23 ;;^DD(1.5219,0,"DT")
- +24 ;;=2960820
- +25 ;;^DD(1.5219,0,"IX","B",1.5219,.01)
- +26 ;;=
- +27 ;;^DD(1.5219,0,"NM","SQLI_FOREIGN_KEY")
- +28 ;;=
- +29 ;;^DD(1.5219,0,"VRPK")
- +30 ;;=DI
- +31 ;;^DD(1.5219,.01,0)
- +32 ;;=F_TBL_ELEMENT^RP1.5216'^DMSQ("E",^0;1^Q
- +33 ;;^DD(1.5219,.01,.1)
- +34 ;;=Foreign Key
- +35 ;;^DD(1.5219,.01,1,0)
- +36 ;;=^.1
- +37 ;;^DD(1.5219,.01,1,1,0)
- +38 ;;=1.5219^B
- +39 ;;^DD(1.5219,.01,1,1,1)
- +40 ;;=S ^DMSQ("F","B",$E(X,1,30),DA)=""
- +41 ;;^DD(1.5219,.01,1,1,2)
- +42 ;;=K ^DMSQ("F","B",$E(X,1,30),DA)
- +43 ;;^DD(1.5219,.01,3)
- +44 ;;=
- +45 ;;^DD(1.5219,.01,9)
- +46 ;;=^
- +47 ;;^DD(1.5219,.01,21,0)
- +48 ;;=^^1^1^2960926^^^^
- +49 ;;^DD(1.5219,.01,21,1,0)
- +50 ;;=IEN of foreign key table element in SQLI_TABLE_ELEMENT
- +51 ;;^DD(1.5219,.01,"DT")
- +52 ;;=2960828
- +53 ;;^DD(1.5219,1,0)
- +54 ;;=F_PK_ELEMENT^RP1.5218'^DMSQ("P",^0;2^Q
- +55 ;;^DD(1.5219,1,.1)
- +56 ;;=Primary Key
- +57 ;;^DD(1.5219,1,9)
- +58 ;;=^
- +59 ;;^DD(1.5219,1,21,0)
- +60 ;;=^^1^1^2960926^
- +61 ;;^DD(1.5219,1,21,1,0)
- +62 ;;=IEN of primary key element in SQLI_PRIMARY_KEY of foreign table
- +63 ;;^DD(1.5219,1,"DT")
- +64 ;;=2960926
- +65 ;;^DD(1.5219,2,0)
- +66 ;;=F_CLM_ELEMENT^RP1.5217'^DMSQ("C",^0;3^Q
- +67 ;;^DD(1.5219,2,.1)
- +68 ;;=Column
- +69 ;;^DD(1.5219,2,9)
- +70 ;;=^
- +71 ;;^DD(1.5219,2,21,0)
- +72 ;;=^^1^1^2960926^
- +73 ;;^DD(1.5219,2,21,1,0)
- +74 ;;=IEN of column of this table in SQLI_COLUMN which matches foreign PK
- +75 ;;^DD(1.5219,2,"DT")
- +76 ;;=2960926