source: FOIAVistA/trunk/r/GEN_MED_OTHER-GMV/GMVDCCNV.m@ 914

Last change on this file since 914 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 2.7 KB
Line 
1GMVDCCNV ;HOIFO/DAD,FT-VITALS COMPONENT: CONVERT UNITS ;9/29/00 09:15
2 ;;5.0;GEN. MED. REC. - VITALS;;Oct 31, 2002
3 ;
4 ; This routine uses the following IAs:
5 ; #10143 - XLFMSMT calls (supported)
6 ;
7CNV(GMVALUE,GMVMSYS,GMVOPER,GMVTYPE) ;
8 ; Unit conversion
9 ; Input:
10 ; GMVALUE = The value to be converted
11 ; GMVMSYS = The desired Measurement system
12 ; GMVOPER = The operation taking place (G - Get data, S - Save data)
13 ; GMVTYPE = The Vital Type abbreviation
14 ; Output:
15 ; The measurement expressed in the desired units
16 I $G(GMVALUE)]"",$G(GMVMSYS)]"",$G(GMVOPER)]"",$G(GMVTYPE)]"" D
17 . I "^T^"[(U_GMVTYPE_U) S GMVALUE=$$TMP(GMVALUE,GMVMSYS,GMVOPER)
18 . I "^WT^"[(U_GMVTYPE_U) S GMVALUE=$$WEI(GMVALUE,GMVMSYS,GMVOPER)
19 . I "^CVP^"[(U_GMVTYPE_U) S GMVALUE=$$CVP(GMVALUE,GMVMSYS,GMVOPER)
20 . I "^HT^AG^FH^HC^CG^"[(U_GMVTYPE_U) S GMVALUE=$$LEN(GMVALUE,GMVMSYS,GMVOPER)
21 . Q
22 Q $G(GMVALUE)
23 ;
24TMP(GMVALUE,GMVMSYS,GMVOPER) ;
25 ; Temperature conversion
26 ; Input:
27 ; GMVALUE = The value to be converted
28 ; GMVMSYS = The desired Measurement system
29 ; GMVOPER = The operation taking place (G - Get data, S - Save data)
30 ; Output:
31 ; The measurement expressed in the desired units
32 I GMVMSYS="M" D
33 . N GMVFR,GMVTO
34 . I GMVOPER="G" S GMVFR="F",GMVTO="C"
35 . I GMVOPER="S" S GMVFR="C",GMVTO="F"
36 . S GMVALUE=$P($$TEMP^XLFMSMT(GMVALUE,GMVFR,GMVTO)," ")
37 . Q
38 Q GMVALUE
39 ;
40LEN(GMVALUE,GMVMSYS,GMVOPER) ;
41 ; Length conversion
42 ; Input:
43 ; GMVALUE = The value to be converted
44 ; GMVMSYS = The desired Measurement system
45 ; GMVOPER = The operation taking place (G - Get data, S - Save data)
46 ; Output:
47 ; The measurement expressed in the desired units
48 I GMVMSYS="M" D
49 . N GMVFR,GMVTO
50 . I GMVOPER="G" S GMVFR="IN",GMVTO="CM"
51 . I GMVOPER="S" S GMVFR="CM",GMVTO="IN"
52 . S GMVALUE=$P($$LENGTH^XLFMSMT(GMVALUE,GMVFR,GMVTO)," ")
53 . Q
54 Q GMVALUE
55 ;
56WEI(GMVALUE,GMVMSYS,GMVOPER) ;
57 ; Weight conversion
58 ; Input:
59 ; GMVALUE = The value to be converted
60 ; GMVMSYS = The desired Measurement system
61 ; GMVOPER = The operation taking place (G - Get data, S - Save data)
62 ; Output:
63 ; The measurement expressed in the desired units
64 I GMVMSYS="M" D
65 . N GMVFR,GMVTO
66 . I GMVOPER="G" S GMVFR="LB",GMVTO="KG"
67 . I GMVOPER="S" S GMVFR="KG",GMVTO="LB"
68 . S GMVALUE=$P($$WEIGHT^XLFMSMT(GMVALUE,GMVFR,GMVTO)," ")
69 . Q
70 Q GMVALUE
71 ;
72CVP(GMVALUE,GMVMSYS,GMVOPER) ;
73 ; Central Venous Pressure conversion
74 ; Input:
75 ; GMVALUE = The value to be converted
76 ; GMVMSYS = The desired Measurement system
77 ; GMVOPER = The operation taking place (G - Get data, S - Save data)
78 ; Output:
79 ; The measurement expressed in the desired units
80 I GMVMSYS="M" D
81 . I GMVOPER="G" S GMVALUE=$J(GMVALUE/1.36,0,3)
82 . I GMVOPER="S" S GMVALUE=$J(GMVALUE*1.36,0,3)
83 . Q
84 Q GMVALUE
Note: See TracBrowser for help on using the repository browser.