LRLRRVF ;VA/SLC/GDU - LAB REFERENCE RANGE VALUE FORMATTING - LAB UTILITY; 22-Oct-2013 09:22 ; MKK
;;5.2;LAB SERVICE;**372,1027,1033**;NOV 01, 1997
;
EN(RLV,RHV) ;Entry point for this routine
;RLV - Range low value
;RHV - Range high value
;
;If both are null return the low value and quit
; I RLV="",RHV="" Q RLV
I $TR(RLV," ")="",$TR(RHV," ")="" Q RLV ; IHS/MSC/MKK - LR*5.2*1033
;
I RLV["Ref"&(RHV="") Q RLV
I RHV["REF"&(RLV="") Q RHV
I RLV["Ref"&(RHV["Ref") Q $$TRIM^XLFSTR($P(RLV,"Ref:",2)_" "_$P(RHV,"Ref:",2),"LR"," ")
;
;If only the low is defined
I RLV'="",RHV="" D Q RLV
. I $E(RLV)'?1N S RLV="Ref: "_RLV Q ; IHS/MSC/MKK - LR*5.2*1033 -- If first character is non-numeric, just return it
. I RLV=0 S RLV="Ref: >="_RLV Q
. I ($E(RLV,1,1)="<")!($E(RLV,1,1)=">") S RLV="Ref: "_RLV Q
. I (RLV?.N.".".N) S RLV="Ref: >="_RLV Q
. S RLV="Ref: "_RLV
;
;If only the high is defined
I RLV="",RHV'="" D Q RHV
. I $E(RHV)'?1N S RHV="Ref: "_RHV Q ; IHS/MSC/MKK - LR*5.2*1033 -- If first character is non-numeric, just return it
. I RHV=0 S RHV="Ref: "_RHV Q
. I ($E(RHV,1,1)="<")!($E(RHV,1,1)=">") S RHV="Ref: "_RHV Q
. I (RHV?.N.".".N) S RHV="Ref: <="_RHV Q
. S RHV="Ref: "_RHV
;
;If both are defined
Q RLV_" - "_RHV
LRLRRVF ;VA/SLC/GDU - LAB REFERENCE RANGE VALUE FORMATTING - LAB UTILITY; 22-Oct-2013 09:22 ; MKK
+1 ;;5.2;LAB SERVICE;**372,1027,1033**;NOV 01, 1997
+2 ;
EN(RLV,RHV) ;Entry point for this routine
+1 ;RLV - Range low value
+2 ;RHV - Range high value
+3 ;
+4 ;If both are null return the low value and quit
+5 ; I RLV="",RHV="" Q RLV
+6 ; IHS/MSC/MKK - LR*5.2*1033
IF $TRANSLATE(RLV," ")=""
IF $TRANSLATE(RHV," ")=""
QUIT RLV
+7 ;
+8 IF RLV["Ref"&(RHV="")
QUIT RLV
+9 IF RHV["REF"&(RLV="")
QUIT RHV
+10 IF RLV["Ref"&(RHV["Ref")
QUIT $$TRIM^XLFSTR($PIECE(RLV,"Ref:",2)_" "_$PIECE(RHV,"Ref:",2),"LR"," ")
+11 ;
+12 ;If only the low is defined
+13 IF RLV'=""
IF RHV=""
Begin DoDot:1
+14 ; IHS/MSC/MKK - LR*5.2*1033 -- If first character is non-numeric, just return it
IF $EXTRACT(RLV)'?1N
SET RLV="Ref: "_RLV
QUIT
+15 IF RLV=0
SET RLV="Ref: >="_RLV
QUIT
+16 IF ($EXTRACT(RLV,1,1)="<")!($EXTRACT(RLV,1,1)=">")
SET RLV="Ref: "_RLV
QUIT
+17 IF (RLV?.N.".".N)
SET RLV="Ref: >="_RLV
QUIT
+18 SET RLV="Ref: "_RLV
End DoDot:1
QUIT RLV
+19 ;
+20 ;If only the high is defined
+21 IF RLV=""
IF RHV'=""
Begin DoDot:1
+22 ; IHS/MSC/MKK - LR*5.2*1033 -- If first character is non-numeric, just return it
IF $EXTRACT(RHV)'?1N
SET RHV="Ref: "_RHV
QUIT
+23 IF RHV=0
SET RHV="Ref: "_RHV
QUIT
+24 IF ($EXTRACT(RHV,1,1)="<")!($EXTRACT(RHV,1,1)=">")
SET RHV="Ref: "_RHV
QUIT
+25 IF (RHV?.N.".".N)
SET RHV="Ref: <="_RHV
QUIT
+26 SET RHV="Ref: "_RHV
End DoDot:1
QUIT RHV
+27 ;
+28 ;If both are defined
+29 QUIT RLV_" - "_RHV