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

XINDX11.m

Go to the documentation of this file.
  1. XINDX11 ;ISC/GRK - Create phantom routines for functions, options, etc. ;07/08/98 15:06
  1. ;;7.3;TOOLKIT;**20,27,121,132,140,148**;Apr 25, 1995;Build 3
  1. ; Per VHA Directive 2004-038, this routine should not be modified.
  1. G:INP(10)=9.7 RTN
  1. N INDSTAT ;p148 tracks if status message was displayed
  1. G:INP(10)=9.4 PKG
  1. BUILD ; Process Build File
  1. N KRN,BLDFIL,BLDDEL
  1. S BLDDEL=U
  1. S BLDFIL=.5,INDFN="^DD(""FUNC"",",INDRN="|func",INDD="Function",INDSB="FUNC",INDXN="Build file",INDSTAT=0 D BLDITEM
  1. S BLDFIL=19,INDFN="^DIC(19,",INDRN="|opt",INDD="Option",INDSB="OPT",INDXN="Build file",INDSTAT=0 D BLDITEM
  1. S BLDDEL=" "
  1. S BLDFIL=.401,INDFN="^DIBT(",INDRN="|sort",INDD="Sort Template",INDSB="SORT^XINDX12",INDXN="Build file",INDSTAT=0 D BLDITEM
  1. S BLDFIL=.402,INDFN="^DIE(",INDRN="|inpt",INDD="Input Template",INDSB="INPUT^XINDX12",INDXN="Build file",INDSTAT=0 D BLDITEM
  1. S BLDFIL=.4,INDFN="^DIPT(",INDRN="|prnt",INDD="Print Template",INDSB="PRINT^XINDX12",INDXN="Build file",INDSTAT=0 D BLDITEM
  1. S BLDFIL=.403,INDFN="^DIST(.403,",INDRN="|form",INDD="Form",INDSB="FORM^XINDX12",INDXN="Build file",INDSTAT=0 D BLDITEM
  1. S BLDDEL=U
  1. S BLDFIL=.84,INDFN="^DI(.84,",INDRN="|dlg",INDD="Dialog",INDSB="DIALOG^XINDX12",INDXN="Build file",INDSTAT=0 D BLDITEM
  1. S BLDFIL=9.2,INDFN="^DIC(9.2,",INDRN="|help",INDD="Help Frame",INDSB="HELP^XINDX12",INDXN="Build file",INDSTAT=0 D BLDITEM
  1. S BLDFIL=19.1,INDFN="^DIC(19.1,",INDRN="|key",INDD="Security Key",INDSB="KEY^XINDX12",INDXN="Build file",INDSTAT=0 D BLDITEM
  1. S BLDFIL=409.61,INDFN="^SD(409.61,",INDRN="|list",INDD="List Template",INDSB="LIST^XINDX12",INDXN="Build file",INDSTAT=0 D BLDITEM
  1. S BLDFIL=101,INDFN="^ORD(101,",INDRN="|ptcl",INDD="Protocol",INDSB="PROTOCOL^XINDX12",INDXN="Build file",INDSTAT=0 D BLDITEM
  1. S BLDFIL=771,INDFN="^HL(771,",INDRN="|hlap",INDD="HL7 Application Parameter",INDSB="HL7AP^XINDX12",INDXN="Build file",INDSTAT=0 D BLDITEM
  1. S BLDFIL=8994,INDFN="^XWB(8994,",INDRN="|rpc",INDD="Remote Procedure",INDSB="RPC^XINDX12",INDXN="Build file",INDSTAT=0 D BLDITEM
  1. RTN ;Routines
  1. D RTN^XTRUTL1(INDDA,INP(10))
  1. Q
  1. ;
  1. BLDITEM ; Process Each Build item in build file
  1. D HDR
  1. F KRN=0:0 S KRN=$O(^XPD(9.6,INDDA,"KRN",BLDFIL,"NM",KRN)) Q:KRN'>0 S (INDL,INDXN)=$P(^(KRN,0),BLDDEL) D STAT:'INDSTAT,ENTRY
  1. I INDLC=2 K ^UTILITY($J,INDRN),^UTILITY($J,1,INDRN) ;patch 121
  1. QUIT
  1. ;
  1. PKG D NAMSP ;Package file
  1. S INDFN="^DD(""FUNC"",",INDRN="|func",INDD="Function",INDSB="FUNC",INDSTAT=0 D NAME
  1. S INDFN="^DIC(19,",INDRN="|opt",INDD="Option",INDSB="OPT",INDSTAT=0 D NAME
  1. S INDFN="^DIBT(",INDRN="|sort",INDD="Sort Template",INDSB="SORT^XINDX12",INDSTAT=0 D NAME
  1. S INDFN="^DIE(",INDRN="|inpt",INDD="Input Template",INDSB="INPUT^XINDX12",INDSTAT=0 D NAME
  1. S INDFN="^DIPT(",INDRN="|prnt",INDD="Print Template",INDSB="PRINT^XINDX12",INDSTAT=0 D NAME
  1. S INDFN="^DIST(.403,",INDRN="|form",INDD="Form",INDSB="FORM^XINDX12",INDSTAT=0 D NAME
  1. S INDFN="^DI(.84,",INDRN="|dlg",INDD="Dialog",INDSB="DIALOG^XINDX12",INDSTAT=0 D NAME
  1. S INDFN="^DIC(9.2,",INDRN="|help",INDD="Help Frame",INDSB="HELP^XINDX12",INDSTAT=0 D NAME
  1. S INDFN="^DIC(19.1,",INDRN="|key",INDD="Security Key",INDSB="KEY^XINDX12",INDSTAT=0 D NAME
  1. S INDFN="^SD(409.61,",INDRN="|list",INDD="List Template",INDSB="LIST^XINDX12",INDSTAT=0 D NAME
  1. S INDFN="^ORD(101,",INDRN="|ptcl",INDD="Protocol",INDSB="PROTOCOL^XINDX12",INDSTAT=0 D NAME
  1. S INDFN="^HL(771,",INDRN="|hlap",INDD="HL7 Application Parameter",INDSB="HL7AP^XINDX12",INDSTAT=0 D NAME
  1. S INDFN="^XWB(8994,",INDRN="|rpc",INDD="Remote Procedure",INDSB="RPC^XINDX12",INDSTAT=0 D NAME
  1. Q
  1. ;
  1. NAME ; Index based on Package file #9.4
  1. Q:'$D(@(INDFN_"""B"")")) ; Don't run if there isn't a B cross reference
  1. D HDR ; Add Header in the style of |{component} ; '{Namespace}' {Filename as defined above}s. With a comment line below.
  1. S INDL=$E(INDXN,1,$L(INDXN)-1)_$C($A(INDXN,$L(INDXN))-1)_"z" ; get the last letter of the prefix and get the previous letter (B=A), then append "z" to the end
  1. F A=0:0 S INDL=$O(@(INDFN_"""B"",INDL)")) Q:$P(INDL,INDXN,1)]""!(INDL="") D ; Order through the B index of the given file. If it nolonger matches the prefix or we hit the end of the B index quit
  1. . F B=0:0 S B=$O(@(INDFN_"""B"",INDL,B)")) Q:B="" D ; For each IEN in the B index
  1. .. X INDF ; Make sure it isn't an excluded namespace
  1. .. D:C8 STAT:'INDSTAT,@INDSB ; If it isn't an excluded namesapce cross reference it
  1. I INDLC=2 K ^UTILITY($J,INDRN),^UTILITY($J,1,INDRN) Q ; If there is only a header delete the faux routine
  1. S ^UTILITY($J,1,INDRN,0,0)=INDLC ; set the number of lines in the routine where the output will find it
  1. Q
  1. NAMSP ; Setup processing for Indexing based on package file
  1. S INDXN=$P(^DIC(9.4,DA,0),"^",2) ; PREFIX (#1) from Package File
  1. S C9=0 ; Subscript for INDXN
  1. S INDXN(C9)="," ; 0th subscript is always ","
  1. F A=0:0 S A=$O(^DIC(9.4,DA,"EX",A)) Q:A'>0 D ; For each excluded name space in the package file
  1. . I $D(^(A,0))#2 D ; If there is an excluded namespace value
  1. .. S C9=C9+1 ; increment the counter
  1. .. S INDXN(C9)=$P(^(0),"^") ; set INDXN(COUNTER)=excluded namespace
  1. S INDF="S C8=1 F H=1:1:C9 I $P(INDL,INDXN(H))="""" S C8=0 Q" ; Checks excluded namespaces
  1. Q
  1. STAT ;write status ;p148
  1. S INDSTAT=1
  1. W !,"Processing ",INDD,"s",!
  1. Q
  1. HDR S INDLC=0,INDC=INDRN_" ; '"_INDXN_"' "_INDD_"s.",INDX=";" D ADD S ^UTILITY($J,INDRN)="",^UTILITY($J,1,INDRN,0,0)=0
  1. Q
  1. ENTRY F B=0:0 S B=$O(@(INDFN_"""B"",INDXN,B)")) Q:B="" D @INDSB
  1. S ^UTILITY($J,1,INDRN,0,0)=INDLC
  1. Q
  1. FUNC ;Process Function file entry
  1. Q:'($D(^DD("FUNC",B,0))#2) S INDC=B_" ; "_$P(^(0),"^",1)_" - "_$S($D(^(9))#2:$E(^(9),1,190),1:""),INDX=$S($D(^(1))#2:^(1),1:";") D ADD
  1. Q
  1. OPT ;Process option file entry for MUMPS code
  1. Q:'$D(^DIC(19,B,0)) S T=$P(^(0),"^",4),INDC=B_" ; "_$P(^(0),"^",1)_" - "_$P(^(0),"^",2)_" ("_$P($P($P(^DD(19,4,0),"^",3),T_":",2),";",1)_")"_$S($P(^DIC(19,B,0),"^",6)]"":" - Locked by "_$P(^(0),"^",6),1:""),INDX="" D ADD
  1. S INDN="15,20,26,"_$S(T="E":"34,35,54",T="I":"34,35",T="P":"69,69.1,69.2,69.3,71,72,73",T="R":25,1:"") D OPTC:INDN
  1. Q
  1. OPTC F J=1:1 S H=$P(INDN,",",J) Q:H="" I $D(^DIC(19,B,H))#2 D
  1. . S %=^(H),INDX=$S(H'=25:%,1:"D "_$E("^",%'["^")_$P(%,"[")),INDC=" ; "_$P(^DD(19,H,0),"^",1) D ADD
  1. Q
  1. ADD ;Put code in UTILITY for processing
  1. S INDLC=INDLC+1,^UTILITY($J,1,INDRN,0,INDLC,0)=INDC I INDX]"" S INDLC=INDLC+1,^UTILITY($J,1,INDRN,0,INDLC,0)=" "_INDX
  1. Q
  1. ADDLN ;
  1. S INDLC=INDLC+1,^UTILITY($J,1,INDRN,0,INDLC,0)=" "_INDX
  1. Q