AUPNOHBW ; IHS/CMI/LAB - CONVERT OFFSPRING HISTORY BIRTH WEIGHT ;
;;2.0;IHS PCC SUITE;;MAY 14, 2009;Build 9
WT ; (OFFSPRING HISTORY BIRTH WEIGHT)
D WTC
Q:'$D(X)
K:+X'=X!(X>15.9375)!(X<2)!(X?.E1"."5N.N) X
Q:'$D(X)
K:X-(X\1)#.0625 X
Q
WTC Q:+X=X!(X'[" ")
Q:'(X?1.2N1" "1.2N!(X?1.2N1" "1.2N1"/"1.2N))
I X'["/" Q:+$P(X," ",2)>16 S X=+X+(+$P(X," ",2)/16) Q
Q:+$P($P(X," ",2),"/",1)'<+$P($P(X," ",2),"/",2)
S X=+X+((+$P(X," ",2)/$P($P(X," ",2),"/",2)))
Q
AUPNOHBW ; IHS/CMI/LAB - CONVERT OFFSPRING HISTORY BIRTH WEIGHT ;
+1 ;;2.0;IHS PCC SUITE;;MAY 14, 2009;Build 9
WT ; (OFFSPRING HISTORY BIRTH WEIGHT)
+1 DO WTC
+2 IF '$DATA(X)
QUIT
+3 IF +X'=X!(X>15.9375)!(X<2)!(X?.E1"."5N.N)
KILL X
+4 IF '$DATA(X)
QUIT
+5 IF X-(X\1)#.0625
KILL X
+6 QUIT
WTC IF +X=X!(X'[" ")
QUIT
+1 IF '(X?1.2N1" "1.2N!(X?1.2N1" "1.2N1"/"1.2N))
QUIT
+2 IF X'["/"
IF +$PIECE(X," ",2)>16
QUIT
SET X=+X+(+$PIECE(X," ",2)/16)
QUIT
+3 IF +$PIECE($PIECE(X," ",2),"/",1)'<+$PIECE($PIECE(X," ",2),"/",2)
QUIT
+4 SET X=+X+((+$PIECE(X," ",2)/$PIECE($PIECE(X," ",2),"/",2)))
+5 QUIT