RABWORD2 ;HOIFO/KAR - Radiology Billing Awareness ; 04 Apr 2014 6:57 AM
;;5.0;Radiology/Nuclear Medicine;**41,70,1003,1006**;Nov 01, 2010;Build 2
;
; Rtn invokes IA #1300-A, #2083, #4419
Q
ORDER ; List Exam Orders to select to copy ICD-9 SC/EC Indicator values from
D HDR S (RAXIT,RACOPY)=0
N RALP,RA751,DIROUT,DIRUT,DTOUT,DUOUT S (RALP,RAXIT)=0
F S RALP=$O(^RAO(75.1,"B",RADFN,RALP)) Q:RALP'>0!(RAXIT) D
.S RA751(0)=$G(^RAO(75.1,RALP,0)),RA751(2)=$P(RA751(0),U,2)
.Q:RA751(2)=""
.S RA751(16)=$P(RA751(0),U,16),RA751(20)=$P(RA751(0),U,20)
.S RA751(5)=+$P(RA751(0),U,5) Q:RA751(5)=1
.S Y=RA751(2),C=$P($G(^DD(75.1,2,0)),U,2) D Y^DIQ S RA751(2)=Y
.S Y=RA751(20),C=$P($G(^DD(75.1,20,0)),U,2) D Y^DIQ S RA751(20)=Y
.S RACOPY=RACOPY+1,RACOPY(RACOPY)=RALP
.W !,RACOPY,?10,$E(RA751(2),1,28),?39
.W $S(RA751(16)]"":$$FMTE^XLFDT(RA751(16),"2D"),1:"")
.W ?52,$E(RA751(20),1,12) ; prints 'SUBMIT REQUEST TO' data
.I $E(IOST,1,2)="C-",($Y>(IOSL-4)) D
..K DIR S DIR(0)="E" D ^DIR K DIR S:'+Y RAXIT=1
..I 'RAXIT W @IOF D HDR
Q
HDR ; Header
D HOME^%ZIS W:$D(RAOPT("ORDEREXAM"))#2 @IOF
W !!,"#",?10,"Last Procedures/New Orders",?39,"Order Date",?52,"Imaging Loc."
W !,"------",?10,"----------------------------",?39,"------------",?52,"------------"
Q
PREV ;Prompt for Copying a previous Order's DX/SC/EC values.
;
;IHS/BJI/DAY - Patch 1006 ICD-10
;Do not ask or display Diagnosis
Q
;End Patch
;
Q:'$D(^XUSEC("PROVIDER",DUZ)) ;user provider key check
;IHS/BJI/DAY - Patch 1003 - Comment out call to VA's IBB package
;Q:'$$CIDC^IBBAPI(RADFN) ;patient insurance & CIDC switch check
;End Patch
N RAPREV S RAPREV=0 K DIR
I $P($G(VAEL(3)),"^") D
.S DIR("B")="NO",DIR("A")="Copy a previous order's ICD codes and SC/EI values",DIR(0)="YO"
.S DIR("?")="Answer 'Y' if you plan to copy ICD-9 Diagnosis codes and Service Connected/Environmental Indicator values to this order." D ^DIR
I '$P($G(VAEL(3)),"^") D
.S DIR("B")="NO",DIR("A")="Copy a previous order's ICD codes",DIR(0)="YO"
.S DIR("?")="Answer 'Y' if you plan to copy ICD-9 Diagnosis codes to this order." D ^DIR
I Y D
.N RACOPY D ORDER
.K DIR S DIR("A")="Select Order # to copy",DIR(0)="NO" D ^DIR
.I '$D(RACOPY(+Y)) W !,"*Invalid selection" S RAPREV=1 Q
.I +Y>0 D
..I '$D(^RAO(75.1,RACOPY(+Y),"BA")) W !,"*No Previous ICD codes entered for this order" Q
..S ^TMP("RACOPY",$J,"BA")=^RAO(75.1,RACOPY(+Y),"BA")
..N RABASEC S RABASEC=0 F S RABASEC=$O(^RAO(75.1,RACOPY(+Y),"BAS",RABASEC)) Q:RABASEC<1 D
...S ^TMP("RACOPY",$J,"BA",$P(^RAO(75.1,RACOPY(+Y),"BAS",RABASEC,0),U,1))=^RAO(75.1,RACOPY(+Y),"BAS",RABASEC,0)
G:RAPREV PREV
Q
ELIG ;List the Service Connected ratios for the patient
N RAY,RAELIG,RASC,RAPERC,RAAO,RAIR,RAEC,RASHAD
D DEM^VADPT,ELIG^VADPT,SVC^VADPT
S RAELIG=$P(VAEL(1),"^",2),RASC=$P(VAEL(3),"^"),RASC=$S(RASC:"YES",RASC=0:"NO",1:""),RAPERC=$P(VAEL(3),"^",2)
S RAAO=$S(VASV(2):"YES",1:"NO"),RAIR=$S(VASV(3):"YES",1:"NO"),RASHAD=$S($G(VASV(11)):"YES",1:"NO")
S DIC=2,DA=RADFN,DR=".322013",DIQ="RAY",DIQ(0)="I" D EN^DIQ1 K DA,DIC,DIQ,DR
S RAEC=RAY(2,RADFN,.322013,"I"),RAEC=$S(RAEC="Y":"YES",1:"NO")
W @IOF,!,VADM(1)_" ("_VA("PID")_") ",$P(VAEL(6),"^",2),!!," * * * Eligibility Information and Service Connected Conditions * * *"
W !!,?5,"Primary Eligibility: "_RAELIG,!,?5,"A/O Exp.: "_RAAO,?22,"ION Rad.: "_RAIR,?40,"SWAC: "_RAEC,?57,"SHAD: "_RASHAD,!
Q
ADDEXAM ;Add DX/SC/EI data to new order when adding order to Last Visit
;
;IHS/BJI/DAY - Patch 1006 ICD-10
;Do not ask or display Diagnosis
Q
;End patch
;
Q:'$D(^XUSEC("PROVIDER",DUZ)) ;user provider key check
;IHS/BJI/DAY - Patch 1003 - Comment out call to VA's IBB package
;Q:'$$CIDC^IBBAPI(RADFN) ;patient insurance & CIDC switch check
;End Patch
N RAOIEN,RACOPY,RABASEC
S RAOIEN=$P(^RADPT(RADFN,"DT",RAVLEDTI,"P",RAVLECNI,0),U,11)
Q:'$D(^RAO(75.1,RAOIEN,"BA"))
S ^TMP("RACOPY",$J,"BA")=^RAO(75.1,RAOIEN,"BA")
S RABASEC=0 F S RABASEC=$O(^RAO(75.1,RAOIEN,"BAS",RABASEC)) Q:RABASEC<1 D
.S ^TMP("RACOPY",$J,"BA",$P(^RAO(75.1,RAOIEN,"BAS",RABASEC,0),U,1))=^RAO(75.1,RAOIEN,"BAS",RABASEC,0)
Q
RABWORD2 ;HOIFO/KAR - Radiology Billing Awareness ; 04 Apr 2014 6:57 AM
+1 ;;5.0;Radiology/Nuclear Medicine;**41,70,1003,1006**;Nov 01, 2010;Build 2
+2 ;
+3 ; Rtn invokes IA #1300-A, #2083, #4419
+4 QUIT
ORDER ; List Exam Orders to select to copy ICD-9 SC/EC Indicator values from
+1 DO HDR
SET (RAXIT,RACOPY)=0
+2 NEW RALP,RA751,DIROUT,DIRUT,DTOUT,DUOUT
SET (RALP,RAXIT)=0
+3 FOR
SET RALP=$ORDER(^RAO(75.1,"B",RADFN,RALP))
IF RALP'>0!(RAXIT)
QUIT
Begin DoDot:1
+4 SET RA751(0)=$GET(^RAO(75.1,RALP,0))
SET RA751(2)=$PIECE(RA751(0),U,2)
+5 IF RA751(2)=""
QUIT
+6 SET RA751(16)=$PIECE(RA751(0),U,16)
SET RA751(20)=$PIECE(RA751(0),U,20)
+7 SET RA751(5)=+$PIECE(RA751(0),U,5)
IF RA751(5)=1
QUIT
+8 SET Y=RA751(2)
SET C=$PIECE($GET(^DD(75.1,2,0)),U,2)
DO Y^DIQ
SET RA751(2)=Y
+9 SET Y=RA751(20)
SET C=$PIECE($GET(^DD(75.1,20,0)),U,2)
DO Y^DIQ
SET RA751(20)=Y
+10 SET RACOPY=RACOPY+1
SET RACOPY(RACOPY)=RALP
+11 WRITE !,RACOPY,?10,$EXTRACT(RA751(2),1,28),?39
+12 WRITE $SELECT(RA751(16)]"":$$FMTE^XLFDT(RA751(16),"2D"),1:"")
+13 ; prints 'SUBMIT REQUEST TO' data
WRITE ?52,$EXTRACT(RA751(20),1,12)
+14 IF $EXTRACT(IOST,1,2)="C-"
IF ($Y>(IOSL-4))
Begin DoDot:2
+15 KILL DIR
SET DIR(0)="E"
DO ^DIR
KILL DIR
IF '+Y
SET RAXIT=1
+16 IF 'RAXIT
WRITE @IOF
DO HDR
End DoDot:2
End DoDot:1
+17 QUIT
HDR ; Header
+1 DO HOME^%ZIS
IF $DATA(RAOPT("ORDEREXAM"))#2
WRITE @IOF
+2 WRITE !!,"#",?10,"Last Procedures/New Orders",?39,"Order Date",?52,"Imaging Loc."
+3 WRITE !,"------",?10,"----------------------------",?39,"------------",?52,"------------"
+4 QUIT
PREV ;Prompt for Copying a previous Order's DX/SC/EC values.
+1 ;
+2 ;IHS/BJI/DAY - Patch 1006 ICD-10
+3 ;Do not ask or display Diagnosis
+4 QUIT
+5 ;End Patch
+6 ;
+7 ;user provider key check
IF '$DATA(^XUSEC("PROVIDER",DUZ))
QUIT
+8 ;IHS/BJI/DAY - Patch 1003 - Comment out call to VA's IBB package
+9 ;Q:'$$CIDC^IBBAPI(RADFN) ;patient insurance & CIDC switch check
+10 ;End Patch
+11 NEW RAPREV
SET RAPREV=0
KILL DIR
+12 IF $PIECE($GET(VAEL(3)),"^")
Begin DoDot:1
+13 SET DIR("B")="NO"
SET DIR("A")="Copy a previous order's ICD codes and SC/EI values"
SET DIR(0)="YO"
+14 SET DIR("?")="Answer 'Y' if you plan to copy ICD-9 Diagnosis codes and Service Connected/Environmental Indicator values to this order."
DO ^DIR
End DoDot:1
+15 IF '$PIECE($GET(VAEL(3)),"^")
Begin DoDot:1
+16 SET DIR("B")="NO"
SET DIR("A")="Copy a previous order's ICD codes"
SET DIR(0)="YO"
+17 SET DIR("?")="Answer 'Y' if you plan to copy ICD-9 Diagnosis codes to this order."
DO ^DIR
End DoDot:1
+18 IF Y
Begin DoDot:1
+19 NEW RACOPY
DO ORDER
+20 KILL DIR
SET DIR("A")="Select Order # to copy"
SET DIR(0)="NO"
DO ^DIR
+21 IF '$DATA(RACOPY(+Y))
WRITE !,"*Invalid selection"
SET RAPREV=1
QUIT
+22 IF +Y>0
Begin DoDot:2
+23 IF '$DATA(^RAO(75.1,RACOPY(+Y),"BA"))
WRITE !,"*No Previous ICD codes entered for this order"
QUIT
+24 SET ^TMP("RACOPY",$JOB,"BA")=^RAO(75.1,RACOPY(+Y),"BA")
+25 NEW RABASEC
SET RABASEC=0
FOR
SET RABASEC=$ORDER(^RAO(75.1,RACOPY(+Y),"BAS",RABASEC))
IF RABASEC<1
QUIT
Begin DoDot:3
+26 SET ^TMP("RACOPY",$JOB,"BA",$PIECE(^RAO(75.1,RACOPY(+Y),"BAS",RABASEC,0),U,1))=^RAO(75.1,RACOPY(+Y),"BAS",RABASEC,0)
End DoDot:3
End DoDot:2
End DoDot:1
+27 IF RAPREV
GOTO PREV
+28 QUIT
ELIG ;List the Service Connected ratios for the patient
+1 NEW RAY,RAELIG,RASC,RAPERC,RAAO,RAIR,RAEC,RASHAD
+2 DO DEM^VADPT
DO ELIG^VADPT
DO SVC^VADPT
+3 SET RAELIG=$PIECE(VAEL(1),"^",2)
SET RASC=$PIECE(VAEL(3),"^")
SET RASC=$SELECT(RASC:"YES",RASC=0:"NO",1:"")
SET RAPERC=$PIECE(VAEL(3),"^",2)
+4 SET RAAO=$SELECT(VASV(2):"YES",1:"NO")
SET RAIR=$SELECT(VASV(3):"YES",1:"NO")
SET RASHAD=$SELECT($GET(VASV(11)):"YES",1:"NO")
+5 SET DIC=2
SET DA=RADFN
SET DR=".322013"
SET DIQ="RAY"
SET DIQ(0)="I"
DO EN^DIQ1
KILL DA,DIC,DIQ,DR
+6 SET RAEC=RAY(2,RADFN,.322013,"I")
SET RAEC=$SELECT(RAEC="Y":"YES",1:"NO")
+7 WRITE @IOF,!,VADM(1)_" ("_VA("PID")_") ",$PIECE(VAEL(6),"^",2),!!," * * * Eligibility Information and Service Connected Conditions * * *"
+8 WRITE !!,?5,"Primary Eligibility: "_RAELIG,!,?5,"A/O Exp.: "_RAAO,?22,"ION Rad.: "_RAIR,?40,"SWAC: "_RAEC,?57,"SHAD: "_RASHAD,!
+9 QUIT
ADDEXAM ;Add DX/SC/EI data to new order when adding order to Last Visit
+1 ;
+2 ;IHS/BJI/DAY - Patch 1006 ICD-10
+3 ;Do not ask or display Diagnosis
+4 QUIT
+5 ;End patch
+6 ;
+7 ;user provider key check
IF '$DATA(^XUSEC("PROVIDER",DUZ))
QUIT
+8 ;IHS/BJI/DAY - Patch 1003 - Comment out call to VA's IBB package
+9 ;Q:'$$CIDC^IBBAPI(RADFN) ;patient insurance & CIDC switch check
+10 ;End Patch
+11 NEW RAOIEN,RACOPY,RABASEC
+12 SET RAOIEN=$PIECE(^RADPT(RADFN,"DT",RAVLEDTI,"P",RAVLECNI,0),U,11)
+13 IF '$DATA(^RAO(75.1,RAOIEN,"BA"))
QUIT
+14 SET ^TMP("RACOPY",$JOB,"BA")=^RAO(75.1,RAOIEN,"BA")
+15 SET RABASEC=0
FOR
SET RABASEC=$ORDER(^RAO(75.1,RAOIEN,"BAS",RABASEC))
IF RABASEC<1
QUIT
Begin DoDot:1
+16 SET ^TMP("RACOPY",$JOB,"BA",$PIECE(^RAO(75.1,RAOIEN,"BAS",RABASEC,0),U,1))=^RAO(75.1,RAOIEN,"BAS",RABASEC,0)
End DoDot:1
+17 QUIT