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

XBFORM0.m

Go to the documentation of this file.
  1. XBFORM0 ; IHS/ADC/GTH - Documentation for XBFORM ; [ 02/07/97 3:02 PM ]
  1. ;;3.0;IHS/VA UTILITIES;;FEB 07, 1997
  1. ;
  1. ; This utility provides a word processing format of free
  1. ; text and local variable references to build an array.
  1. ;
  1. ; A file is necessary that has a .01 field for the form name
  1. ; and a WP field to hold the WP form.
  1. ;
  1. ; Two Entry points
  1. ;
  1. ; EDIT^XBFORM(NAME,DIC,FIELD) Edits and Displays the form.
  1. ; Place the call to EDIT in the code where the data or
  1. ; variables have been gathered. Typically this is one line
  1. ; previous to the call to $$GEN^XBFORM. Once the form is
  1. ; designed the EDIT call is commented out.
  1. ;
  1. ; $$GEN^XBFORM(NAME,DIC,FIELD,%Y,FORMAT,OFFSET)
  1. ; Generates the form into the root array indicated by %Y.
  1. ; The call to $$GEN must have all variables used gathered.
  1. ; The return value of $$GEN is equal to the last line set
  1. ; in the array.
  1. ;
  1. ; INPUT VARIABLES
  1. ; NAME The name space variable that holds the name of
  1. ; the form to be used.
  1. ;
  1. ; DIC The root or file number of the file holding the
  1. ; forms.
  1. ;
  1. ; FIELD The field number of the WP field holding the form.
  1. ;
  1. ; %Y The root of the target array to be built. Either
  1. ; a global or a variable root as in the format used
  1. ; for a %XY^%RCR call. (%RCR is actually used)
  1. ;
  1. ; FORMAT null or zero The array is built %Y(line)="...
  1. ; 1 The array is built %Y(line,0)="....
  1. ;
  1. ; OFFSET The offset in line numbers in building the array.
  1. ; The array will start construction at OFFSET+1.
  1. ; The value of the last line created is returned
  1. ; $$GEN.
  1. ;
  1. ; WP FORMAT INSTRUCTIONS
  1. ;
  1. ; Free Text: Free text is key striked in where desired.
  1. ; Do not use | as it is used to mark variables.
  1. ;
  1. ; Variables: The reference to a variable is marked with
  1. ; a beginning | and a trailing |. The trailing
  1. ; | is always required even if the variable is
  1. ; last item on the line.
  1. ;
  1. ; To use a "|" in your display use "||" in the
  1. ; form.
  1. ;
  1. ; Mnemonics Comments - A short hand for variables is
  1. ; available. Programmers comments can be put into the
  1. ; form which are ignored by the generator.
  1. ;
  1. ; Output Transform - Mumps output transforms can be
  1. ; indicated for execution upon selected variables.
  1. ;
  1. ; WP SPECIAL FUNCTIONS Located at the top of the form.
  1. ;
  1. ; Comment line Begin the line with a ';'
  1. ;
  1. ; Variable Mneumonic - Reference Name spaced variables can
  1. ; be long. A mnemonic reference is available to make
  1. ; life simple. Multiple mnemonic lines can be used
  1. ; if desired.
  1. ;
  1. ;
  1. ; SETUP
  1. ;
  1. ; #mneum1=variable1|mneum2=variable2*...
  1. ; #mneumZ=variableZ|.....
  1. ;
  1. ; Example:
  1. ; #D=DUZ | V =BARVPT
  1. ; #I=BARIPT
  1. ;
  1. ; (BARIPT array is storing IHS Patient Information)
  1. ; (BARVPT array is storing VA Patient Information)
  1. ;
  1. ;
  1. ; '#' Marker placed in the first column
  1. ;
  1. ; mnemonic1 User's choice
  1. ; ex: D to denote DUZ
  1. ; '=' EQUALS
  1. ;
  1. ; variable1 User's choice of the local variable
  1. ; ex: DUZ
  1. ; '|' Repeat seperator if more than one
  1. ; mnemonic is indicated on a line
  1. ;
  1. ; USE The mnemonic reference can be used
  1. ; any where in the WP form.
  1. ; Format ~mnemonic|variable subscript~
  1. ;
  1. ; '|' Beginning marker for the variable
  1. ;
  1. ; mnemonic1 User's mnemonic
  1. ;
  1. ; '@' Mneumonic dubstitution marker
  1. ;
  1. ; subscript The subscript of the variable to be
  1. ; used.
  1. ;
  1. ; '|' Ending marker for the variable
  1. ;
  1. ; ex: |D@| for DUZ
  1. ; |D@0| for DUZ(0)
  1. ; |I@.01| for BARIPT(.01)
  1. ;
  1. ; MUMPS OUTPUT TRANSFORM - A simple mumps output
  1. ; transform is also provided to aid in form design. A
  1. ; variable or mnemonic indicated will have its output
  1. ; transformed prior to being put into the form.
  1. ;
  1. ; SETUP
  1. ;
  1. ; *var1:mumps code1|var2:mumps code2
  1. ; *mnemonic3:mumps code3|mnemonic4:mumps code4
  1. ;
  1. ; Ex: *DUZ(2):$J(X,10,2) will output $J(DUZ(2),10,2)
  1. ; *D@2! :$J(X,10,2) mnemonic notation of same
  1. ;
  1. ; '*' Output Transform marker in column one. Near TOF
  1. ;
  1. ; Variable/ Variable or mnemonic as it would appear in the
  1. ; Mneumonic form between '~'s.
  1. ;
  1. ; ':' Separator
  1. ;
  1. ; mumps code Mumps code expression as a function of x.
  1. ; Do not state 'S X=f(x)'
  1. ; Enter the function only, f(x).
  1. ;
  1. ; '|' Repeat Separator if more than one is put
  1. ; on one line.
  1. ;
  1. ; SPECIAL OUTPUT TRANSFORMS provided by XBFORM
  1. ;
  1. ; $$MDY(X)
  1. ; *xxx:$$MDY(X) a literal |"NOW"| or variable |IT@9|
  1. ; ex: *"NOW":$$MDY(X) or *IT@9:$$MDY(X)
  1. ; returns mm/dd/yy
  1. ;
  1. ; $$WP("X")
  1. ; *xxx:$$WP("X") for a word processing field array |xxx|
  1. ;
  1. ; NOTE: "X" IS ABSOLUTELY NECESSARY
  1. ; The variable array must have the form
  1. ; xxx(n) where n = 1:1
  1. ; xxx may be B@101 as if returned by
  1. ; XBDIQ1 in the node 101 of B@
  1. ; EX:
  1. ; *B@:$$WP("X") |B@| for B=BARWP with BARWP(n) defined
  1. ; *B@101:$$WP("X") |B@101| for B=BARWP with BARWP(101,n) defined
  1. ;
  1. ; $$FL(X)
  1. ; *19:$$FL(X) |19| in form: fill lines through 19
  1. ;
  1. ; ;D10
  1. ; *xxx:;D10 Performs $J(xxx,10,2)
  1. ;
  1. ; ;R20
  1. ; *xxx:;R20 Performs $J(xxx,20)
  1. ;
  1. ; ;L15
  1. ; *xxx:;L15 Performs $E(xxx,1,15)
  1. ;
  1. Q
  1. TEST ;;
  1. ;** set up variables
  1. D ENP^XBDIQ1(200,DUZ,".01:.116","XBFU(")
  1. I '$D(XBFFORM) S XBFFORM="JAN"
  1. D EDIT^XBFORM(XBFFORM,90053.01,1000)
  1. KILL XBFFM
  1. S Y=$$GEN^XBFORM(XBFFORM,90053.01,1000,"XBFFM(",0,0)
  1. Q
  1. TESTE ;;END
  1. PRT ;
  1. D ^%ZIS
  1. U IO W !
  1. F I=1:1 Q:'$D(XBFFM(I)) U IO W XBFFM(I),!
  1. U IO W #
  1. D ^%ZISC
  1. Q