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

XBLFSETS.m

Go to the documentation of this file.
  1. XBLFSETS ;IHS/SET/GTH - LISTS FILE SETS ; [ 04/18/2003 9:06 AM ]
  1. ;;3.0;IHS/VA UTILITIES;**9**;FEB 07, 1997
  1. ;IHS/SET/GTH XB*3*9 10/29/2002 New Routine.
  1. ; This routine lists the following file information, useful for
  1. ; moving to a spreadsheet, or other desktop ap, for database
  1. ; Reference Terminology Modeling (RTM) activities:
  1. ; CodeSetID;Acronym;Name;Requirement;Source;Information;
  1. ; Note;DataType;MinSize;MaxSize;File #;Field #
  1. ; The output is one line of data per field, semi-colon delimited.
  1. ; Only fields of type SET are reported. Y/N fields are skipped.
  1. ; (See routine for more info.)
  1. MORE ;
  1. ; CodeSetID: This is an identifier that is used to uniquely identify
  1. ; the codeset. Some of these codeset ids are the formal
  1. ; standard identifier such as "ICD 9-CM" or "ISO 3166";
  1. ; others have been assigned an unofficial codeset id.
  1. ; Acronym: This is an abbreviated name for the codeset.
  1. ; Name: This is the name of the codeset.
  1. ; Requirement: This is an indicator that specifies the codeset is
  1. ; required by regulation. An "H" denotes that the codeset
  1. ; is required for HIPAA; an "O" denotes a requirement by
  1. ; the Office of Management and Budget (OMB).
  1. ; Source: This is the originating source of the codeset.
  1. ; Information: This is information about the codeset or the location
  1. ; of information about the codeset.
  1. ; Note: This contains notes that may assist in locating, using,
  1. ; documenting, etc., the codeset.
  1. ; DateType: This is the datatype of the codeset.
  1. ; MinSize: This is the maximum character size of the coded value.
  1. ; MaxSize: This is the minimum character size of the coded value.
  1. ;
  1. START ;
  1. ; --- Display routine description.
  1. D HOME^%ZIS,DT^DICRW
  1. KILL ^UTILITY($J)
  1. S ^UTILITY($J,"XBLFSETS")=""
  1. D EN^XBRPTL
  1. KILL ^UTILITY($J)
  1. ; --- Get file(s).
  1. D ^XBDSET
  1. Q:'$D(^UTILITY("XBDSET",$J))
  1. S XBIHS=$$DIR^XBDIR("N^500:999:0","Enter the beginning CodeSet ID number",500,"The response must be a number")
  1. Q:Y="^"
  1. ; --- Select device.
  1. W !
  1. S %ZIS="Q",ZTSAVE("^UTILITY(""XBDSET"",$J,")="",ZTSAVE("XBIHS")=""
  1. D EN^XUTMDEVQ("EN^XBLFSETS","List File Sets",.ZTSAVE,.%ZIS)
  1. D EN^XBVK("ZT")
  1. Q
  1. ;
  1. EN ;EP - from TaskMan.
  1. VARS ;;F,N,X,W;Single-char work vars.
  1. ; F:File #
  1. NEW XBQFLG,@($P($T(VARS),";",3))
  1. S (XBQFLG,F)=0
  1. F S F=$O(^UTILITY("XBDSET",$J,F)) Q:F'=+F D PAGE Q:XBQFLG D FIELDS(F) Q:XBQFLG
  1. D ^%ZISC
  1. Q
  1. ;
  1. FIELDS(F) ; Process fields in File F.
  1. NEW X,XB
  1. S XB=0
  1. F S XB=$O(^DD(F,XB)) Q:'(XB=+XB) D D:$Y>(IOSL-3) PAGE Q:XBQFLG
  1. . I $E($P($G(^DD(F,XB,0)),"^",1))="*" Q ; field is deprecated.
  1. . I $P(^DD(F,XB,0),"^",2) D FIELDS($P(^(0),"^",2)) Q ; Recurse sub-file.
  1. . S X=$$TYPE($P($G(^DD(F,XB,0)),"^",2))
  1. . I X'="SET" Q ; Process only SETs.
  1. . I $P($$FINFO(F,XB),"<",2)="1:YES|0:NO|>" Q ; Skip Y/N fields.
  1. . ; CodeSetID;Acronym;Name;Requirement;Source
  1. . S XBIHS=XBIHS+1
  1. . W "IHS"_$J(XBIHS,3,0)_";;"_$P($G(^DD(F,XB,0)),"^",1)_";;;"
  1. . ; Information;Note;DataType;MinSize;MaxSize;File #;Field #
  1. . W $$DESC(F,XB)_";"_$$FINFO(F,XB)_";"_$$TYPE($P($G(^DD(F,XB,0)),"^",2))_";;;"_F_";"_XB_";"
  1. . W !
  1. . Q
  1. Q
  1. ;
  1. DESC(N,F) ; Field DESCRIPTION and Help-Prompt. N=File, F=Field
  1. NEW X,XB
  1. S X=""
  1. S X="File Number "_N_", '"_$$FNAME^XBFUNC(N)_"', Field # "_F_", In Global "_$$FGLOB^XBFUNC(N)_", DESCRIPTION <"
  1. F XB=0:0 S XB=$O(^DD(N,F,21,XB)) Q:'XB S X=X_$G(^(XB,0))
  1. S X=X_"> HELP-PROMPT <"_$G(^DD(N,F,3))_">"
  1. Q X
  1. ;
  1. TYPE(P) ; Return TYPE of field. Input is the 2nd piece of the 0th node.
  1. NEW W
  1. F W="BOOLEAN","COMPUTED","FREE TEXT","SET","DATE","NUMBER","POINTER","K","Z" I P[$E(W) Q
  1. Q $S(W'="Z":W,1:"?")
  1. ;
  1. FINFO(N,F) ; Return SET values, or Pointed-To. N=File, F=Field
  1. NEW T
  1. S T=$$TYPE($P(^DD(N,F,0),"^",2))
  1. I T="SET" Q "Values <"_$TR($P($G(^DD(N,F,0)),"^",3),";","|")_">"
  1. I T="POINTER" Q " Points to "_$$FNAME^XBFUNC(+$P($P(^DD(N,F,0),"^",2),"P",2))_" file"
  1. Q "?"
  1. ;
  1. PAGE ; PAGE BREAK
  1. NEW F,G,N,X
  1. I IO=IO(0),$E(IOST,1,2)="C-" S XBQFLG='$$DIR^XBDIR("E") I 'XBQFLG W @IOF
  1. Q
  1. ;