GMVDCCNV ;HOIFO/DAD,FT-VITALS COMPONENT: CONVERT UNITS ;9/29/00 09:15
;;5.0;GEN. MED. REC. - VITALS;;Oct 31, 2002
;
; This routine uses the following IAs:
; #10143 - XLFMSMT calls (supported)
;
CNV(GMVALUE,GMVMSYS,GMVOPER,GMVTYPE) ;
; Unit conversion
; Input:
; GMVALUE = The value to be converted
; GMVMSYS = The desired Measurement system
; GMVOPER = The operation taking place (G - Get data, S - Save data)
; GMVTYPE = The Vital Type abbreviation
; Output:
; The measurement expressed in the desired units
I $G(GMVALUE)]"",$G(GMVMSYS)]"",$G(GMVOPER)]"",$G(GMVTYPE)]"" D
. I "^T^"[(U_GMVTYPE_U) S GMVALUE=$$TMP(GMVALUE,GMVMSYS,GMVOPER)
. I "^WT^"[(U_GMVTYPE_U) S GMVALUE=$$WEI(GMVALUE,GMVMSYS,GMVOPER)
. I "^CVP^"[(U_GMVTYPE_U) S GMVALUE=$$CVP(GMVALUE,GMVMSYS,GMVOPER)
. I "^HT^AG^FH^HC^CG^"[(U_GMVTYPE_U) S GMVALUE=$$LEN(GMVALUE,GMVMSYS,GMVOPER)
. Q
Q $G(GMVALUE)
;
TMP(GMVALUE,GMVMSYS,GMVOPER) ;
; Temperature conversion
; Input:
; GMVALUE = The value to be converted
; GMVMSYS = The desired Measurement system
; GMVOPER = The operation taking place (G - Get data, S - Save data)
; Output:
; The measurement expressed in the desired units
I GMVMSYS="M" D
. N GMVFR,GMVTO
. I GMVOPER="G" S GMVFR="F",GMVTO="C"
. I GMVOPER="S" S GMVFR="C",GMVTO="F"
. S GMVALUE=$P($$TEMP^XLFMSMT(GMVALUE,GMVFR,GMVTO)," ")
. Q
Q GMVALUE
;
LEN(GMVALUE,GMVMSYS,GMVOPER) ;
; Length conversion
; Input:
; GMVALUE = The value to be converted
; GMVMSYS = The desired Measurement system
; GMVOPER = The operation taking place (G - Get data, S - Save data)
; Output:
; The measurement expressed in the desired units
I GMVMSYS="M" D
. N GMVFR,GMVTO
. I GMVOPER="G" S GMVFR="IN",GMVTO="CM"
. I GMVOPER="S" S GMVFR="CM",GMVTO="IN"
. S GMVALUE=$P($$LENGTH^XLFMSMT(GMVALUE,GMVFR,GMVTO)," ")
. Q
Q GMVALUE
;
WEI(GMVALUE,GMVMSYS,GMVOPER) ;
; Weight conversion
; Input:
; GMVALUE = The value to be converted
; GMVMSYS = The desired Measurement system
; GMVOPER = The operation taking place (G - Get data, S - Save data)
; Output:
; The measurement expressed in the desired units
I GMVMSYS="M" D
. N GMVFR,GMVTO
. I GMVOPER="G" S GMVFR="LB",GMVTO="KG"
. I GMVOPER="S" S GMVFR="KG",GMVTO="LB"
. S GMVALUE=$P($$WEIGHT^XLFMSMT(GMVALUE,GMVFR,GMVTO)," ")
. Q
Q GMVALUE
;
CVP(GMVALUE,GMVMSYS,GMVOPER) ;
; Central Venous Pressure conversion
; Input:
; GMVALUE = The value to be converted
; GMVMSYS = The desired Measurement system
; GMVOPER = The operation taking place (G - Get data, S - Save data)
; Output:
; The measurement expressed in the desired units
I GMVMSYS="M" D
. I GMVOPER="G" S GMVALUE=$J(GMVALUE/1.36,0,3)
. I GMVOPER="S" S GMVALUE=$J(GMVALUE*1.36,0,3)
. Q
Q GMVALUE
GMVDCCNV ;HOIFO/DAD,FT-VITALS COMPONENT: CONVERT UNITS ;9/29/00 09:15
+1 ;;5.0;GEN. MED. REC. - VITALS;;Oct 31, 2002
+2 ;
+3 ; This routine uses the following IAs:
+4 ; #10143 - XLFMSMT calls (supported)
+5 ;
CNV(GMVALUE,GMVMSYS,GMVOPER,GMVTYPE) ;
+1 ; Unit conversion
+2 ; Input:
+3 ; GMVALUE = The value to be converted
+4 ; GMVMSYS = The desired Measurement system
+5 ; GMVOPER = The operation taking place (G - Get data, S - Save data)
+6 ; GMVTYPE = The Vital Type abbreviation
+7 ; Output:
+8 ; The measurement expressed in the desired units
+9 IF $GET(GMVALUE)]""
IF $GET(GMVMSYS)]""
IF $GET(GMVOPER)]""
IF $GET(GMVTYPE)]""
Begin DoDot:1
+10 IF "^T^"[(U_GMVTYPE_U)
SET GMVALUE=$$TMP(GMVALUE,GMVMSYS,GMVOPER)
+11 IF "^WT^"[(U_GMVTYPE_U)
SET GMVALUE=$$WEI(GMVALUE,GMVMSYS,GMVOPER)
+12 IF "^CVP^"[(U_GMVTYPE_U)
SET GMVALUE=$$CVP(GMVALUE,GMVMSYS,GMVOPER)
+13 IF "^HT^AG^FH^HC^CG^"[(U_GMVTYPE_U)
SET GMVALUE=$$LEN(GMVALUE,GMVMSYS,GMVOPER)
+14 QUIT
End DoDot:1
+15 QUIT $GET(GMVALUE)
+16 ;
TMP(GMVALUE,GMVMSYS,GMVOPER) ;
+1 ; Temperature conversion
+2 ; Input:
+3 ; GMVALUE = The value to be converted
+4 ; GMVMSYS = The desired Measurement system
+5 ; GMVOPER = The operation taking place (G - Get data, S - Save data)
+6 ; Output:
+7 ; The measurement expressed in the desired units
+8 IF GMVMSYS="M"
Begin DoDot:1
+9 NEW GMVFR,GMVTO
+10 IF GMVOPER="G"
SET GMVFR="F"
SET GMVTO="C"
+11 IF GMVOPER="S"
SET GMVFR="C"
SET GMVTO="F"
+12 SET GMVALUE=$PIECE($$TEMP^XLFMSMT(GMVALUE,GMVFR,GMVTO)," ")
+13 QUIT
End DoDot:1
+14 QUIT GMVALUE
+15 ;
LEN(GMVALUE,GMVMSYS,GMVOPER) ;
+1 ; Length conversion
+2 ; Input:
+3 ; GMVALUE = The value to be converted
+4 ; GMVMSYS = The desired Measurement system
+5 ; GMVOPER = The operation taking place (G - Get data, S - Save data)
+6 ; Output:
+7 ; The measurement expressed in the desired units
+8 IF GMVMSYS="M"
Begin DoDot:1
+9 NEW GMVFR,GMVTO
+10 IF GMVOPER="G"
SET GMVFR="IN"
SET GMVTO="CM"
+11 IF GMVOPER="S"
SET GMVFR="CM"
SET GMVTO="IN"
+12 SET GMVALUE=$PIECE($$LENGTH^XLFMSMT(GMVALUE,GMVFR,GMVTO)," ")
+13 QUIT
End DoDot:1
+14 QUIT GMVALUE
+15 ;
WEI(GMVALUE,GMVMSYS,GMVOPER) ;
+1 ; Weight conversion
+2 ; Input:
+3 ; GMVALUE = The value to be converted
+4 ; GMVMSYS = The desired Measurement system
+5 ; GMVOPER = The operation taking place (G - Get data, S - Save data)
+6 ; Output:
+7 ; The measurement expressed in the desired units
+8 IF GMVMSYS="M"
Begin DoDot:1
+9 NEW GMVFR,GMVTO
+10 IF GMVOPER="G"
SET GMVFR="LB"
SET GMVTO="KG"
+11 IF GMVOPER="S"
SET GMVFR="KG"
SET GMVTO="LB"
+12 SET GMVALUE=$PIECE($$WEIGHT^XLFMSMT(GMVALUE,GMVFR,GMVTO)," ")
+13 QUIT
End DoDot:1
+14 QUIT GMVALUE
+15 ;
CVP(GMVALUE,GMVMSYS,GMVOPER) ;
+1 ; Central Venous Pressure conversion
+2 ; Input:
+3 ; GMVALUE = The value to be converted
+4 ; GMVMSYS = The desired Measurement system
+5 ; GMVOPER = The operation taking place (G - Get data, S - Save data)
+6 ; Output:
+7 ; The measurement expressed in the desired units
+8 IF GMVMSYS="M"
Begin DoDot:1
+9 IF GMVOPER="G"
SET GMVALUE=$JUSTIFY(GMVALUE/1.36,0,3)
+10 IF GMVOPER="S"
SET GMVALUE=$JUSTIFY(GMVALUE*1.36,0,3)
+11 QUIT
End DoDot:1
+12 QUIT GMVALUE