source: PGC/trunk/p/PEDHTML-T14.KID@ 1315

Last change on this file since 1315 was 957, checked in by George Lilly, 14 years ago

Pediatric Growth Charts - initial release

File size: 30.0 KB
Line 
1KIDS Distribution saved on Sep 26, 2010@21:44:11
2Added titles and changed date on file
3**KIDS**:PEDHTML 1.0^
4
5**INSTALL NAME**
6PEDHTML 1.0
7"BLD",7337,0)
8PEDHTML 1.0^^0^3100926^n
9"BLD",7337,1,0)
10^^35^35^3071115^
11"BLD",7337,1,1,0)
12 This patch adds the ability to view Pediatric Growth Charts to CPRS.
13"BLD",7337,1,2,0)
14
15"BLD",7337,1,3,0)
16 Installation instructions are in the multi-build containing this build.
17"BLD",7337,1,4,0)
18
19"BLD",7337,1,5,0)
20 The following two Parameters are added:
21"BLD",7337,1,6,0)
22
23"BLD",7337,1,7,0)
24 GMRV PED GROWTH CHART FOLDER for example: /srv/www/htdocs/growth
25"BLD",7337,1,8,0)
26
27"BLD",7337,1,9,0)
28 GMRV PED GROWTH CHART SERVER for example:
29"BLD",7337,1,10,0)
30 http://voe2.openforum.opensourcevista.net/PGC-new/chart.php
31"BLD",7337,1,11,0)
32
33"BLD",7337,1,12,0)
34 The following parameter is also added to:
35"BLD",7337,1,13,0)
36 CPRS GUI TOOLS for System add Command:
37"BLD",7337,1,14,0)
38 Growth Charts=C:\StartGrowthCharts.bat %DFN
39"BLD",7337,1,15,0)
40 (or any other apporpriate directory)
41"BLD",7337,1,16,0)
42
43"BLD",7337,1,17,0)
44 In C: have StartGrowthCharts.bat with for example the following in it:
45"BLD",7337,1,18,0)
46 START http://vistaehr/growth/%1.html
47"BLD",7337,1,19,0)
48 (the "growth" folder name matches with the FOLDER listed in the
49"BLD",7337,1,20,0)
50 GMRV PED GROWTH CHART FOLDER parameter above)
51"BLD",7337,1,21,0)
52
53"BLD",7337,1,22,0)
54 Routine Summary:
55"BLD",7337,1,23,0)
56 ================
57"BLD",7337,1,24,0)
58
59"BLD",7337,1,25,0)
60 The second line now reads as follows:
61"BLD",7337,1,26,0)
62
63"BLD",7337,1,27,0)
64 <TAB>;;5.0;GEN. MED. REC. - VITALS;**[patch list]**;Oct 31, 2002
65"BLD",7337,1,28,0)
66
67"BLD",7337,1,29,0)
68 CHECK^XTSUMBLD results:
69"BLD",7337,1,30,0)
70
71"BLD",7337,1,31,0)
72 Routine Before Patch After Patch Patch List
73"BLD",7337,1,32,0)
74 ========================================================================
75"BLD",7337,1,33,0)
76 GMRVED2 12357440 12600612 2,nn
77"BLD",7337,1,34,0)
78 GMRVPGC <n/a> 11805207 nn
79"BLD",7337,1,35,0)
80 GMVDCSAV <n/a> 5563465 nn
81"BLD",7337,4,0)
82^9.64PA^^
83"BLD",7337,6.3)
8415
85"BLD",7337,"KRN",0)
86^9.67PA^8989.52^19
87"BLD",7337,"KRN",.4,0)
88.4
89"BLD",7337,"KRN",.401,0)
90.401
91"BLD",7337,"KRN",.402,0)
92.402
93"BLD",7337,"KRN",.403,0)
94.403
95"BLD",7337,"KRN",.5,0)
96.5
97"BLD",7337,"KRN",.84,0)
98.84
99"BLD",7337,"KRN",3.6,0)
1003.6
101"BLD",7337,"KRN",3.8,0)
1023.8
103"BLD",7337,"KRN",9.2,0)
1049.2
105"BLD",7337,"KRN",9.8,0)
1069.8
107"BLD",7337,"KRN",9.8,"NM",0)
108^9.68A^3^3
109"BLD",7337,"KRN",9.8,"NM",1,0)
110GMRVPGC^^0^B34589005
111"BLD",7337,"KRN",9.8,"NM",2,0)
112GMRVED2^^0^B31440386
113"BLD",7337,"KRN",9.8,"NM",3,0)
114GMVDCSAV^^0^B20608743
115"BLD",7337,"KRN",9.8,"NM","B","GMRVED2",2)
116
117"BLD",7337,"KRN",9.8,"NM","B","GMRVPGC",1)
118
119"BLD",7337,"KRN",9.8,"NM","B","GMVDCSAV",3)
120
121"BLD",7337,"KRN",19,0)
12219
123"BLD",7337,"KRN",19.1,0)
12419.1
125"BLD",7337,"KRN",101,0)
126101
127"BLD",7337,"KRN",409.61,0)
128409.61
129"BLD",7337,"KRN",771,0)
130771
131"BLD",7337,"KRN",870,0)
132870
133"BLD",7337,"KRN",8989.51,0)
1348989.51
135"BLD",7337,"KRN",8989.51,"NM",0)
136^9.68A^2^2
137"BLD",7337,"KRN",8989.51,"NM",1,0)
138GMRV PED GROWTH CHART FOLDER^^0
139"BLD",7337,"KRN",8989.51,"NM",2,0)
140GMRV PED GROWTH CHART SERVER^^0
141"BLD",7337,"KRN",8989.51,"NM","B","GMRV PED GROWTH CHART FOLDER",1)
142
143"BLD",7337,"KRN",8989.51,"NM","B","GMRV PED GROWTH CHART SERVER",2)
144
145"BLD",7337,"KRN",8989.52,0)
1468989.52
147"BLD",7337,"KRN",8989.52,"NM",0)
148^9.68A^^
149"BLD",7337,"KRN",8994,0)
1508994
151"BLD",7337,"KRN","B",.4,.4)
152
153"BLD",7337,"KRN","B",.401,.401)
154
155"BLD",7337,"KRN","B",.402,.402)
156
157"BLD",7337,"KRN","B",.403,.403)
158
159"BLD",7337,"KRN","B",.5,.5)
160
161"BLD",7337,"KRN","B",.84,.84)
162
163"BLD",7337,"KRN","B",3.6,3.6)
164
165"BLD",7337,"KRN","B",3.8,3.8)
166
167"BLD",7337,"KRN","B",9.2,9.2)
168
169"BLD",7337,"KRN","B",9.8,9.8)
170
171"BLD",7337,"KRN","B",19,19)
172
173"BLD",7337,"KRN","B",19.1,19.1)
174
175"BLD",7337,"KRN","B",101,101)
176
177"BLD",7337,"KRN","B",409.61,409.61)
178
179"BLD",7337,"KRN","B",771,771)
180
181"BLD",7337,"KRN","B",870,870)
182
183"BLD",7337,"KRN","B",8989.51,8989.51)
184
185"BLD",7337,"KRN","B",8989.52,8989.52)
186
187"BLD",7337,"KRN","B",8994,8994)
188
189"BLD",7337,"QUES",0)
190^9.62^^
191"BLD",7337,"REQB",0)
192^9.611^^
193"KRN",8989.51,547,-1)
1940^2
195"KRN",8989.51,547,0)
196GMRV PED GROWTH CHART SERVER^Pediatric Growth Chart HTML Server^0
197"KRN",8989.51,547,1)
198F^^Value should be of the form http://yourserver.net/etc/chart.php
199"KRN",8989.51,547,6)
200
201"KRN",8989.51,547,30,0)
202^8989.513I^2^1
203"KRN",8989.51,547,30,2,0)
2041^4.2
205"KRN",8989.51,548,-1)
2060^1
207"KRN",8989.51,548,0)
208GMRV PED GROWTH CHART FOLDER^Pediatric Growth Chart Directory^0
209"KRN",8989.51,548,1)
210F^^The directory where growth chart html pages for each patient are stored
211"KRN",8989.51,548,30,0)
212^8989.513I^1^1
213"KRN",8989.51,548,30,1,0)
2141^4.2
215"MBREQ")
2160
217"ORD",20,8989.51)
2188989.51;20;;;PAR1E1^XPDTA2;PAR1F1^XPDIA3;PAR1E1^XPDIA3;PAR1F2^XPDIA3;;PAR1DEL^XPDIA3(%)
219"ORD",20,8989.51,0)
220PARAMETER DEFINITION
221"QUES","XPF1",0)
222Y
223"QUES","XPF1","??")
224^D REP^XPDH
225"QUES","XPF1","A")
226Shall I write over your |FLAG| File
227"QUES","XPF1","B")
228YES
229"QUES","XPF1","M")
230D XPF1^XPDIQ
231"QUES","XPF2",0)
232Y
233"QUES","XPF2","??")
234^D DTA^XPDH
235"QUES","XPF2","A")
236Want my data |FLAG| yours
237"QUES","XPF2","B")
238YES
239"QUES","XPF2","M")
240D XPF2^XPDIQ
241"QUES","XPI1",0)
242YO
243"QUES","XPI1","??")
244^D INHIBIT^XPDH
245"QUES","XPI1","A")
246Want KIDS to INHIBIT LOGONs during the install
247"QUES","XPI1","B")
248NO
249"QUES","XPI1","M")
250D XPI1^XPDIQ
251"QUES","XPM1",0)
252PO^VA(200,:EM
253"QUES","XPM1","??")
254^D MG^XPDH
255"QUES","XPM1","A")
256Enter the Coordinator for Mail Group '|FLAG|'
257"QUES","XPM1","B")
258
259"QUES","XPM1","M")
260D XPM1^XPDIQ
261"QUES","XPO1",0)
262Y
263"QUES","XPO1","??")
264^D MENU^XPDH
265"QUES","XPO1","A")
266Want KIDS to Rebuild Menu Trees Upon Completion of Install
267"QUES","XPO1","B")
268NO
269"QUES","XPO1","M")
270D XPO1^XPDIQ
271"QUES","XPZ1",0)
272Y
273"QUES","XPZ1","??")
274^D OPT^XPDH
275"QUES","XPZ1","A")
276Want to DISABLE Scheduled Options, Menu Options, and Protocols
277"QUES","XPZ1","B")
278NO
279"QUES","XPZ1","M")
280D XPZ1^XPDIQ
281"QUES","XPZ2",0)
282Y
283"QUES","XPZ2","??")
284^D RTN^XPDH
285"QUES","XPZ2","A")
286Want to MOVE routines to other CPUs
287"QUES","XPZ2","B")
288NO
289"QUES","XPZ2","M")
290D XPZ2^XPDIQ
291"RTN")
2923
293"RTN","GMRVED2")
2940^2^B31440386
295"RTN","GMRVED2",1,0)
296GMRVED2 ;HIOFO/RM,YH,FT-VITAL SIGNS EDIT SHORT FORM ;7/20/07 13:43
297"RTN","GMRVED2",2,0)
298 ;;5.0;GEN. MED. REC. - VITALS;**2**;Oct 31, 2002;Build 15
299"RTN","GMRVED2",3,0)
300 ;
301"RTN","GMRVED2",4,0)
302 ; This routine uses the following IAs:
303"RTN","GMRVED2",5,0)
304 ; #10035 - ^DPT( references (supported)
305"RTN","GMRVED2",6,0)
306 ; #10061 - ^VADPT calls (supported)
307"RTN","GMRVED2",7,0)
308 ; #10103 - ^XLFDT calls (supported)
309"RTN","GMRVED2",8,0)
310 ; #10104 - ^XLFSTR calls (supported)
311"RTN","GMRVED2",9,0)
312 ;
313"RTN","GMRVED2",10,0)
314EN1 ; SORT PATIENTS ON WARD
315"RTN","GMRVED2",11,0)
316 K ^TMP($J)
317"RTN","GMRVED2",12,0)
318WSA1 ; SET ^TMP($J, FOR SORT
319"RTN","GMRVED2",13,0)
320 D DEM^VADPT,INP^VADPT S GMRRMBD=$S(VAIN(5)'="":VAIN(5),1:" BLANK"),GMRNAM=$S(VADM(1)'="":VADM(1),1:" BLANK") D KVAR^VADPT K VA
321"RTN","GMRVED2",14,0)
322 S:$S("Aa"[GMREDB:1,$D(GMRROOM($P(GMRRMBD,"-"))):1,1:0) ^TMP($J,GMRRMBD,GMRNAM,DFN)=""
323"RTN","GMRVED2",15,0)
324 S DFN=$O(^DPT("CN",GMRWARD(1),DFN))
325"RTN","GMRVED2",16,0)
326 Q:DFN="" G WSA1
327"RTN","GMRVED2",17,0)
328EN2 ; BEGIN EDITING WARD VITALS
329"RTN","GMRVED2",18,0)
330 I $O(^TMP($J,0))="" S GMROUT=1 Q
331"RTN","GMRVED2",19,0)
332 W !,"Begin entering patient vitals." S GMRDT0=GMRVIDT
333"RTN","GMRVED2",20,0)
334 S GMRRMBD="" F GMRI=0:0 S GMRRMBD=$O(^TMP($J,GMRRMBD)) Q:GMRRMBD=""!GMROUT S GMRNAM="" F GMRI=0:0 S GMRNAM=$O(^TMP($J,GMRRMBD,GMRNAM)) Q:GMRNAM=""!GMROUT F DFN=0:0 S DFN=$O(^TMP($J,GMRRMBD,GMRNAM,DFN)) Q:DFN'>0 D V1 Q:GMROUT
335"RTN","GMRVED2",21,0)
336 W !,"Enter return to continue" R X:DTIME Q
337"RTN","GMRVED2",22,0)
338V1 ;
339"RTN","GMRVED2",23,0)
340 W !!,$S(GMRNAM'=" BLANK":GMRNAM,1:DFN),?$X+10,$S(GMRRMBD'=" BLANK":GMRRMBD,1:"")," OK? YES// " R GMRX:DTIME
341"RTN","GMRVED2",24,0)
342 I GMRX="^"!('$T) S GMROUT=1 Q
343"RTN","GMRVED2",25,0)
344 S GMRX=$$UP^XLFSTR(GMRX) I ((GMRX="")!($E(GMRX)="Y")) K GMRTO S GDT=GMRVIDT D EN1^GMRVADM G:GMROUT&'$D(GMRTO) V2 D EN2^GMRVED3 G:GMROUT&'$D(GMRTO) V2 Q
345"RTN","GMRVED2",26,0)
346 G:GMRX?1"N".E V2
347"RTN","GMRVED2",27,0)
348 W !,"ANSWER YES OR NO" G V1
349"RTN","GMRVED2",28,0)
350V2 ;
351"RTN","GMRVED2",29,0)
352 W !!,"Do you wish to stop looping through names? YES//" R GMRX:DTIME
353"RTN","GMRVED2",30,0)
354 S GMRX=$$UP^XLFSTR(GMRX) I (('$T)!(GMRX="")!($E(GMRX)="Y")!(GMRX="^")) S GMROUT=1 Q
355"RTN","GMRVED2",31,0)
356 I GMRX?1"N".E S GMROUT=0 Q
357"RTN","GMRVED2",32,0)
358 W !,"ANSWER YES OR NO" G V2
359"RTN","GMRVED2",33,0)
360EN4 ; ENTRY FROM GMRVED0 TO ADD THE PATIENT DATA TO THE 120.5 FILE
361"RTN","GMRVED2",34,0)
362 D NOW^%DTC S GMRDATE=%
363"RTN","GMRVED2",35,0)
364 F GMRX=2:1:$L(GMRSTR(0),";")-1 S GMRVITY=$P(GMRSTR(0),";",GMRX) D
365"RTN","GMRVED2",36,0)
366 . S GMRVIT=$S(GMRVITY="T":"TEMPERATURE",GMRVITY="P":"PULSE",GMRVITY="R":"RESPIRATION",GMRVITY="BP":"BLOOD PRESSURE",GMRVITY="HT":"HEIGHT",GMRVITY="CG":"CIRCUMFERENCE/GIRTH",1:"")
367"RTN","GMRVED2",37,0)
368 . S:GMRVIT="" GMRVIT=$S(GMRVITY="WT":"WEIGHT",GMRVITY="CVP":"CENTRAL VENOUS PRESSURE",GMRVITY="PO2":"PULSE OXIMETRY",GMRVITY="PN":"PAIN",1:"")
369"RTN","GMRVED2",38,0)
370 . D:$G(GMRDAT(GMRVITY))'=""&(GMRVIT'="") ADDNODE
371"RTN","GMRVED2",39,0)
372 Q
373"RTN","GMRVED2",40,0)
374ADDNODE ; add data to the 120.5 file
375"RTN","GMRVED2",41,0)
376 N GMVDTDUN,GMVFDA,GMVIEN
377"RTN","GMRVED2",42,0)
378 S GMVDTDUN=GMRVIDT
379"RTN","GMRVED2",43,0)
380 S GMRVIT(1)=$O(^GMRD(120.51,"B",GMRVIT,0))
381"RTN","GMRVED2",44,0)
382 S GMVDTDUN=$$CHKDT(GMRVIDT,GMRVIT(1))
383"RTN","GMRVED2",45,0)
384 S GMVFDA(120.5,"+1,",.01)=GMVDTDUN ;Date/Time
385"RTN","GMRVED2",46,0)
386 S GMVFDA(120.5,"+1,",.02)=DFN ;Patient
387"RTN","GMRVED2",47,0)
388 S GMVFDA(120.5,"+1,",.03)=GMRVIT(1) ;Vital Type
389"RTN","GMRVED2",48,0)
390 S GMVFDA(120.5,"+1,",.04)=GMRDATE ;Date Time entered
391"RTN","GMRVED2",49,0)
392 S GMVFDA(120.5,"+1,",.05)=GMRVHLOC ;Hospital
393"RTN","GMRVED2",50,0)
394 S GMVFDA(120.5,"+1,",.06)=DUZ ;Entered by (DUZ)
395"RTN","GMRVED2",51,0)
396 S GMVFDA(120.5,"+1,",1.2)=GMRDAT(GMRVITY) ;Rate
397"RTN","GMRVED2",52,0)
398 S GMVFDA(120.5,"+1,",1.4)=$G(GMRO2(GMRVITY)) ;Sup 02
399"RTN","GMRVED2",53,0)
400 S GMVIEN=""
401"RTN","GMRVED2",54,0)
402 D UPDATE^DIE("","GMVFDA","GMVIEN")
403"RTN","GMRVED2",55,0)
404 ;file any qualifiers
405"RTN","GMRVED2",56,0)
406 I $D(GMRSITE(GMRVITY))!$D(GMRINF(GMRVITY)) D
407"RTN","GMRVED2",57,0)
408 .I $G(GMRSITE(GMRVITY))'="" D
409"RTN","GMRVED2",58,0)
410 ..S GDATA=+$P(GMRSITE(GMRVITY),U,2)
411"RTN","GMRVED2",59,0)
412 ..Q:'GDATA
413"RTN","GMRVED2",60,0)
414 ..D ADDQUAL(GMVIEN(1)_"^"_GDATA)
415"RTN","GMRVED2",61,0)
416 ..Q
417"RTN","GMRVED2",62,0)
418 .I $D(GMRINF(GMRVITY)) D
419"RTN","GMRVED2",63,0)
420 ..S I=0
421"RTN","GMRVED2",64,0)
422 ..F S I=$O(GMRINF(GMRVITY,I)) Q:I'>0 D
423"RTN","GMRVED2",65,0)
424 ...S I(1)=""
425"RTN","GMRVED2",66,0)
426 ...F S I(1)=$O(GMRINF(GMRVITY,I,I(1))) Q:I(1)="" D
427"RTN","GMRVED2",67,0)
428 ....S GDATA=+$P(GMRINF(GMRVITY,I,I(1)),"^")
429"RTN","GMRVED2",68,0)
430 ....Q:'GDATA
431"RTN","GMRVED2",69,0)
432 ....D ADDQUAL(GMVIEN(1)_"^"_GDATA)
433"RTN","GMRVED2",70,0)
434 ....Q
435"RTN","GMRVED2",71,0)
436 ...Q
437"RTN","GMRVED2",72,0)
438 ..Q
439"RTN","GMRVED2",73,0)
440 .Q
441"RTN","GMRVED2",74,0)
442 S DA=+GMVIEN(1)
443"RTN","GMRVED2",75,0)
444 I GMREDB="P1" S GMRVIEN(GMRVITY)=DA_"^"_GMRDAT(GMRVITY)_"^"_$G(GMRSITE(GMRVITY))
445"RTN","GMRVED2",76,0)
446 S:GMRENTY>4 GLAST=GMRVIDT,GLAST(1)=$G(GLAST(1))+1
447"RTN","GMRVED2",77,0)
448 ; for VOE Pediatric Growth Charts
449"RTN","GMRVED2",78,0)
450 I "8920"[(+GMRVIT(1)) D EN^GMRVPGC(DFN) ; 8=Height 9=Weight 20=Circumference
451"RTN","GMRVED2",79,0)
452 Q
453"RTN","GMRVED2",80,0)
454XREF(DA) ; Set cross-references for FILE 120.5 entry
455"RTN","GMRVED2",81,0)
456 ; Execute SET logic only. Set's all cross-references for this entry.
457"RTN","GMRVED2",82,0)
458 ; DA is the record number
459"RTN","GMRVED2",83,0)
460 N DIC,DIK,X,Y
461"RTN","GMRVED2",84,0)
462 Q:'DA
463"RTN","GMRVED2",85,0)
464 S DIK="^GMR(120.5,"
465"RTN","GMRVED2",86,0)
466 D IX1^DIK
467"RTN","GMRVED2",87,0)
468 Q
469"RTN","GMRVED2",88,0)
470XREF1(DA) ; Set cross-references for FILE 120.5 entry
471"RTN","GMRVED2",89,0)
472 ; Execute SET logic only. Set's all cross-references for this entry.
473"RTN","GMRVED2",90,0)
474 ; DA is the record number
475"RTN","GMRVED2",91,0)
476 N DIC,DIK,GMRVDA,GMRVIEN,X,Y
477"RTN","GMRVED2",92,0)
478 Q:'DA
479"RTN","GMRVED2",93,0)
480 S GMRVIEN=0,GMRVDA=DA
481"RTN","GMRVED2",94,0)
482 F S GMRVIEN=$O(^GMR(120.5,GMRVDA,5,GMRVIEN)) Q:'GMRVIEN D
483"RTN","GMRVED2",95,0)
484 .S DA(1)=GMRVDA,DA=GMRVIEN
485"RTN","GMRVED2",96,0)
486 .S DIK="^GMR(120.5,DA(1),5,"
487"RTN","GMRVED2",97,0)
488 .D IX1^DIK
489"RTN","GMRVED2",98,0)
490 .Q
491"RTN","GMRVED2",99,0)
492 Q
493"RTN","GMRVED2",100,0)
494SETPRMT ; SET VITAL TYPE PATTERN MATCH
495"RTN","GMRVED2",101,0)
496 S G=$P(GMRSTR(0),";",GMRX)
497"RTN","GMRVED2",102,0)
498 S GMRHELP=GMRHELP_$S(G="P":"PPP",G="WT":"WWW.WW",G="R":"RR",G="CG":"NNN.NN",G="CVP":"NN",G="PO2":"NNN",G="HT":"HH",G="BP":"BBB/BBB/BBB (or BBB/BBB)",G="T":"TTT.T",G="PN":"NN",1:"")_$S(GMRX'=($L(GMRSTR(0),";")-1):"-",1:"")
499"RTN","GMRVED2",103,0)
500 S GMRHELP(1)=GMRHELP(1)_$S(GMRHELP(1)'="":",",1:"")_$P(GMRSTR(0),";",GMRX)_"^GMRVUT1"
501"RTN","GMRVED2",104,0)
502 S GMRPRMT=GMRPRMT_$S(G="T":"Temp",G="P":"Pulse",G="WT":"Wt.",G="R":"Resp",G="HT":"Ht.",G="BP":"BP",G="CG":"Circumference/Girth",G="CVP":"CVP",G="PO2":"PO2",G="PN":"Pain",1:"")_$S(GMRX'=($L(GMRSTR(0),";")-1):"-",1:"")
503"RTN","GMRVED2",105,0)
504 Q
505"RTN","GMRVED2",106,0)
506CHKDT(GMVDT,GMVSAV) ;Check if there is an entry for that date & time
507"RTN","GMRVED2",107,0)
508 N GMVA,GMVTY
509"RTN","GMRVED2",108,0)
510 S GMVA=0
511"RTN","GMRVED2",109,0)
512 F S GMVA=$O(^GMR(120.5,"B",GMVDT,GMVA)) Q:'GMVA D
513"RTN","GMRVED2",110,0)
514 .I DFN'=$P($G(^GMR(120.5,GMVA,0)),U,2) Q
515"RTN","GMRVED2",111,0)
516 .S GMVTY=$P($G(^GMR(120.5,GMVA,0)),"^",3)
517"RTN","GMRVED2",112,0)
518 .I GMVTY=GMVSAV D
519"RTN","GMRVED2",113,0)
520 ..S GMVDT=$$FMADD^XLFDT(GMVDT,"","","",1)
521"RTN","GMRVED2",114,0)
522 ..Q
523"RTN","GMRVED2",115,0)
524 .Q
525"RTN","GMRVED2",116,0)
526 Q GMVDT
527"RTN","GMRVED2",117,0)
528 ;
529"RTN","GMRVED2",118,0)
530ADDQUAL(GMRVDATA) ; Add qualifiers to FILE 120.5 entry
531"RTN","GMRVED2",119,0)
532 ; ADD QUALIFIER TO 120.505 SUBFILE
533"RTN","GMRVED2",120,0)
534 ; Input:
535"RTN","GMRVED2",121,0)
536 ; GMRVDATA=120.5 IEN^QUALIFIER (120.52) IEN
537"RTN","GMRVED2",122,0)
538 ;
539"RTN","GMRVED2",123,0)
540 N GMVCNT,GMVERR,GMVFDA,GMVOKAY,GMRVIEN,GMRVQUAL
541"RTN","GMRVED2",124,0)
542 S GMRVIEN=+$P(GMRVDATA,"^",1) ;File 120.5 ien
543"RTN","GMRVED2",125,0)
544 S GMRVQUAL=+$P(GMRVDATA,"^",2) ;File 120.52 ien
545"RTN","GMRVED2",126,0)
546 ; Does File 120.5 entry exist?
547"RTN","GMRVED2",127,0)
548 I '$D(^GMR(120.5,GMRVIEN,0)) Q
549"RTN","GMRVED2",128,0)
550 ; Is the qualifier already stored?
551"RTN","GMRVED2",129,0)
552 I $O(^GMR(120.5,GMRVIEN,5,"B",GMRVQUAL,0))>0 Q
553"RTN","GMRVED2",130,0)
554 ; Legitimate Qualifier?
555"RTN","GMRVED2",131,0)
556 I '$D(^GMRD(120.52,GMRVQUAL,0)) Q
557"RTN","GMRVED2",132,0)
558 S GMVCNT=0 ;counter for number of tries to lock an entry
559"RTN","GMRVED2",133,0)
560B2 ; Lock the entry
561"RTN","GMRVED2",134,0)
562 I GMVCNT>3 Q ;4 strikes and you're out
563"RTN","GMRVED2",135,0)
564 L +^GMR(120.5,GMRVIEN,0):1
565"RTN","GMRVED2",136,0)
566 S GMVCNT=GMVCNT+1
567"RTN","GMRVED2",137,0)
568 I '$T L -^GMR(120.5,GMRVIEN,0) G B2
569"RTN","GMRVED2",138,0)
570 ; Store the qualifier
571"RTN","GMRVED2",139,0)
572 S GMVFDA(120.505,"+1,"_GMRVIEN_",",.01)=GMRVQUAL
573"RTN","GMRVED2",140,0)
574 D UPDATE^DIE("","GMVFDA","GMVOKAY","GMVERR")
575"RTN","GMRVED2",141,0)
576 L -^GMR(120.5,GMRVIEN,0)
577"RTN","GMRVED2",142,0)
578 Q
579"RTN","GMRVPGC")
5800^1^B34589005
581"RTN","GMRVPGC",1,0)
582GMRVPGC ;DBA/CJS - Pediatric Growth Chart HTML generator ;9/26/10 21:59
583"RTN","GMRVPGC",2,0)
584 ;;5.0;GEN. MED. REC. - VITALS;**[patch list]**;Oct 31, 2002;Build 15
585"RTN","GMRVPGC",3,0)
586 ;
587"RTN","GMRVPGC",4,0)
588EN(DFN) ;
589"RTN","GMRVPGC",5,0)
590 N BMI,DIC,DIV,IO,LABEL,LINE,MAXAGE,NAME,NONE,POP,REF,ROOT,SERVER,SEX,STYLE,TMP,TYPE,VAL,VDT,XPARSYS,XQDIC,XQPSM,XQVOL,XVALS,YVALS
591"RTN","GMRVPGC",6,0)
592 S SERVER=$$GET^XPAR("SYS","GMRV PED GROWTH CHART SERVER")
593"RTN","GMRVPGC",7,0)
594 S ROOT=$$GET^XPAR("SYS","GMRV PED GROWTH CHART FOLDER")
595"RTN","GMRVPGC",8,0)
596 ;
597"RTN","GMRVPGC",9,0)
598 S D=^DPT(DFN,0),NAME=$P(D,U),SEX=$P(D,U,2),SEX=$S(SEX="M":1,SEX="F":2,1:0),DOB=$P(D,U,3),DOD=$P($G(^DPT(DFN,.35)),U),PID=$P($G(^DPT(DFN,.36)),U,3)
599"RTN","GMRVPGC",10,0)
600 S Y=DOB D DD^%DT S BIRTH=Y,MAXAGE=$$MNTHSOLD($S(DOD="":DT,DOD'="":DOD),DOB)
601"RTN","GMRVPGC",11,0)
602 ;
603"RTN","GMRVPGC",12,0)
604 ; See if there are any pediatric vitals to be had
605"RTN","GMRVPGC",13,0)
606 ; ^GMR(120.5,"AA",GMRVDFN,GMRVTYP,9999999-GMRVDT,DA)="" "rate" on 0 node piece 8
607"RTN","GMRVPGC",14,0)
608 ; types: 8 = Height, 9 - Weight, 20 = Circumference/Girth, 73 - Head qualifier
609"RTN","GMRVPGC",15,0)
610 S NONE=1 F TYPE=8,9,20 D
611"RTN","GMRVPGC",16,0)
612 . S XVALS(TYPE)="",YVALS(TYPE)=""
613"RTN","GMRVPGC",17,0)
614 . S VDT=0 F S VDT=$O(^GMR(120.5,"AA",DFN,TYPE,VDT)) Q:VDT'>0 D
615"RTN","GMRVPGC",18,0)
616 . . S DA=+$O(^GMR(120.5,"AA",DFN,TYPE,VDT,0))
617"RTN","GMRVPGC",19,0)
618 . . I TYPE=20 Q:'$D(^GMR(120.5,DA,5,"B",73)) ; Quit if not "HEAD"
619"RTN","GMRVPGC",20,0)
620 . . Q:+$G(^GMR(120.5,DA,2)) ; Quit if Entered in Error
621"RTN","GMRVPGC",21,0)
622 . . S AGE=$$MNTHSOLD(9999999-VDT,DOB),NONE=0
623"RTN","GMRVPGC",22,0)
624 . . S XVALS(TYPE)=XVALS(TYPE)_","_AGE
625"RTN","GMRVPGC",23,0)
626 . . S VAL=$P(^GMR(120.5,DA,0),U,8),VAL=$S("8,20"[TYPE:VAL*2.54,TYPE=9:VAL/2.2),VAL=$$ROUND(VAL)
627"RTN","GMRVPGC",24,0)
628 . . I TYPE=8!(TYPE=9) S BMI(AGE,TYPE)=VAL
629"RTN","GMRVPGC",25,0)
630 . . S YVALS(TYPE)=YVALS(TYPE)_","_VAL
631"RTN","GMRVPGC",26,0)
632 . . Q
633"RTN","GMRVPGC",27,0)
634 . Q
635"RTN","GMRVPGC",28,0)
636 ;
637"RTN","GMRVPGC",29,0)
638 ; BMI=WEIGHT/(HEIGHT**2) Weight in Kg, Height in meters
639"RTN","GMRVPGC",30,0)
640 S AGE="",XVALS("BMI")="",YVALS("BMI")="",XVALS("WTHT")="",YVALS("WTHT")=""
641"RTN","GMRVPGC",31,0)
642 F S AGE=$O(BMI(AGE)) Q:AGE'>0 I $D(BMI(AGE,8)),$D(BMI(AGE,9)) D
643"RTN","GMRVPGC",32,0)
644 . S DIV=BMI(AGE,8)**2
645"RTN","GMRVPGC",33,0)
646 . S:DIV'=0 XVALS("BMI")=XVALS("BMI")_","_AGE,YVALS("BMI")=YVALS("BMI")_","_$$ROUND(10000*BMI(AGE,9)/DIV)
647"RTN","GMRVPGC",34,0)
648 . S XVALS("WTHT")=XVALS("WTHT")_","_BMI(AGE,8),YVALS("WTHT")=YVALS("WTHT")_","_BMI(AGE,9)
649"RTN","GMRVPGC",35,0)
650 . Q
651"RTN","GMRVPGC",36,0)
652 ;
653"RTN","GMRVPGC",37,0)
654 ; Establish HTML doctype & head
655"RTN","GMRVPGC",38,0)
656 S LINE=0 F S LINE=LINE+1,TMP(LINE)=$P($T(HEAD+LINE),";",3) Q:TMP(LINE)=""
657"RTN","GMRVPGC",39,0)
658 ;
659"RTN","GMRVPGC",40,0)
660 ; Set up the href links
661"RTN","GMRVPGC",41,0)
662 S TMP(LINE)="<P>"_NAME_"</P><P>DOB: "_BIRTH_"</P>",LINE=LINE+1
663"RTN","GMRVPGC",42,0)
664 S REF="<P><a href="""
665"RTN","GMRVPGC",43,0)
666 S LABEL(0)=$S(SEX=1:"Male",1:"Female")_" Age in months vs. Weight kilograms</a></P>"
667"RTN","GMRVPGC",44,0)
668 S LABEL(1)=$S(SEX=1:"Male",1:"Female")_" Age in months vs. Length centimeters 0-36 months</a></P>"
669"RTN","GMRVPGC",45,0)
670 S LABEL(2)=$S(SEX=1:"Male",1:"Female")_" Age in months vs Head Circumference in centimeters 0-36 months</a></p>"
671"RTN","GMRVPGC",46,0)
672 S LABEL(4)=$S(SEX=1:"Male",1:"Female")_" Age in months vs. Height centimeters over 36 months</a></P>"
673"RTN","GMRVPGC",47,0)
674 S LABEL(5)=$S(SEX=1:"Male",1:"Female")_" Body Mass Index-for age</a></P>"
675"RTN","GMRVPGC",48,0)
676 S LABEL(6)=$S(SEX=1:"Male",1:"Female")_" Weight vs Stature</a></P>"
677"RTN","GMRVPGC",49,0)
678 S LABEL(7)=$S(SEX=1:"Male",1:"Female")_" Weight vs Length</a></P>"
679"RTN","GMRVPGC",50,0)
680 S TITLE(0)=$S(SEX=1:"Male",1:"Female")_" Age in months vs. Weight in kilograms"
681"RTN","GMRVPGC",51,0)
682 S TITLE(1)=$S(SEX=1:"Male",1:"Female")_" Age in months vs. Length centimeters for 0-36 months"
683"RTN","GMRVPGC",52,0)
684 S TITLE(2)=$S(SEX=1:"Male",1:"Female")_" Age in months vs Head Circumference in centimeters for 0-36 months"
685"RTN","GMRVPGC",53,0)
686 S TITLE(4)=$S(SEX=1:"Male",1:"Female")_" Age in months vs. Height centimeters over 36 months"
687"RTN","GMRVPGC",54,0)
688 S TITLE(5)=$S(SEX=1:"Male",1:"Female")_" Body Mass Index vs. Age in Months from 24-240 Months"
689"RTN","GMRVPGC",55,0)
690 S TITLE(6)=$S(SEX=1:"Male",1:"Female")_" Weight in Kilograms vs. Height in centimeters"
691"RTN","GMRVPGC",56,0)
692 S TITLE(7)=$S(SEX=1:"Male",1:"Female")_" Weight in Kilograms vs. Length in centimeters"
693"RTN","GMRVPGC",57,0)
694 F STYLE=0,1,2,4,5,6,7 S TYPE=$$TYPE(STYLE) D:$L(XVALS(TYPE))
695"RTN","GMRVPGC",58,0)
696 . Q:("456"[STYLE)&(MAXAGE<36)
697"RTN","GMRVPGC",59,0)
698 . S TMP(LINE)=REF_SERVER_"?style="_$$STRING(STYLE)_"&title="_TITLE(STYLE)_"&sex="_SEX_"&maxage="_$$AGE(MAXAGE,STYLE)_"&xvals="_$P(XVALS(TYPE),",",2,99)_"&yvals="_$P(YVALS(TYPE),",",2,99)_""">"_LABEL(STYLE)
699"RTN","GMRVPGC",60,0)
700 . S LINE=LINE+1
701"RTN","GMRVPGC",61,0)
702 . Q
703"RTN","GMRVPGC",62,0)
704 ;
705"RTN","GMRVPGC",63,0)
706 S:NONE TMP(LINE)="<P>THERE ARE NO GROWTH VITALS TO PLOT.</P>",LINE=LINE+1
707"RTN","GMRVPGC",64,0)
708 ; last of the labels
709"RTN","GMRVPGC",65,0)
710 S TMP(LINE)="<P>Note: should any xvals or yvals value be inappropriate, or there be an unequal number of values in both lists,",LINE=LINE+1
711"RTN","GMRVPGC",66,0)
712 S TMP(LINE)="the patient plot will be ignored, and a ""blank"" growth chart with percentile values only will be shown.</P>",LINE=LINE+1
713"RTN","GMRVPGC",67,0)
714 S TMP(LINE)="</body>"
715"RTN","GMRVPGC",68,0)
716 S TMP(LINE+1)="</html>"
717"RTN","GMRVPGC",69,0)
718 ;
719"RTN","GMRVPGC",70,0)
720 ; Write out the file
721"RTN","GMRVPGC",71,0)
722 D OPEN^%ZISH("OUTFILE",ROOT,DFN_".html","W") S:POP GMRVPGC="ERROR"
723"RTN","GMRVPGC",72,0)
724 Q:POP
725"RTN","GMRVPGC",73,0)
726 U IO
727"RTN","GMRVPGC",74,0)
728 S LINE=0 F S LINE=$O(TMP(LINE)) Q:LINE'>0 W TMP(LINE),!
729"RTN","GMRVPGC",75,0)
730 D CLOSE^%ZISH("OUTFILE")
731"RTN","GMRVPGC",76,0)
732 Q
733"RTN","GMRVPGC",77,0)
734 ;
735"RTN","GMRVPGC",78,0)
736 ; convert age to months
737"RTN","GMRVPGC",79,0)
738MNTHSOLD(DATE,DOB) ;
739"RTN","GMRVPGC",80,0)
740 S X1=DATE,X2=DOB D ^%DTC S X=X/30.42,X=$$ROUND(X)
741"RTN","GMRVPGC",81,0)
742 Q X
743"RTN","GMRVPGC",82,0)
744 ;
745"RTN","GMRVPGC",83,0)
746ROUND(X) ;
747"RTN","GMRVPGC",84,0)
748 Q $P(X,".")_"."_$E($P(X,".",2),1,2)
749"RTN","GMRVPGC",85,0)
750 ;
751"RTN","GMRVPGC",86,0)
752TYPE(STYLE) ;
753"RTN","GMRVPGC",87,0)
754 Q $S(STYLE=0:9,STYLE=1:8,STYLE=2:20,STYLE=4:8,STYLE=5:"BMI",1:"WTHT")
755"RTN","GMRVPGC",88,0)
756 ;
757"RTN","GMRVPGC",89,0)
758AGE(MAXAGE,STYLE) ;
759"RTN","GMRVPGC",90,0)
760 I MAXAGE<36 Q MAXAGE
761"RTN","GMRVPGC",91,0)
762 I "0456"[STYLE Q MAXAGE
763"RTN","GMRVPGC",92,0)
764 Q 36
765"RTN","GMRVPGC",93,0)
766 ;
767"RTN","GMRVPGC",94,0)
768STRING(STYLE) ;
769"RTN","GMRVPGC",95,0)
770 I STYLE=0 Q "weight-age"
771"RTN","GMRVPGC",96,0)
772 I STYLE=1 Q "length-age"
773"RTN","GMRVPGC",97,0)
774 I STYLE=2 Q "head-age"
775"RTN","GMRVPGC",98,0)
776 I STYLE=4 Q "stature-age"
777"RTN","GMRVPGC",99,0)
778 I STYLE=5 Q "bmi-age"
779"RTN","GMRVPGC",100,0)
780 I STYLE=6 Q "weight-stature"
781"RTN","GMRVPGC",101,0)
782 I STYLE=7 Q "weight-length"
783"RTN","GMRVPGC",102,0)
784 Q 0 ;oops!
785"RTN","GMRVPGC",103,0)
786 ;
787"RTN","GMRVPGC",104,0)
788HEAD ;;
789"RTN","GMRVPGC",105,0)
790 ;;<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
791"RTN","GMRVPGC",106,0)
792 ;; "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
793"RTN","GMRVPGC",107,0)
794 ;;<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
795"RTN","GMRVPGC",108,0)
796 ;;<head>
797"RTN","GMRVPGC",109,0)
798 ;; <title>Growth Chart Example</title>
799"RTN","GMRVPGC",110,0)
800 ;; <meta http-equiv="Content-Type" CONTENT="text/html; charset=UTF-8">
801"RTN","GMRVPGC",111,0)
802 ;; <meta http-equiv="Expires" CONTENT="0">
803"RTN","GMRVPGC",112,0)
804 ;; <meta http-equiv="Cache-Control" CONTENT="no-cache">
805"RTN","GMRVPGC",113,0)
806 ;; <meta http-equiv="PRAGMA" CONTENT="NO-CACHE">
807"RTN","GMRVPGC",114,0)
808 ;;</head>
809"RTN","GMRVPGC",115,0)
810 ;;<body>
811"RTN","GMRVPGC",116,0)
812 ;;Click on any one of the following to display the available growth charts for your patient. Use the back button to return to the main page.
813"RTN","GMRVPGC",117,0)
814 ;;
815"RTN","GMVDCSAV")
8160^3^B20608743
817"RTN","GMVDCSAV",1,0)
818GMVDCSAV ;HOIFO/DAD-VITALS COMPONENT: SAVE DATA ;11/15/07 11:11
819"RTN","GMVDCSAV",2,0)
820 ;;5.0;GEN. MED. REC. - VITALS;**9,3**;Oct 31, 2002;Build 15
821"RTN","GMVDCSAV",3,0)
822 ;
823"RTN","GMVDCSAV",4,0)
824 ; This routine uses the following IAs:
825"RTN","GMVDCSAV",5,0)
826 ; #10103 - ^XLFDT calls (supported)
827"RTN","GMVDCSAV",6,0)
828 ;
829"RTN","GMVDCSAV",7,0)
830 ; This routine supports the following IAs:
831"RTN","GMVDCSAV",8,0)
832 ; #3996 - GMV ADD VM RPC called at EN1 (private)
833"RTN","GMVDCSAV",9,0)
834 ;
835"RTN","GMVDCSAV",10,0)
836 ; 01/28/2005 KAM GMRV*5*9 Record midnight with 1 second added
837"RTN","GMVDCSAV",11,0)
838 ; Stop adding second on multiple patent entry
839"RTN","GMVDCSAV",12,0)
840 ;
841"RTN","GMVDCSAV",13,0)
842EN1(RESULT,GMVDATA) ; GMV ADD VM [RPC entry point]
843"RTN","GMVDCSAV",14,0)
844 ; Saves vitals data
845"RTN","GMVDCSAV",15,0)
846 N GMVCNT,GMVD0,GMVFDA,GMVINUM,GMVQNUM,GMVRNUM,GMVIEN,GMVDUN
847"RTN","GMVDCSAV",16,0)
848 N GMVVNUM,GMVVMEAS,GMVVQUAL,GMVVREAS
849"RTN","GMVDCSAV",17,0)
850 D QUALTWO
851"RTN","GMVDCSAV",18,0)
852 Q
853"RTN","GMVDCSAV",19,0)
854 ;I $O(@GMVDATA@("V",0))>0 D VITMEA
855"RTN","GMVDCSAV",20,0)
856 ;I $O(@GMVDATA@("I",0))>0 D ENTERR
857"RTN","GMVDCSAV",21,0)
858 ;I $G(RESULT(0))="OK" D MSG("OK: Data saved")
859"RTN","GMVDCSAV",22,0)
860 ;Q
861"RTN","GMVDCSAV",23,0)
862 ;
863"RTN","GMVDCSAV",24,0)
864VITMEA ; *** Save vital measurement data ***
865"RTN","GMVDCSAV",25,0)
866 S GMVVNUM=0 K GMVFDA
867"RTN","GMVDCSAV",26,0)
868 S GMVCNT=+$O(@GMVDATA@("V",1E25),-1)
869"RTN","GMVDCSAV",27,0)
870 F S GMVVNUM=$O(@GMVDATA@("V",GMVVNUM)) Q:GMVVNUM'>0 D
871"RTN","GMVDCSAV",28,0)
872 . S GMVVMEAS=$G(@GMVDATA@("V",GMVVNUM))
873"RTN","GMVDCSAV",29,0)
874 . S GMVFDA(120.5,"+"_GMVVNUM_",",.01)=GMVDTDUN ; Date time taken
875"RTN","GMVDCSAV",30,0)
876 . S GMVFDA(120.5,"+"_GMVVNUM_",",.02)=GMVDFN ; Patient
877"RTN","GMVDCSAV",31,0)
878 . S GMVFDA(120.5,"+"_GMVVNUM_",",.03)=$P(GMVVMEAS,U) ;
879"RTN","GMVDCSAV",32,0)
880 . S GMVFDA(120.5,"+"_GMVVNUM_",",.04)=GMVDTENT ; Date Time entered
881"RTN","GMVDCSAV",33,0)
882 . S GMVFDA(120.5,"+"_GMVVNUM_",",.05)=GMVHOSPL ; Hospital
883"RTN","GMVDCSAV",34,0)
884 . S GMVFDA(120.5,"+"_GMVVNUM_",",.06)=GMVENTBY ; Entered by (DUZ)
885"RTN","GMVDCSAV",35,0)
886 . S GMVFDA(120.5,"+"_GMVVNUM_",",1.2)=$P($P(GMVVMEAS,U,2),";",1) ; Rate
887"RTN","GMVDCSAV",36,0)
888 . S GMVFDA(120.5,"+"_GMVVNUM_",",1.4)=$P($P(GMVVMEAS,U,2),";",2) ; Sup 02
889"RTN","GMVDCSAV",37,0)
890 . S GMVQNUM=0
891"RTN","GMVDCSAV",38,0)
892 . F S GMVQNUM=$O(@GMVDATA@("Q",GMVVNUM,GMVQNUM)) Q:GMVQNUM'>0 D
893"RTN","GMVDCSAV",39,0)
894 .. S GMVVQUAL=$G(@GMVDATA@("Q",GMVVNUM,GMVQNUM))
895"RTN","GMVDCSAV",40,0)
896 .. S GMVCNT=GMVCNT+1
897"RTN","GMVDCSAV",41,0)
898 .. S GMVFDA(120.505,"+"_GMVCNT_",","+"_GMVVNUM_",",.01)=GMVVQUAL
899"RTN","GMVDCSAV",42,0)
900 .. Q
901"RTN","GMVDCSAV",43,0)
902 . Q
903"RTN","GMVDCSAV",44,0)
904 D UPDATE^DIE("","GMVFDA"),FMERROR
905"RTN","GMVDCSAV",45,0)
906 S RESULT(0)="OK"
907"RTN","GMVDCSAV",46,0)
908 Q
909"RTN","GMVDCSAV",47,0)
910 ;
911"RTN","GMVDCSAV",48,0)
912ENTERR ; *** Save entered in error data ***
913"RTN","GMVDCSAV",49,0)
914 S GMVINUM=0 K GMVFDA
915"RTN","GMVDCSAV",50,0)
916 S GMVCNT=+$O(@GMVDATA@("I",1E25),-1)
917"RTN","GMVDCSAV",51,0)
918 F S GMVINUM=$O(@GMVDATA@("I",GMVINUM)) Q:GMVINUM'>0 D
919"RTN","GMVDCSAV",52,0)
920 . S GMVD0=$G(@GMVDATA@("I",GMVINUM))
921"RTN","GMVDCSAV",53,0)
922 . S GMVFDA(120.5,GMVD0_",",2)=1
923"RTN","GMVDCSAV",54,0)
924 . S GMVFDA(120.5,GMVD0_",",3)=GMVERRBY
925"RTN","GMVDCSAV",55,0)
926 . S GMVRNUM=0
927"RTN","GMVDCSAV",56,0)
928 . F S GMVRNUM=$O(@GMVDATA@("R",GMVINUM,GMVRNUM)) Q:GMVRNUM'>0 D
929"RTN","GMVDCSAV",57,0)
930 .. S GMVVREAS=$G(@GMVDATA@("R",GMVINUM,GMVRNUM))
931"RTN","GMVDCSAV",58,0)
932 .. S GMVCNT=GMVCNT+1
933"RTN","GMVDCSAV",59,0)
934 .. S GMVFDA(120.506,"+"_GMVCNT_","_GMVD0_",",.01)=GMVVREAS
935"RTN","GMVDCSAV",60,0)
936 .. Q
937"RTN","GMVDCSAV",61,0)
938 . Q
939"RTN","GMVDCSAV",62,0)
940 D UPDATE^DIE("","GMVFDA"),FMERROR
941"RTN","GMVDCSAV",63,0)
942 S RESULT(0)="OK"
943"RTN","GMVDCSAV",64,0)
944 Q
945"RTN","GMVDCSAV",65,0)
946QUALTWO ; Add a new entry to FILE 120.5
947"RTN","GMVDCSAV",66,0)
948 S GMVVNUM=0 K GMVFDA
949"RTN","GMVDCSAV",67,0)
950 S GMVVMEAS=$P(GMVDATA,"*",1) ;
951"RTN","GMVDCSAV",68,0)
952 S GMVDTDUN=$P(GMVVMEAS,"^",1) ; Date time
953"RTN","GMVDCSAV",69,0)
954 ;01/28/2005 KAM GMRV*5*9 Added next Line PAL-0105-60940
955"RTN","GMVDCSAV",70,0)
956 I +$P(GMVDTDUN,".",2)'>0 S GMVDTDUN=$$FMADD^XLFDT(GMVDTDUN,"","","",1)
957"RTN","GMVDCSAV",71,0)
958 S GMVDFN=$P(GMVVMEAS,"^",2) ; Patient DFN
959"RTN","GMVDCSAV",72,0)
960 S GMVVTYP=$P(GMVVMEAS,"^",3) ; Vital type
961"RTN","GMVDCSAV",73,0)
962 S GMVDTDUN=$$CHKDT(GMVDTDUN,$P(GMVVTYP,";",1))
963"RTN","GMVDCSAV",74,0)
964 S GMVDTENT=$$NOW^XLFDT ; Current date time
965"RTN","GMVDCSAV",75,0)
966 S GMVHOSPL=$P(GMVVMEAS,"^",4) ; Hospital
967"RTN","GMVDCSAV",76,0)
968 S GMVENTBY=$P(GMVVMEAS,"^",5) ; DUZ
969"RTN","GMVDCSAV",77,0)
970 S GMVFDA(120.5,"+1,",.01)=GMVDTDUN ; Date time taken
971"RTN","GMVDCSAV",78,0)
972 S GMVFDA(120.5,"+1,",.02)=GMVDFN ; Patient
973"RTN","GMVDCSAV",79,0)
974 S GMVFDA(120.5,"+1,",.03)=$P(GMVVTYP,";",1) ; Vital Type
975"RTN","GMVDCSAV",80,0)
976 S GMVFDA(120.5,"+1,",.04)=GMVDTENT ; Date Time entered
977"RTN","GMVDCSAV",81,0)
978 S GMVFDA(120.5,"+1,",.05)=GMVHOSPL ; Hospital
979"RTN","GMVDCSAV",82,0)
980 S GMVFDA(120.5,"+1,",.06)=GMVENTBY ; Entered by (DUZ)
981"RTN","GMVDCSAV",83,0)
982 S GMVFDA(120.5,"+1,",1.2)=$P(GMVVTYP,";",2) ; Rate
983"RTN","GMVDCSAV",84,0)
984 S GMVFDA(120.5,"+1,",1.4)=$P(GMVVTYP,";",3) ; Sup 02
985"RTN","GMVDCSAV",85,0)
986 S GMVIEN=""
987"RTN","GMVDCSAV",86,0)
988 D UPDATE^DIE("","GMVFDA","GMVIEN"),FMERROR
989"RTN","GMVDCSAV",87,0)
990 S GMVCNT=1
991"RTN","GMVDCSAV",88,0)
992 S GMVQUALS=$P(GMVDATA,"*",2)
993"RTN","GMVDCSAV",89,0)
994 F GMVLOOP=1:1:$L(GMVQUALS,":")+1 D
995"RTN","GMVDCSAV",90,0)
996 . S GMVVQUAL=$P(GMVQUALS,":",GMVLOOP)
997"RTN","GMVDCSAV",91,0)
998 . Q:GMVVQUAL=""
999"RTN","GMVDCSAV",92,0)
1000 . S GMVCNT=GMVCNT+1
1001"RTN","GMVDCSAV",93,0)
1002 . D ADDQUAL^GMVGETQ(.GMVRES,GMVIEN(1)_"^"_GMVVQUAL)
1003"RTN","GMVDCSAV",94,0)
1004 . Q
1005"RTN","GMVDCSAV",95,0)
1006 I "^HT^WT^CG^"[$P($G(^GMRD(120.51,+GMVVTYP,0)),U,2) D EN^GMRVPGC(GMVDFN)
1007"RTN","GMVDCSAV",96,0)
1008 Q
1009"RTN","GMVDCSAV",97,0)
1010 ;
1011"RTN","GMVDCSAV",98,0)
1012CHKDT(GMVDT,GMVSAV) ;Check id there ios a vital entered for that date and time
1013"RTN","GMVDCSAV",99,0)
1014 N GMVA,GMVQ
1015"RTN","GMVDCSAV",100,0)
1016 S GMVQ=0
1017"RTN","GMVDCSAV",101,0)
1018 S GMVA=""
1019"RTN","GMVDCSAV",102,0)
1020 F S GMVA=$O(^GMR(120.5,"B",GMVDT,GMVA)) Q:GMVA="" D
1021"RTN","GMVDCSAV",103,0)
1022 . ;01/28/2005 KAM GMRV*5*9 Added next Line BHS-0504-10643
1023"RTN","GMVDCSAV",104,0)
1024 . I GMVDFN'=$P($G(^GMR(120.5,GMVA,0)),U,2) Q
1025"RTN","GMVDCSAV",105,0)
1026 . S GMVTY=$P($G(^GMR(120.5,GMVA,0)),"^",3)
1027"RTN","GMVDCSAV",106,0)
1028 . I GMVTY=GMVSAV D
1029"RTN","GMVDCSAV",107,0)
1030 . . S GMVDT=$$FMADD^XLFDT(GMVDT,"","","",1)
1031"RTN","GMVDCSAV",108,0)
1032 . . Q
1033"RTN","GMVDCSAV",109,0)
1034 . Q
1035"RTN","GMVDCSAV",110,0)
1036 Q GMVDT
1037"RTN","GMVDCSAV",111,0)
1038MSG(X) ; *** Add a line to the message array ***
1039"RTN","GMVDCSAV",112,0)
1040 S (GMVMSG,RESULT(-1))=1+$G(RESULT(-1),0)
1041"RTN","GMVDCSAV",113,0)
1042 S RESULT(GMVMSG)=X
1043"RTN","GMVDCSAV",114,0)
1044 I $P(X,":")="ERROR" S RESULT(0)="ERROR"
1045"RTN","GMVDCSAV",115,0)
1046 Q
1047"RTN","GMVDCSAV",116,0)
1048 ;
1049"RTN","GMVDCSAV",117,0)
1050FMERROR ;
1051"RTN","GMVDCSAV",118,0)
1052 I $O(^TMP("DIERR",$J,0))>0 D
1053"RTN","GMVDCSAV",119,0)
1054 . N GMVER1,GMVER2
1055"RTN","GMVDCSAV",120,0)
1056 . S GMVER1=0
1057"RTN","GMVDCSAV",121,0)
1058 . F S GMVER1=$O(^TMP("DIERR",$J,GMVER1)) Q:GMVER1'>0 D
1059"RTN","GMVDCSAV",122,0)
1060 .. S GMVER2=0
1061"RTN","GMVDCSAV",123,0)
1062 .. F S GMVER2=$O(^TMP("DIERR",$J,GMVER1,"TEXT",GMVER2)) Q:GMVER2'>0 D
1063"RTN","GMVDCSAV",124,0)
1064 ... D MSG("ERROR: "_$G(^TMP("DIERR",$J,GMVER1,"TEXT",GMVER2)))
1065"RTN","GMVDCSAV",125,0)
1066 ... Q
1067"RTN","GMVDCSAV",126,0)
1068 .. Q
1069"RTN","GMVDCSAV",127,0)
1070 . Q
1071"RTN","GMVDCSAV",128,0)
1072 D CLEAN^DILF
1073"RTN","GMVDCSAV",129,0)
1074 Q
1075"VER")
10768.0^22.0
1077**END**
1078**END**
Note: See TracBrowser for help on using the repository browser.