RABWPCE ;HISC/MM - Billing Awareness Project: PCE API ; 3/23/04 10:17am
;;5.0;Radiology/Nuclear Medicine;**41,70**; Mar 16, 1998;Build 7
Q
;
DX(RAO) ; Create ^TMP("RAPXAPI",$J,"DX/PL" for PCE API: Ordering ICD Dx.
; Called from LON+n^RAPCE.
; ^RAO(75.1,RAO,"BAx",0) = ICD Diagnosis^SC^AO^IR^EC^SHAD^MST^HNC
; NOTE: "EC" now represents "SWAC" but this internal value is not being changed. only
; external display text is being modified. This instance of "EC" is passed to PCE and
; PCE will handle converting it to any external value on their end.
; Set an Order" node for Billing Replacement
S ^TMP("RAPXAPI",$J,"PROCEDURE",1,"ORD REFERENCE")=$P(^RAO(75.1,RAO,0),U,7)
I '$D(^RAO(75.1,RAO,"BA")) Q
N RA1,RA2,RA3,RACNT,RADXTYP,RAIND
;
; Create Temp. Array of the Clinical Indicators.
S RAIND(1)="SC",RAIND(2)="AO",RAIND(3)="IR"
S RAIND(4)="EC",RAIND(5)="MST",RAIND(6)="HNC",RAIND(7)="CV",RAIND(8)="SHAD"
;
S RACNT=0
S RA2=^RAO(75.1,RAO,"BA") D DXPL ; Primary Ordering ICD Dx.
S RA1=0
F S RA1=$O(^RAO(75.1,RAO,"BAS",RA1)) Q:+RA1<1 S RA2=^(RA1,0) D DXPL
Q
;
DXPL ; Create "DX/PL" Node.
S RACNT=RACNT+1
S RADXTYP=$S(RACNT=1:"P",1:"S")
S ^TMP("RAPXAPI",$J,"DX/PL",RACNT,"DIAGNOSIS")=$P(RA2,U)
S ^TMP("RAPXAPI",$J,"DX/PL",RACNT,"PRIMARY")=RADXTYP
;F RA3=2:1:8 I $P(RA2,U,RA3)'="" D
F RA3=2:1:9 D
.S ^TMP("RAPXAPI",$J,"DX/PL",RACNT,"PL "_RAIND(RA3-1))=$P(RA2,U,RA3)
Q
;
PROCDX(X) ; Called from PROC^RAPCE.
; Add Ordering ICD Dx to Procedure for Billing Purposes.
N I
F I=1:1:9 Q:'$D(^TMP("RAPXAPI",$J,"DX/PL",I,"DIAGNOSIS")) D
.I I=1 S ^TMP("RAPXAPI",$J,"PROCEDURE",X,"DIAGNOSIS")=^("DIAGNOSIS") Q
.S ^TMP("RAPXAPI",$J,"PROCEDURE",X,"DIAGNOSIS "_I)=^("DIAGNOSIS")
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HRABWPCE 1746 printed Nov 22, 2024@17:43:58 Page 2
RABWPCE ;HISC/MM - Billing Awareness Project: PCE API ; 3/23/04 10:17am
+1 ;;5.0;Radiology/Nuclear Medicine;**41,70**; Mar 16, 1998;Build 7
+2 QUIT
+3 ;
DX(RAO) ; Create ^TMP("RAPXAPI",$J,"DX/PL" for PCE API: Ordering ICD Dx.
+1 ; Called from LON+n^RAPCE.
+2 ; ^RAO(75.1,RAO,"BAx",0) = ICD Diagnosis^SC^AO^IR^EC^SHAD^MST^HNC
+3 ; NOTE: "EC" now represents "SWAC" but this internal value is not being changed. only
+4 ; external display text is being modified. This instance of "EC" is passed to PCE and
+5 ; PCE will handle converting it to any external value on their end.
+6 ; Set an Order" node for Billing Replacement
+7 SET ^TMP("RAPXAPI",$JOB,"PROCEDURE",1,"ORD REFERENCE")=$PIECE(^RAO(75.1,RAO,0),U,7)
+8 IF '$DATA(^RAO(75.1,RAO,"BA"))
QUIT
+9 NEW RA1,RA2,RA3,RACNT,RADXTYP,RAIND
+10 ;
+11 ; Create Temp. Array of the Clinical Indicators.
+12 SET RAIND(1)="SC"
SET RAIND(2)="AO"
SET RAIND(3)="IR"
+13 SET RAIND(4)="EC"
SET RAIND(5)="MST"
SET RAIND(6)="HNC"
SET RAIND(7)="CV"
SET RAIND(8)="SHAD"
+14 ;
+15 SET RACNT=0
+16 ; Primary Ordering ICD Dx.
SET RA2=^RAO(75.1,RAO,"BA")
DO DXPL
+17 SET RA1=0
+18 FOR
SET RA1=$ORDER(^RAO(75.1,RAO,"BAS",RA1))
if +RA1<1
QUIT
SET RA2=^(RA1,0)
DO DXPL
+19 QUIT
+20 ;
DXPL ; Create "DX/PL" Node.
+1 SET RACNT=RACNT+1
+2 SET RADXTYP=$SELECT(RACNT=1:"P",1:"S")
+3 SET ^TMP("RAPXAPI",$JOB,"DX/PL",RACNT,"DIAGNOSIS")=$PIECE(RA2,U)
+4 SET ^TMP("RAPXAPI",$JOB,"DX/PL",RACNT,"PRIMARY")=RADXTYP
+5 ;F RA3=2:1:8 I $P(RA2,U,RA3)'="" D
+6 FOR RA3=2:1:9
Begin DoDot:1
+7 SET ^TMP("RAPXAPI",$JOB,"DX/PL",RACNT,"PL "_RAIND(RA3-1))=$PIECE(RA2,U,RA3)
End DoDot:1
+8 QUIT
+9 ;
PROCDX(X) ; Called from PROC^RAPCE.
+1 ; Add Ordering ICD Dx to Procedure for Billing Purposes.
+2 NEW I
+3 FOR I=1:1:9
if '$DATA(^TMP("RAPXAPI",$JOB,"DX/PL",I,"DIAGNOSIS"))
QUIT
Begin DoDot:1
+4 IF I=1
SET ^TMP("RAPXAPI",$JOB,"PROCEDURE",X,"DIAGNOSIS")=^("DIAGNOSIS")
QUIT
+5 SET ^TMP("RAPXAPI",$JOB,"PROCEDURE",X,"DIAGNOSIS "_I)=^("DIAGNOSIS")
End DoDot:1
+6 QUIT