GMVDCCHK ;HOIFO/DAD,FT-VITALS COMPONENT: CHECK DATA VALUE ;9/29/00 09:15
;;5.0;GEN. MED. REC. - VITALS;;Oct 31, 2002
;
; This routine uses the following IAs:
; #10104 - ^XLFSTR calls (supported)
;
VALID(GMVALUE,GMVMSYS,GMVTYPE) ;
; *** Validate a vital measurement ***
; Input:
; GMVALUE = The vital measurement to be validated
; GMVMSYS = The measurement system the measurement is expressed in
; (C - US Customary, M - Metric)
; GMVTYPE = A vital type abbreviation
; Output:
; 0 - Invalid, 1 - Valid
S GMVTYPE=$$UP^XLFSTR(GMVTYPE)
I $T(@GMVTYPE)]"" D
. N GMVCODE,GMVOK
. S GMVCODE="S GMVOK=$$"_GMVTYPE_"(GMVALUE)"
. X GMVCODE I 'GMVOK K GMVALUE
. Q
E D
. K GMVALUE
. Q
Q ''$D(GMVALUE)
;
AG(X) ; ABDOMINAL GIRTH
S X=$$CNV^GMVDCCNV(X,GMVMSYS,"S",GMVTYPE)
K:X'=+X!(X>150)!(X<0)!(X?.E1".".N) X
Q ''$D(X)
;
AUD(X) ; AUDIOMETRY
N I,Y
K:X'?.N1"/".N1"/".N1"/".N1"/".N1"/".N1"/".N1"/".N1"/".N1"/".N1"/".N1"/".N1"/".N1"/".N1"/".N1"/".N1"/" X
I $D(X) F I=1:1:16 S Y=$P(Y,"/",I) I Y]"" I Y'=+Y!(Y>110)!(Y<0) K X Q
Q ''$D(X)
;
BP(X) ; BLOOD PRESSURE
N I,Y
K:(X'?1.3N1"/"1.3N1"/"1.3N)&(X'?1.3N1"/"1.3N)&(X'?1.3N) X
I $D(X) F I=1:1:$L(X,"/") S Y=$P(X,"/",I) I Y]"" I Y<0!(Y>300) K X Q
I $D(X),(X'?1.3N),$P(X,"/")'>$P(X,"/",$L(X,"/")) K X
Q ''$D(X)
;
CG(X) ; CIRCUMFERENCE/GIRTH
S X=$$CNV^GMVDCCNV(X,GMVMSYS,"S",GMVTYPE)
K:X'=+X!(X>200)!(X<0)!(X?.E1"."3.N) X
Q ''$D(X)
;
CVP(X) ; CENTRAL VENOUS PRESSURE
S X=$$CNV^GMVDCCNV(X,GMVMSYS,"S",GMVTYPE)
K:X<-13.6!(X>136)!(X?.E1"."2.N) X
Q ''$D(X)
;
FH(X) ; FUNDAL HEIGHT
S X=$$CNV^GMVDCCNV(X,GMVMSYS,"S",GMVTYPE)
K:X'=+X!(X>50)!(X<10)!(X?.E1".".N) X
Q ''$D(X)
;
FT(X) ; FETAL HEART TONES
K:X'=+X!(X>250)!(X<50)!(X?.E1".".N) X
Q ''$D(X)
;
HC(X) ; HEAD CIRCUMFERENCE
I GMVMSYS="M" D
. K:+X>76!(+X<26)!(X?.E1"."3.N) X
. Q
I GMVMSYS="C" D
. K:+X>30!(+X<10)!(X?.E1"."4.N) X
. I $D(X),X#1>0 K:"^.125^.25^.375^.5^.625^.75^.875^"'[(U_(X#1)_U) X
. Q
Q ''$D(X)
;
HE(X) ; HEARING
K:"^A^N^"'[(U_X_U) X
Q ''$D(X)
;
HT(X) ; HEIGHT
S X=$$CNV^GMVDCCNV(X,GMVMSYS,"S",GMVTYPE)
K:X'=+X!(X>100)!(X<1)!(X?.E1"."3.N) X
Q ''$D(X)
;
P(X) ; PULSE
K:+X'=X!(X>300)!(X<0)!(X?.E1".".N) X
Q ''$D(X)
;
PN(X) ; PAIN
K:"^0^1^2^3^4^5^6^7^8^9^10^99^"'[(U_X_U) X
Q ''$D(X)
;
PO2(X) ; PULSE OXIMETRY
K:X<0!(X>100)!(X?.E1".".N) X
Q ''$D(X)
;
R(X) ; RESPIRATION
K:X'=+X!(X>100)!(X<0)!(X?.E1".".N) X
Q ''$D(X)
;
T(X) ; TEMPERATURE
S X=$$CNV^GMVDCCNV(X,GMVMSYS,"S",GMVTYPE)
K:X'=+X!(X>120)!(X<45)!(X?.E1"."3.N) X
Q ''$D(X)
;
TON(X) ; TONOMETRY
N I,Y
K:(X'?1.2N1"/"1.2N)&(X'?1.2N1"/")&(X'?1"/"1.2N) X
I $D(X) F I=1,2 S Y=$P(X,"/",I) I Y]"" I Y'=+Y!(Y>80)!(Y<0) K X Q
Q ''$D(X)
;
VC(X) ; VISION CORRECTED
N I,Y
K:(X'?1.3N1"/"1.3N)&(X'?1.3N1"/")&(X'?1"/"1.3N) X
I $D(X) F I=1,2 S Y=$P(X,"/",I) I Y]"" I Y'=+Y!(Y>999)!(Y<10) K X Q
Q ''$D(X)
;
VU(X) ; VISION UNCORRECTED
Q $$VC(X)
;
WT(X) ; WEIGHT
S X=$$CNV^GMVDCCNV(X,GMVMSYS,"S",GMVTYPE)
K:X'=+X!(X>1500)!(X'>0)!(X?.E1"."3.N) X
Q ''$D(X)
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HGMVDCCHK 3123 printed Nov 22, 2024@17:08:37 Page 2
GMVDCCHK ;HOIFO/DAD,FT-VITALS COMPONENT: CHECK DATA VALUE ;9/29/00 09:15
+1 ;;5.0;GEN. MED. REC. - VITALS;;Oct 31, 2002
+2 ;
+3 ; This routine uses the following IAs:
+4 ; #10104 - ^XLFSTR calls (supported)
+5 ;
VALID(GMVALUE,GMVMSYS,GMVTYPE) ;
+1 ; *** Validate a vital measurement ***
+2 ; Input:
+3 ; GMVALUE = The vital measurement to be validated
+4 ; GMVMSYS = The measurement system the measurement is expressed in
+5 ; (C - US Customary, M - Metric)
+6 ; GMVTYPE = A vital type abbreviation
+7 ; Output:
+8 ; 0 - Invalid, 1 - Valid
+9 SET GMVTYPE=$$UP^XLFSTR(GMVTYPE)
+10 IF $TEXT(@GMVTYPE)]""
Begin DoDot:1
+11 NEW GMVCODE,GMVOK
+12 SET GMVCODE="S GMVOK=$$"_GMVTYPE_"(GMVALUE)"
+13 XECUTE GMVCODE
IF 'GMVOK
KILL GMVALUE
+14 QUIT
End DoDot:1
+15 IF '$TEST
Begin DoDot:1
+16 KILL GMVALUE
+17 QUIT
End DoDot:1
+18 QUIT ''$DATA(GMVALUE)
+19 ;
AG(X) ; ABDOMINAL GIRTH
+1 SET X=$$CNV^GMVDCCNV(X,GMVMSYS,"S",GMVTYPE)
+2 if X'=+X!(X>150)!(X<0)!(X?.E1".".N)
KILL X
+3 QUIT ''$DATA(X)
+4 ;
AUD(X) ; AUDIOMETRY
+1 NEW I,Y
+2 if X'?.N1"/".N1"/".N1"/".N1"/".N1"/".N1"/".N1"/".N1"/".N1"/".N1"/".N1"/".N1"/".N1"/".N1"/".N1"/".N1"/"
KILL X
+3 IF $DATA(X)
FOR I=1:1:16
SET Y=$PIECE(Y,"/",I)
IF Y]""
IF Y'=+Y!(Y>110)!(Y<0)
KILL X
QUIT
+4 QUIT ''$DATA(X)
+5 ;
BP(X) ; BLOOD PRESSURE
+1 NEW I,Y
+2 if (X'?1.3N1"/"1.3N1"/"1.3N)&(X'?1.3N1"/"1.3N)&(X'?1.3N)
KILL X
+3 IF $DATA(X)
FOR I=1:1:$LENGTH(X,"/")
SET Y=$PIECE(X,"/",I)
IF Y]""
IF Y<0!(Y>300)
KILL X
QUIT
+4 IF $DATA(X)
IF (X'?1.3N)
IF $PIECE(X,"/")'>$PIECE(X,"/",$LENGTH(X,"/"))
KILL X
+5 QUIT ''$DATA(X)
+6 ;
CG(X) ; CIRCUMFERENCE/GIRTH
+1 SET X=$$CNV^GMVDCCNV(X,GMVMSYS,"S",GMVTYPE)
+2 if X'=+X!(X>200)!(X<0)!(X?.E1"."3.N)
KILL X
+3 QUIT ''$DATA(X)
+4 ;
CVP(X) ; CENTRAL VENOUS PRESSURE
+1 SET X=$$CNV^GMVDCCNV(X,GMVMSYS,"S",GMVTYPE)
+2 if X<-13.6!(X>136)!(X?.E1"."2.N)
KILL X
+3 QUIT ''$DATA(X)
+4 ;
FH(X) ; FUNDAL HEIGHT
+1 SET X=$$CNV^GMVDCCNV(X,GMVMSYS,"S",GMVTYPE)
+2 if X'=+X!(X>50)!(X<10)!(X?.E1".".N)
KILL X
+3 QUIT ''$DATA(X)
+4 ;
FT(X) ; FETAL HEART TONES
+1 if X'=+X!(X>250)!(X<50)!(X?.E1".".N)
KILL X
+2 QUIT ''$DATA(X)
+3 ;
HC(X) ; HEAD CIRCUMFERENCE
+1 IF GMVMSYS="M"
Begin DoDot:1
+2 if +X>76!(+X<26)!(X?.E1"."3.N)
KILL X
+3 QUIT
End DoDot:1
+4 IF GMVMSYS="C"
Begin DoDot:1
+5 if +X>30!(+X<10)!(X?.E1"."4.N)
KILL X
+6 IF $DATA(X)
IF X#1>0
if "^.125^.25^.375^.5^.625^.75^.875^"'[(U_(X#1)_U)
KILL X
+7 QUIT
End DoDot:1
+8 QUIT ''$DATA(X)
+9 ;
HE(X) ; HEARING
+1 if "^A^N^"'[(U_X_U)
KILL X
+2 QUIT ''$DATA(X)
+3 ;
HT(X) ; HEIGHT
+1 SET X=$$CNV^GMVDCCNV(X,GMVMSYS,"S",GMVTYPE)
+2 if X'=+X!(X>100)!(X<1)!(X?.E1"."3.N)
KILL X
+3 QUIT ''$DATA(X)
+4 ;
P(X) ; PULSE
+1 if +X'=X!(X>300)!(X<0)!(X?.E1".".N)
KILL X
+2 QUIT ''$DATA(X)
+3 ;
PN(X) ; PAIN
+1 if "^0^1^2^3^4^5^6^7^8^9^10^99^"'[(U_X_U)
KILL X
+2 QUIT ''$DATA(X)
+3 ;
PO2(X) ; PULSE OXIMETRY
+1 if X<0!(X>100)!(X?.E1".".N)
KILL X
+2 QUIT ''$DATA(X)
+3 ;
R(X) ; RESPIRATION
+1 if X'=+X!(X>100)!(X<0)!(X?.E1".".N)
KILL X
+2 QUIT ''$DATA(X)
+3 ;
T(X) ; TEMPERATURE
+1 SET X=$$CNV^GMVDCCNV(X,GMVMSYS,"S",GMVTYPE)
+2 if X'=+X!(X>120)!(X<45)!(X?.E1"."3.N)
KILL X
+3 QUIT ''$DATA(X)
+4 ;
TON(X) ; TONOMETRY
+1 NEW I,Y
+2 if (X'?1.2N1"/"1.2N)&(X'?1.2N1"/")&(X'?1"/"1.2N)
KILL X
+3 IF $DATA(X)
FOR I=1,2
SET Y=$PIECE(X,"/",I)
IF Y]""
IF Y'=+Y!(Y>80)!(Y<0)
KILL X
QUIT
+4 QUIT ''$DATA(X)
+5 ;
VC(X) ; VISION CORRECTED
+1 NEW I,Y
+2 if (X'?1.3N1"/"1.3N)&(X'?1.3N1"/")&(X'?1"/"1.3N)
KILL X
+3 IF $DATA(X)
FOR I=1,2
SET Y=$PIECE(X,"/",I)
IF Y]""
IF Y'=+Y!(Y>999)!(Y<10)
KILL X
QUIT
+4 QUIT ''$DATA(X)
+5 ;
VU(X) ; VISION UNCORRECTED
+1 QUIT $$VC(X)
+2 ;
WT(X) ; WEIGHT
+1 SET X=$$CNV^GMVDCCNV(X,GMVMSYS,"S",GMVTYPE)
+2 if X'=+X!(X>1500)!(X'>0)!(X?.E1"."3.N)
KILL X
+3 QUIT ''$DATA(X)