RABWUTL ;HISC/SM - Billing Aware utilities ; 04 Apr 2014 7:07 AM
;;5.0;Radiology/Nuclear Medicine;**41,70,1006**;Mar 16,1998;Build 2
Q
ODX(RA) ;ordering diagnosis
;RA = ien file 75.1
;RAX(n) = ien80^SC^AO^IR^SWAC^MST^SHAD^HNC^CV where pieces 2+ has 1=Y
;N RAX,RA1,I,J,RABA,RA751,X
S RA751=$S($D(RAORD0):RAORD0,1:^RAO(75.1,RA,0))
D GETDX
D WRTDX
Q
GETDX ; get DX and Clin. Indicators from file 75.1
Q:'$D(^RAO(75.1,RA,"BA")) S RAX(1)=^("BA")
S I=0,RA1=1
F S I=$O(^RAO(75.1,RA,"BAS",I)) Q:'I D
. S RA1=RA1+1
. S RAX(RA1)=^RAO(75.1,RA,"BAS",I,0)
.Q
Q
WRTDX ; write DX and Clin. Inds.
Q:'$O(RAX(0))
W !,"Ordering Diagnoses:"
S I=0
F S I=$O(RAX(I)) Q:'I D
. ;
. ;IHS/BJI/DAY - Patch 1006 ICD-10
. ;Change next line to use ICD API
. ;W !?2,$$GET1^DIQ(80,+RAX(I),.01),?10,$$GET1^DIQ(80,+RAX(I),3)
. W !?2,$P($$ICDDX^ICDCODE(+RAX(I)),U,2),?10,$P($$ICDDX^ICDCODE(+RAX(I)),U,4)
. ;End patch
. ;
. S X=$P(RAX(I),U,2,9)
. Q:X'["1"
. W !,?10,"Clinical Indicator(s): "
. F J=1:1:8 I $P(X,U,J) W $S(J=1:"SC",J=2:"AO",J=3:"IR",J=4:"SWAC",J=5:"MST",J=6:"HNC",J=7:"CV",1:"SHAD") W:$P(X,U,J+1,8)["1" ","
. Q
Q
RABWUTL ;HISC/SM - Billing Aware utilities ; 04 Apr 2014 7:07 AM
+1 ;;5.0;Radiology/Nuclear Medicine;**41,70,1006**;Mar 16,1998;Build 2
+2 QUIT
ODX(RA) ;ordering diagnosis
+1 ;RA = ien file 75.1
+2 ;RAX(n) = ien80^SC^AO^IR^SWAC^MST^SHAD^HNC^CV where pieces 2+ has 1=Y
+3 ;N RAX,RA1,I,J,RABA,RA751,X
+4 SET RA751=$SELECT($DATA(RAORD0):RAORD0,1:^RAO(75.1,RA,0))
+5 DO GETDX
+6 DO WRTDX
+7 QUIT
GETDX ; get DX and Clin. Indicators from file 75.1
+1 IF '$DATA(^RAO(75.1,RA,"BA"))
QUIT
SET RAX(1)=^("BA")
+2 SET I=0
SET RA1=1
+3 FOR
SET I=$ORDER(^RAO(75.1,RA,"BAS",I))
IF 'I
QUIT
Begin DoDot:1
+4 SET RA1=RA1+1
+5 SET RAX(RA1)=^RAO(75.1,RA,"BAS",I,0)
+6 QUIT
End DoDot:1
+7 QUIT
WRTDX ; write DX and Clin. Inds.
+1 IF '$ORDER(RAX(0))
QUIT
+2 WRITE !,"Ordering Diagnoses:"
+3 SET I=0
+4 FOR
SET I=$ORDER(RAX(I))
IF 'I
QUIT
Begin DoDot:1
+5 ;
+6 ;IHS/BJI/DAY - Patch 1006 ICD-10
+7 ;Change next line to use ICD API
+8 ;W !?2,$$GET1^DIQ(80,+RAX(I),.01),?10,$$GET1^DIQ(80,+RAX(I),3)
+9 WRITE !?2,$PIECE($$ICDDX^ICDCODE(+RAX(I)),U,2),?10,$PIECE($$ICDDX^ICDCODE(+RAX(I)),U,4)
+10 ;End patch
+11 ;
+12 SET X=$PIECE(RAX(I),U,2,9)
+13 IF X'["1"
QUIT
+14 WRITE !,?10,"Clinical Indicator(s): "
+15 FOR J=1:1:8
IF $PIECE(X,U,J)
WRITE $SELECT(J=1:"SC",J=2:"AO",J=3:"IR",J=4:"SWAC",J=5:"MST",J=6:"HNC",J=7:"CV",1:"SHAD")
IF $PIECE(X,U,J+1,8)["1"
WRITE ","
+16 QUIT
End DoDot:1
+17 QUIT