source: IHS-VA_UTILITIES-XB/trunk/XBFORM0.m@ 642

Last change on this file since 642 was 642, checked in by Sam Habiel, 14 years ago

Modified directory structure; moved routines.

File size: 6.2 KB
Line 
1XBFORM0 ; IHS/ADC/GTH - Documentation for XBFORM ; [ 02/07/97 3:02 PM ]
2 ;;4.0;XB;;Jul 20, 2009;Build 2
3 ;
4 ; This utility provides a word processing format of free
5 ; text and local variable references to build an array.
6 ;
7 ; A file is necessary that has a .01 field for the form name
8 ; and a WP field to hold the WP form.
9 ;
10 ; Two Entry points
11 ;
12 ; EDIT^XBFORM(NAME,DIC,FIELD) Edits and Displays the form.
13 ; Place the call to EDIT in the code where the data or
14 ; variables have been gathered. Typically this is one line
15 ; previous to the call to $$GEN^XBFORM. Once the form is
16 ; designed the EDIT call is commented out.
17 ;
18 ; $$GEN^XBFORM(NAME,DIC,FIELD,%Y,FORMAT,OFFSET)
19 ; Generates the form into the root array indicated by %Y.
20 ; The call to $$GEN must have all variables used gathered.
21 ; The return value of $$GEN is equal to the last line set
22 ; in the array.
23 ;
24 ; INPUT VARIABLES
25 ; NAME The name space variable that holds the name of
26 ; the form to be used.
27 ;
28 ; DIC The root or file number of the file holding the
29 ; forms.
30 ;
31 ; FIELD The field number of the WP field holding the form.
32 ;
33 ; %Y The root of the target array to be built. Either
34 ; a global or a variable root as in the format used
35 ; for a %XY^%RCR call. (%RCR is actually used)
36 ;
37 ; FORMAT null or zero The array is built %Y(line)="...
38 ; 1 The array is built %Y(line,0)="....
39 ;
40 ; OFFSET The offset in line numbers in building the array.
41 ; The array will start construction at OFFSET+1.
42 ; The value of the last line created is returned
43 ; $$GEN.
44 ;
45 ; WP FORMAT INSTRUCTIONS
46 ;
47 ; Free Text: Free text is key striked in where desired.
48 ; Do not use | as it is used to mark variables.
49 ;
50 ; Variables: The reference to a variable is marked with
51 ; a beginning | and a trailing |. The trailing
52 ; | is always required even if the variable is
53 ; last item on the line.
54 ;
55 ; To use a "|" in your display use "||" in the
56 ; form.
57 ;
58 ; Mnemonics Comments - A short hand for variables is
59 ; available. Programmers comments can be put into the
60 ; form which are ignored by the generator.
61 ;
62 ; Output Transform - Mumps output transforms can be
63 ; indicated for execution upon selected variables.
64 ;
65 ; WP SPECIAL FUNCTIONS Located at the top of the form.
66 ;
67 ; Comment line Begin the line with a ';'
68 ;
69 ; Variable Mneumonic - Reference Name spaced variables can
70 ; be long. A mnemonic reference is available to make
71 ; life simple. Multiple mnemonic lines can be used
72 ; if desired.
73 ;
74 ;
75 ; SETUP
76 ;
77 ; #mneum1=variable1|mneum2=variable2*...
78 ; #mneumZ=variableZ|.....
79 ;
80 ; Example:
81 ; #D=DUZ | V =BARVPT
82 ; #I=BARIPT
83 ;
84 ; (BARIPT array is storing IHS Patient Information)
85 ; (BARVPT array is storing VA Patient Information)
86 ;
87 ;
88 ; '#' Marker placed in the first column
89 ;
90 ; mnemonic1 User's choice
91 ; ex: D to denote DUZ
92 ; '=' EQUALS
93 ;
94 ; variable1 User's choice of the local variable
95 ; ex: DUZ
96 ; '|' Repeat seperator if more than one
97 ; mnemonic is indicated on a line
98 ;
99 ; USE The mnemonic reference can be used
100 ; any where in the WP form.
101 ; Format ~mnemonic|variable subscript~
102 ;
103 ; '|' Beginning marker for the variable
104 ;
105 ; mnemonic1 User's mnemonic
106 ;
107 ; '@' Mneumonic dubstitution marker
108 ;
109 ; subscript The subscript of the variable to be
110 ; used.
111 ;
112 ; '|' Ending marker for the variable
113 ;
114 ; ex: |D@| for DUZ
115 ; |D@0| for DUZ(0)
116 ; |I@.01| for BARIPT(.01)
117 ;
118 ; MUMPS OUTPUT TRANSFORM - A simple mumps output
119 ; transform is also provided to aid in form design. A
120 ; variable or mnemonic indicated will have its output
121 ; transformed prior to being put into the form.
122 ;
123 ; SETUP
124 ;
125 ; *var1:mumps code1|var2:mumps code2
126 ; *mnemonic3:mumps code3|mnemonic4:mumps code4
127 ;
128 ; Ex: *DUZ(2):$J(X,10,2) will output $J(DUZ(2),10,2)
129 ; *D@2! :$J(X,10,2) mnemonic notation of same
130 ;
131 ; '*' Output Transform marker in column one. Near TOF
132 ;
133 ; Variable/ Variable or mnemonic as it would appear in the
134 ; Mneumonic form between '~'s.
135 ;
136 ; ':' Separator
137 ;
138 ; mumps code Mumps code expression as a function of x.
139 ; Do not state 'S X=f(x)'
140 ; Enter the function only, f(x).
141 ;
142 ; '|' Repeat Separator if more than one is put
143 ; on one line.
144 ;
145 ; SPECIAL OUTPUT TRANSFORMS provided by XBFORM
146 ;
147 ; $$MDY(X)
148 ; *xxx:$$MDY(X) a literal |"NOW"| or variable |IT@9|
149 ; ex: *"NOW":$$MDY(X) or *IT@9:$$MDY(X)
150 ; returns mm/dd/yy
151 ;
152 ; $$WP("X")
153 ; *xxx:$$WP("X") for a word processing field array |xxx|
154 ;
155 ; NOTE: "X" IS ABSOLUTELY NECESSARY
156 ; The variable array must have the form
157 ; xxx(n) where n = 1:1
158 ; xxx may be B@101 as if returned by
159 ; XBDIQ1 in the node 101 of B@
160 ; EX:
161 ; *B@:$$WP("X") |B@| for B=BARWP with BARWP(n) defined
162 ; *B@101:$$WP("X") |B@101| for B=BARWP with BARWP(101,n) defined
163 ;
164 ; $$FL(X)
165 ; *19:$$FL(X) |19| in form: fill lines through 19
166 ;
167 ; ;D10
168 ; *xxx:;D10 Performs $J(xxx,10,2)
169 ;
170 ; ;R20
171 ; *xxx:;R20 Performs $J(xxx,20)
172 ;
173 ; ;L15
174 ; *xxx:;L15 Performs $E(xxx,1,15)
175 ;
176 Q
177TEST ;;
178 ;** set up variables
179 D ENP^XBDIQ1(200,DUZ,".01:.116","XBFU(")
180 I '$D(XBFFORM) S XBFFORM="JAN"
181 D EDIT^XBFORM(XBFFORM,90053.01,1000)
182 KILL XBFFM
183 S Y=$$GEN^XBFORM(XBFFORM,90053.01,1000,"XBFFM(",0,0)
184 Q
185TESTE ;;END
186PRT ;
187 D ^%ZIS
188 U IO W !
189 F I=1:1 Q:'$D(XBFFM(I)) U IO W XBFFM(I),!
190 U IO W #
191 D ^%ZISC
192 Q
Note: See TracBrowser for help on using the repository browser.