XBARRAY0 ; IHS/ADC/GTH - Documentation for XBARRAY ; [ 02/07/97 3:02 PM ]
;;3.0;IHS/VA UTILITIES;;FEB 07, 1997
;
; This utility provides a word processing format of free
; text and local variable references to build an array.
;
; A file is necessary that has a .01 field for the form
; name and a WP field to hold the WP form.
;
; Two Entry points
;
; EDIT^XBARRAY(.NAME,DIC,FIELD) Edits and Displays the
; form. Place the call to EDIT in the code where
; the data or variables have been gathered.
; Typically this is one line previous to the call
; to $$GEN^XBARRAY. Once the form is designed the
; EDIT call is commented out.
;
; $$GEN^XBARRAY(.NAME,DIC,FIELD,ROOT,FORMAT,LINE)
; Generates the form into the ARRAY indicated by
; the ROOT. The call to $$GEN must have all
; variables used gathered. The return value of
; $$GEN is equal to the last line set in the array.
;
; VARIABLES
; .NAME - The name space variable that holds the name
; of the form to be used. A pass by reference is
; needed for efficiency so that the pre-compilation of
; the form is held for repetitive use. The compilation
; is stored in the sub array as NAME(@NAME,line,.....,).
; IE one local variable can be used for all form
; references.
; Ex: S BARFORM="A/R BILL" will store and use
; the form compilation in BARFORM("A/R BILL",line,....,)
; When finished KILL BARFORM(BARFORM) will retrieve the
; local variable space from the last form used.
;
; DIC - The root or file number of the file holding the
; forms.
;
; FIELD ; The field number of the WP field holding the
; form.
;
; ROOT - The root of the target array to be built.
; Either a global or a variable root as in the format
; used for a %XY^%RCR call. (%RCR is actually used)
;
; FORMAT
; null or zero The array is built ROOT(line)="...
; 1 The array is built ROOT(line,0)="....
;
; LINE - The offset in line numbers in building the
; array. The array will start construction at LINE +1.
; The value of the last line created is returned $$GEN.
;
; WP FORMAT INSTRUCTIONS
;
; Free Text: Free text is key striked in where desired.
; Do not use ~ as it is used to mark variables.
;
; Variables: The reference to a variable is marked with
; a beginning ~ and a trailing ~. The trailing ~ is
; always required even if the variable is last item
; on the line.
;
; Mnemonics: A short hand for variables is available.
;
; Comments: Programmers comments can be put into the form
; which are ignored by the generator.
;
; Output Transform: Mumps output transforms can be
; indicated for execution upon selected variables.
;
; WP SPECIAL FUNCTIONS Located at the top of the form.
;
; Comment line Begin the line with a ';'
;
; Variable Mneumonic Reference: Name spaced variables can
; be long. A mnemonic reference is available to make
; life simple. Multiple mnemonic lines can be used
; if desired.
;
; SETUP
;
; #mnemonic1|variable1*mnemonic2|variable2*...
; #mnemonicZ|variableZ*.....
;
; Example: #D|DUZ*V|BARVPT
; #I|BARIPT
;
; (BARIPT array is storing IHS Patient Information)
; (BARVPT array is storing VA Patient Information)
;
;
; '#' Marker placed in the first column
;
; mnemonic1 User's choice
; ex: D to denote DUZ
; '|' Separator
;
; variable1 User's choice of the local variable
; ex: DUZ
; '*' Repetative marker if more than one
; mnemonic is indicated
;
; USE The mnemonic reference can be used any where
; in the WP form.
;
; Format ~mnemonic|variable subscript~
;
; '~' Beginning marker for the variable
;
; mnemonic1 User's mnemonic
;
; '|' Separator
;
; subscript The subscript of the variable to be used
;
; '~' Ending marker for the variable
;
; ex: ~D|~ for DUZ
; ~D|0~ for DUZ(0)
; ~I|.01~ for BARIPT(.01)
;
; MUMPS OUTPUT TRANSFORM
; A simple mumps output transform is also provided to aid
; in form design. A variable or mnemonic indicated will
; have its output transformed prior to being put into the
; form.
;
; SETUP
;
; *var1!mumps code1*var2!mumps code2
; *mnemonic3!mumps code3*mnemonic4!mumps code4
;
; Ex: *DUZ(2)!$J(X,10,2) will output $J(DUZ(2),10,2)
; *D | 2!$J(X,10,2) mnemonic notation of same
;
; '*' Output Transform marker in column one. At TOF
;
; Variable/ Variable or mnemonic as it would appear in the
; Mneumonic form between '~'s.
;
; '!' Separator
;
; mumps code Mumps code expression as a function of x.
; Do not state 'S X=f(x)'
; Enter the function only, f(x).
;
; '*' Separator if more than one is put on one line.
;
; SPECIAL OUTPUT TRANSFORMS provided by XBARRAY
;
; xxx!$$MDY(X) a literal ~"NOW"~ or variable ~IT|9~
; ex: *"NOW"!$$MDY(X) or *IT|9!$$MDY(X)
; returns mm/dd/yy
;
; xxx!$$WP("X") for a word processing field
; NOTE: "X" IS ABSOLUTELY NECESSARY
; The variable array must have the form
; VAR(subcript,n) where n = 1:1
;
DOCE ;
;
TEST ; If you have A/R installed, uncomment the following lines for a
; demonstration.
; D INIT^BARUTL
; D ENP^XBDIQ1(200,DUZ,".01:.116","BARU(")
; S BARFORM="PW TEST"
; D EDIT^XBARRAY(.BARFORM,90053.01,1000)
; S Y=$$GEN^XBARRAY(.BARFORM,90053.01,1000,"BARFM",0,10)
; KILL BARFORM(BARFORM)
; Q
;
XBARRAY0 ; IHS/ADC/GTH - Documentation for XBARRAY ; [ 02/07/97 3:02 PM ]
+1 ;;3.0;IHS/VA UTILITIES;;FEB 07, 1997
+2 ;
+3 ; This utility provides a word processing format of free
+4 ; text and local variable references to build an array.
+5 ;
+6 ; A file is necessary that has a .01 field for the form
+7 ; name and a WP field to hold the WP form.
+8 ;
+9 ; Two Entry points
+10 ;
+11 ; EDIT^XBARRAY(.NAME,DIC,FIELD) Edits and Displays the
+12 ; form. Place the call to EDIT in the code where
+13 ; the data or variables have been gathered.
+14 ; Typically this is one line previous to the call
+15 ; to $$GEN^XBARRAY. Once the form is designed the
+16 ; EDIT call is commented out.
+17 ;
+18 ; $$GEN^XBARRAY(.NAME,DIC,FIELD,ROOT,FORMAT,LINE)
+19 ; Generates the form into the ARRAY indicated by
+20 ; the ROOT. The call to $$GEN must have all
+21 ; variables used gathered. The return value of
+22 ; $$GEN is equal to the last line set in the array.
+23 ;
+24 ; VARIABLES
+25 ; .NAME - The name space variable that holds the name
+26 ; of the form to be used. A pass by reference is
+27 ; needed for efficiency so that the pre-compilation of
+28 ; the form is held for repetitive use. The compilation
+29 ; is stored in the sub array as NAME(@NAME,line,.....,).
+30 ; IE one local variable can be used for all form
+31 ; references.
+32 ; Ex: S BARFORM="A/R BILL" will store and use
+33 ; the form compilation in BARFORM("A/R BILL",line,....,)
+34 ; When finished KILL BARFORM(BARFORM) will retrieve the
+35 ; local variable space from the last form used.
+36 ;
+37 ; DIC - The root or file number of the file holding the
+38 ; forms.
+39 ;
+40 ; FIELD ; The field number of the WP field holding the
+41 ; form.
+42 ;
+43 ; ROOT - The root of the target array to be built.
+44 ; Either a global or a variable root as in the format
+45 ; used for a %XY^%RCR call. (%RCR is actually used)
+46 ;
+47 ; FORMAT
+48 ; null or zero The array is built ROOT(line)="...
+49 ; 1 The array is built ROOT(line,0)="....
+50 ;
+51 ; LINE - The offset in line numbers in building the
+52 ; array. The array will start construction at LINE +1.
+53 ; The value of the last line created is returned $$GEN.
+54 ;
+55 ; WP FORMAT INSTRUCTIONS
+56 ;
+57 ; Free Text: Free text is key striked in where desired.
+58 ; Do not use ~ as it is used to mark variables.
+59 ;
+60 ; Variables: The reference to a variable is marked with
+61 ; a beginning ~ and a trailing ~. The trailing ~ is
+62 ; always required even if the variable is last item
+63 ; on the line.
+64 ;
+65 ; Mnemonics: A short hand for variables is available.
+66 ;
+67 ; Comments: Programmers comments can be put into the form
+68 ; which are ignored by the generator.
+69 ;
+70 ; Output Transform: Mumps output transforms can be
+71 ; indicated for execution upon selected variables.
+72 ;
+73 ; WP SPECIAL FUNCTIONS Located at the top of the form.
+74 ;
+75 ; Comment line Begin the line with a ';'
+76 ;
+77 ; Variable Mneumonic Reference: Name spaced variables can
+78 ; be long. A mnemonic reference is available to make
+79 ; life simple. Multiple mnemonic lines can be used
+80 ; if desired.
+81 ;
+82 ; SETUP
+83 ;
+84 ; #mnemonic1|variable1*mnemonic2|variable2*...
+85 ; #mnemonicZ|variableZ*.....
+86 ;
+87 ; Example: #D|DUZ*V|BARVPT
+88 ; #I|BARIPT
+89 ;
+90 ; (BARIPT array is storing IHS Patient Information)
+91 ; (BARVPT array is storing VA Patient Information)
+92 ;
+93 ;
+94 ; '#' Marker placed in the first column
+95 ;
+96 ; mnemonic1 User's choice
+97 ; ex: D to denote DUZ
+98 ; '|' Separator
+99 ;
+100 ; variable1 User's choice of the local variable
+101 ; ex: DUZ
+102 ; '*' Repetative marker if more than one
+103 ; mnemonic is indicated
+104 ;
+105 ; USE The mnemonic reference can be used any where
+106 ; in the WP form.
+107 ;
+108 ; Format ~mnemonic|variable subscript~
+109 ;
+110 ; '~' Beginning marker for the variable
+111 ;
+112 ; mnemonic1 User's mnemonic
+113 ;
+114 ; '|' Separator
+115 ;
+116 ; subscript The subscript of the variable to be used
+117 ;
+118 ; '~' Ending marker for the variable
+119 ;
+120 ; ex: ~D|~ for DUZ
+121 ; ~D|0~ for DUZ(0)
+122 ; ~I|.01~ for BARIPT(.01)
+123 ;
+124 ; MUMPS OUTPUT TRANSFORM
+125 ; A simple mumps output transform is also provided to aid
+126 ; in form design. A variable or mnemonic indicated will
+127 ; have its output transformed prior to being put into the
+128 ; form.
+129 ;
+130 ; SETUP
+131 ;
+132 ; *var1!mumps code1*var2!mumps code2
+133 ; *mnemonic3!mumps code3*mnemonic4!mumps code4
+134 ;
+135 ; Ex: *DUZ(2)!$J(X,10,2) will output $J(DUZ(2),10,2)
+136 ; *D | 2!$J(X,10,2) mnemonic notation of same
+137 ;
+138 ; '*' Output Transform marker in column one. At TOF
+139 ;
+140 ; Variable/ Variable or mnemonic as it would appear in the
+141 ; Mneumonic form between '~'s.
+142 ;
+143 ; '!' Separator
+144 ;
+145 ; mumps code Mumps code expression as a function of x.
+146 ; Do not state 'S X=f(x)'
+147 ; Enter the function only, f(x).
+148 ;
+149 ; '*' Separator if more than one is put on one line.
+150 ;
+151 ; SPECIAL OUTPUT TRANSFORMS provided by XBARRAY
+152 ;
+153 ; xxx!$$MDY(X) a literal ~"NOW"~ or variable ~IT|9~
+154 ; ex: *"NOW"!$$MDY(X) or *IT|9!$$MDY(X)
+155 ; returns mm/dd/yy
+156 ;
+157 ; xxx!$$WP("X") for a word processing field
+158 ; NOTE: "X" IS ABSOLUTELY NECESSARY
+159 ; The variable array must have the form
+160 ; VAR(subcript,n) where n = 1:1
+161 ;
DOCE ;
+1 ;
TEST ; If you have A/R installed, uncomment the following lines for a
+1 ; demonstration.
+2 ; D INIT^BARUTL
+3 ; D ENP^XBDIQ1(200,DUZ,".01:.116","BARU(")
+4 ; S BARFORM="PW TEST"
+5 ; D EDIT^XBARRAY(.BARFORM,90053.01,1000)
+6 ; S Y=$$GEN^XBARRAY(.BARFORM,90053.01,1000,"BARFM",0,10)
+7 ; KILL BARFORM(BARFORM)
+8 ; Q
+9 ;