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

XBFDINFO.m

Go to the documentation of this file.
  1. XBFDINFO(FILE,FIELD,ROOT) ; IHS/ADC/GTH - RETURN FIELD INFORMATION ; [ 02/07/97 3:02 PM ]
  1. ;;3.0;IHS/VA UTILITIES;;FEB 07, 1997
  1. ;
  1. ; ATTENTION PROGRAMMERS: Use line label FLD() for entry.
  1. ; Do not use the first line for entry.
  1. ;
  1. ; Given a file/subfile number, a field number, and an array
  1. ; root, this routine will return information about the
  1. ; specified field. The information will be returned as
  1. ; subscripted variables from the root passed by the caller.
  1. ;
  1. ; The field information returned will be a subset of the
  1. ; following:
  1. ;
  1. ; ROOT("NAME") = name of field
  1. ; ROOT("NODE") = node in data global
  1. ; ROOT("PIECE") = piece in node
  1. ; ROOT("TYPE") = FileMan field type or "M" for multiple,
  1. ; or "C" for computed
  1. ; ROOT("SFILE") = subfile number if the field is a multiple
  1. ; ROOT("PFILE") = file number of pointed to file
  1. ; ROOT("PGBL") = gbl of pointed to file
  1. ; ROOT("DINUM") = existance indicates DINUM pointer
  1. ;
  1. ; ROOT("VPFILE",file) = variable pointer prefix. 'file' is
  1. ; pointed to file
  1. ; ROOT("VPGBL",file) = variable pointer gbl of pointed to
  1. ; file. 'file' is pointed to file
  1. ;
  1. ; Formal list:
  1. ;
  1. ; 1) FILE = file/subfile number (call by value)
  1. ; 2) FIELD = field number (call by value)
  1. ; 3) ROOT = array root (call by reference)
  1. ;
  1. START ;
  1. KILL ROOT
  1. NEW W,X,Y,Z
  1. Q:FILE'=+FILE
  1. Q:FIELD'=+FIELD
  1. Q:'$D(^DD(FILE,FIELD,0)) S X=^(0)
  1. S ROOT("NAME")=$P(X,"^",1)
  1. I $P(X,"^",2)["C" S ROOT("TYPE")="C" Q
  1. S ROOT("NODE")=$S(FIELD=.001:"",1:$P($P(X,"^",4),";",1))
  1. S ROOT("PIECE")=$S(FIELD=.001:"",1:$P($P(X,"^",4),";",2))
  1. S Y=$P(X,"^",2)
  1. S ROOT("TYPE")=$S(Y["F":"F",Y["C":"C",Y["D":"D",Y["K":"K",Y["N":"N",Y["P":"P",Y["S":"S",Y["V":"V",Y["K":"K",Y["W":"W",1:"?")
  1. I +$P(X,"^",2) S ROOT("SFILE")=+$P(X,"^",2),ROOT("TYPE")="M" I 1
  1. E S:Y["P" ROOT("PFILE")=+$P(Y,"P",2),ROOT("PGBL")=$P(X,"^",3),@($S($P(X,"^",5,99)["DINUM"&(FIELD=.01):"ROOT(""DINUM"")",1:"Z"))=""
  1. I Y["V" F Z=0:0 S Z=$O(^DD(FILE,FIELD,"V","B",Z)) Q:Z'=+Z S W=$O(^(Z,"")),ROOT("VPFILE",Z)=$P(^DD(FILE,FIELD,"V",W,0),"^",4),ROOT("VPGBL",Z)=^DIC(Z,0,"GL")
  1. Q
  1. ;
  1. FLD(FILE,FIELD,ROOT) ;PEP - Return information about a field.
  1. G START
  1. ;