IBDFN8 ;ALB/CJM - ENCOUNTER FORM - PCE GDI INPUT TRANSFORMS ;08/10/95
;;3.0;AUTOMATED INFO COLLECTION SYS;**25,38,51,63**;APR 24, 1997;Build 80
;
;
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)
S X=$$CPT^ICPTCOD(X)
I +X=-1 K X Q
I $P(X,U,7)'=1 K X ;(CSV) status 0-inactive 1-active
Q
;
INPUTICD(ICD) ;changes X, an ICD-9 code, into its ien
;
;S ICD=$$UPP(ICD)
;S X=$O(^ICD9("BA",ICD_" ",0)) I 'X K X Q
;;K:'X X
;
;(CSV) status 0-inactive 1-active
;I $P($$ICDDX^ICDCODE(X),U,10)'=1 K X
N IBDCODE,IBDSTAT
I $G(ICD)="" K X Q
S IBDCODE=$$ICDDATA^ICDXCODE("ICD9",ICD,DT) S X=$P(IBDCODE,U) I 'X!(X<1) K X Q
S IBDSTAT=$P(IBDCODE,U,10) I IBDSTAT'=1 K X
Q
INPICD10(ICD) ;changes X, an ICD-10 code, into its ien
;-- does X point to a valid ICD-10 code? Kills X if not.
; -- input the icd code in X
;
N IBDCODE,IBDSTAT
I $G(ICD)="" K X Q
S IBDCODE=$$ICDDATA^ICDXCODE("10D",ICD,DT) S X=$P(IBDCODE,U) I 'X!(X<1) K X Q
S IBDSTAT=$P(IBDCODE,U,10) I IBDSTAT'=1 K X
Q
;
UPP(X) ; -- convert lower case to upper case (especially when in codes above)
Q $TR(X,"zxcvbnmlkjhgfdsaqwertyuiop","ZXCVBNMLKJHGFDSAQWERTYUIOP")
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HIBDFN8 1288 printed Dec 13, 2024@02:53:01 Page 2
IBDFN8 ;ALB/CJM - ENCOUNTER FORM - PCE GDI INPUT TRANSFORMS ;08/10/95
+1 ;;3.0;AUTOMATED INFO COLLECTION SYS;**25,38,51,63**;APR 24, 1997;Build 80
+2 ;
+3 ;
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 ;;S X=+$$CPT^ICPTCOD(X)
+8 SET X=$$CPT^ICPTCOD(X)
+9 IF +X=-1
KILL X
QUIT
+10 ;(CSV) status 0-inactive 1-active
IF $PIECE(X,U,7)'=1
KILL X
+11 QUIT
+12 ;
INPUTICD(ICD) ;changes X, an ICD-9 code, into its ien
+1 ;
+2 ;S ICD=$$UPP(ICD)
+3 ;S X=$O(^ICD9("BA",ICD_" ",0)) I 'X K X Q
+4 ;;K:'X X
+5 ;
+6 ;(CSV) status 0-inactive 1-active
+7 ;I $P($$ICDDX^ICDCODE(X),U,10)'=1 K X
+8 NEW IBDCODE,IBDSTAT
+9 IF $GET(ICD)=""
KILL X
QUIT
+10 SET IBDCODE=$$ICDDATA^ICDXCODE("ICD9",ICD,DT)
SET X=$PIECE(IBDCODE,U)
IF 'X!(X<1)
KILL X
QUIT
+11 SET IBDSTAT=$PIECE(IBDCODE,U,10)
IF IBDSTAT'=1
KILL X
+12 QUIT
INPICD10(ICD) ;changes X, an ICD-10 code, into its ien
+1 ;-- does X point to a valid ICD-10 code? Kills X if not.
+2 ; -- input the icd code in X
+3 ;
+4 NEW IBDCODE,IBDSTAT
+5 IF $GET(ICD)=""
KILL X
QUIT
+6 SET IBDCODE=$$ICDDATA^ICDXCODE("10D",ICD,DT)
SET X=$PIECE(IBDCODE,U)
IF 'X!(X<1)
KILL X
QUIT
+7 SET IBDSTAT=$PIECE(IBDCODE,U,10)
IF IBDSTAT'=1
KILL X
+8 QUIT
+9 ;
UPP(X) ; -- convert lower case to upper case (especially when in codes above)
+1 QUIT $TRANSLATE(X,"zxcvbnmlkjhgfdsaqwertyuiop","ZXCVBNMLKJHGFDSAQWERTYUIOP")