IBDFN8 ;ALB/CJM - ENCOUNTER FORM - PCE GDI INPUT TRANSFORMS;AUG 10, 1995
;;3.0;AUTOMATED INFO COLLECTION SYS;**25,38**;APR 24, 1997
;
INPUTCPT(X) ;changes X,a CPT code, into its ien
;
; --input: cpt code
;
; --output: ien of cpt code (file #81)
;
S X=$$UPP(X)
S X=+$$CPT^ICPTCOD(X)
I +X=-1 K X Q
Q
;
INPUTICD(ICD) ;changes X, an ICD9 code, into its ien
;
S ICD=$$UPP(ICD)
S X=$O(^ICD9("BA",ICD_" ",0))
K:'X X
Q
;
UPP(X) ; -- convert lower case to upper case (especially when in codes above)
Q $TR(X,"zxcvbnmlkjhgfdsaqwertyuiop","ZXCVBNMLKJHGFDSAQWERTYUIOP")
IBDFN8 ;ALB/CJM - ENCOUNTER FORM - PCE GDI INPUT TRANSFORMS;AUG 10, 1995
+1 ;;3.0;AUTOMATED INFO COLLECTION SYS;**25,38**;APR 24, 1997
+2 ;
INPUTCPT(X) ;changes X,a CPT code, into its ien
+1 ;
+2 ; --input: cpt code
+3 ;
+4 ; --output: ien of cpt code (file #81)
+5 ;
+6 SET X=$$UPP(X)
+7 SET X=+$$CPT^ICPTCOD(X)
+8 IF +X=-1
KILL X
QUIT
+9 QUIT
+10 ;
INPUTICD(ICD) ;changes X, an ICD9 code, into its ien
+1 ;
+2 SET ICD=$$UPP(ICD)
+3 SET X=$ORDER(^ICD9("BA",ICD_" ",0))
+4 IF 'X
KILL X
+5 QUIT
+6 ;
UPP(X) ; -- convert lower case to upper case (especially when in codes above)
+1 QUIT $TRANSLATE(X,"zxcvbnmlkjhgfdsaqwertyuiop","ZXCVBNMLKJHGFDSAQWERTYUIOP")