RAIPS213 ;WOIFO/KLM - Post-init Driver, patch 213 ; Apr 11, 2024@13:41:13
;;5.0;Radiology/Nuclear Medicine;**213**;Mar 16, 1998;Build 1
;
;This patch will add five HCC Liver study procedures to the radiology package
;and sync them with CPRS.
;
Q
;
EN ;entry point
N RAI,RA01,RA6,RA7,RA9,RA11,RA12,RA17,RA20,RA125,RA500,RA731,RADATA,RATXT,RAERR,RASAV,RAY,RAGOOD
F RAI=1:1 S RADATA=$T(PROCS+RAI) Q:RADATA="" D
.S RA01=$P($P(RADATA,";",3),"^"),RA6=$P(RADATA,"^",2),RA7=$P(RADATA,"^",3),RA9=$P(RADATA,"^",4),RA11=$P(RADATA,"^",5)
.S RA12=$P(RADATA,"^",6),RA17=$P(RADATA,"^",7),RA20=$P(RADATA,"^",8),RA125=$P(RADATA,"^",9),RA500=$P(RADATA,"^",10),RA731=$P(RADATA,"^",11)
.;Create .01 first
.S RAGOOD=1
.N RAFDA,RAR S RAR="RAFDA(71,""?+1,"")" ;FDA root -check for existing entry
.S @RAR@(.01)=RA01 ;Name
.K RAERR,RAIENS,RADA
.D UPDATE^DIE(,"RAFDA","RADA","RAERR") K RAFDA
.I $D(RAERR(1,"DIERR"))#2 D MES^XPDUTL("An error occured filing data for "_RA01) Q
.;Update rest of fields
.Q:'$D(RADA)
.I $G(RADA(1,0))'="+" D MES^XPDUTL("Error Filing Data - procedure already exists. "_RA01) Q
.S RASAV=RADA(1),RAIENS=RADA(1)_","
.S RAY=RASAV_"^"_RA01_"^"_1 ;for OI update
.S RAR="RAFDA(71,RAIENS)"
.S:$D(RA6) @RAR@(6)=RA6 ;Procedure Type
.S:$D(RA7) @RAR@(7)=RA7 ;Staff Review
.S:$D(RA9) @RAR@(9)=RA9 ;CPT
.S:$D(RA11) @RAR@(11)=RA11 ;Rad approval
.S:$D(RA12) @RAR@(12)=RA12 ;Imaging Type
.S:$D(RA17) @RAR@(17)=RA17 ;Display Edu Desc
.S:$D(RA20) @RAR@(20)=RA20 ;Contrast Used
.K RAERR D FILE^DIE("E","RAFDA","RAERR") K RAFDA
.I $D(RAERR(1,"DIERR"))#2 S RAGOOD=0 D MES^XPDUTL("An error occured filing data for "_RA01)
.;
CM .;Contrast Media (RA125)
.I RA20="Yes" D
..K RAFDA,RAERR,RAIENS
..S RAIENS="+1,"_RASAV_","
..S RAFDA(71.0125,RAIENS,.01)=RA125
..D UPDATE^DIE("","RAFDA","RAIENS","RAERR")
..I $D(RAERR(1,"DIERR"))#2 S RAGOOD=0 D MES^XPDUTL("An error occured filing Contrast Media data for "_RA01) Q
..;Update Contrast Activity Log
..D FILEAU^RAMAINU1(RASAV,RA125)
..Q
.;
ED .;Educational Description (RA500)
.K RAFDA,RAERR,RAIENS,^TMP($J,"RA213")
.S RAIENS=RASAV_","
.S:$D(RA500) ^TMP($J,"RA213",1,0)=$P(RA500,"|")
.I $P(RA500,"|",2)]"" S ^TMP($J,"RA213",2,0)=$P(RA500,"|",2)
.D WP^DIE(71,RAIENS,500,"","^TMP($J,""RA213"")","RAERR")
.I $D(RAERR(1,"DIERR"))#2 S RAGOOD=0 D MES^XPDUTL("An error occured filing the Educational Description for "_RA01)
.;
MOD .;Modality (RA731)
.K RAFDA,RAERR,RAIENS
.S RAIENS="+1,"_RASAV_","
.S:$D(RA731) RAFDA(71.0731,RAIENS,.01)=RA731
.D UPDATE^DIE("","RAFDA","RAIENS","RAERR")
.I $D(RAERR(1,"DIERR"))#2 S RAGOOD=0 D MES^XPDUTL("An error occured filing the Modality data for "_RA01)
.;
OI .;Update Orderable Item
.N RAENALL,RAFILE,RASTAT
.S RAENALL=0,RAFILE=71,RASTAT=1,RAY=RASAV_"^"_RA01_"^"_1
.D PROC^RAO7MFN(RAENALL,RAFILE,RASTAT,RAY)
.;
.;Feedback to installer
.I RAGOOD=1 D MES^XPDUTL(RA01_" Procedure successfully created!")
.I RAGOOD=0 D MES^XPDUTL("There were errors creating procedure "_RA01_". Contact the radiology developers.")
.Q
K ^TMP($J,"RA213"),RAFDA,RAERR,RAIENS
Q
; Field # Name
; ----------------------------
; .01 NAME
; 6 TYPE OF PROCEDURE
; 7 STAFF REVIEW REQUIRED
; 9 CPT CODE
; 11 RAD/NM PHYS APPROVAL REQUIRED
; 12 TYPE OF IMAGING
; 17 DISPLAY ED DESC WHEN ORDERED
; 20 CONTRAST MEDIA USED
; 125 CONTRAST MEDIA [71.0125]
; 500 EDUCATIONAL DESCRIPTION [71.09]
; 731 MODALITY [71.0731]
;
PROCS ;Liver Procedures
;;MRI LIVER W/WO IV CONTRAST HCC^DETAILED^YES^74183^NO^MAGNETIC RESONANCE IMAGING^YES^Yes^L^For detection and characterization of liver lesions in patients with|cirrhosis, chronic hepatitis B, and/or fibrosis.^MR
;;CT LIVER W/ IV CONTRAST 3 PHASE HCC^DETAILED^YES^74160^NO^CT SCAN^YES^Yes^N^For detection and characterization of liver lesions in patients with|cirrhosis, chronic hepatitis B, and/or fibrosis.^CT
;;CT LIVER W/WO IV CONTRAST 4 PHASE HCC^DETAILED^YES^74170^NO^CT SCAN^YES^Yes^N^For posttreatment HCC surveillance/detection/characterization.|^CT
;;US LIVER HCC SCREENING^DETAILED^YES^76705^NO^ULTRASOUND^YES^^^For HCC screening in patients with cirrhosis, chronic hepatitis B, and/or|fibrosis.^US
;;US LIVER W/CONTRAST HCC^DETAILED^YES^76978^NO^ULTRASOUND^YES^Yes^M^For detection and characterization of liver lesions in patients with|cirrhosis, chronic hepatitis B, and/or fibrosis.^US
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HRAIPS213 4536 printed Dec 13, 2024@02:36:25 Page 2
RAIPS213 ;WOIFO/KLM - Post-init Driver, patch 213 ; Apr 11, 2024@13:41:13
+1 ;;5.0;Radiology/Nuclear Medicine;**213**;Mar 16, 1998;Build 1
+2 ;
+3 ;This patch will add five HCC Liver study procedures to the radiology package
+4 ;and sync them with CPRS.
+5 ;
+6 QUIT
+7 ;
EN ;entry point
+1 NEW RAI,RA01,RA6,RA7,RA9,RA11,RA12,RA17,RA20,RA125,RA500,RA731,RADATA,RATXT,RAERR,RASAV,RAY,RAGOOD
+2 FOR RAI=1:1
SET RADATA=$TEXT(PROCS+RAI)
if RADATA=""
QUIT
Begin DoDot:1
+3 SET RA01=$PIECE($PIECE(RADATA,";",3),"^")
SET RA6=$PIECE(RADATA,"^",2)
SET RA7=$PIECE(RADATA,"^",3)
SET RA9=$PIECE(RADATA,"^",4)
SET RA11=$PIECE(RADATA,"^",5)
+4 SET RA12=$PIECE(RADATA,"^",6)
SET RA17=$PIECE(RADATA,"^",7)
SET RA20=$PIECE(RADATA,"^",8)
SET RA125=$PIECE(RADATA,"^",9)
SET RA500=$PIECE(RADATA,"^",10)
SET RA731=$PIECE(RADATA,"^",11)
+5 ;Create .01 first
+6 SET RAGOOD=1
+7 ;FDA root -check for existing entry
NEW RAFDA,RAR
SET RAR="RAFDA(71,""?+1,"")"
+8 ;Name
SET @RAR@(.01)=RA01
+9 KILL RAERR,RAIENS,RADA
+10 DO UPDATE^DIE(,"RAFDA","RADA","RAERR")
KILL RAFDA
+11 IF $DATA(RAERR(1,"DIERR"))#2
DO MES^XPDUTL("An error occured filing data for "_RA01)
QUIT
+12 ;Update rest of fields
+13 if '$DATA(RADA)
QUIT
+14 IF $GET(RADA(1,0))'="+"
DO MES^XPDUTL("Error Filing Data - procedure already exists. "_RA01)
QUIT
+15 SET RASAV=RADA(1)
SET RAIENS=RADA(1)_","
+16 ;for OI update
SET RAY=RASAV_"^"_RA01_"^"_1
+17 SET RAR="RAFDA(71,RAIENS)"
+18 ;Procedure Type
if $DATA(RA6)
SET @RAR@(6)=RA6
+19 ;Staff Review
if $DATA(RA7)
SET @RAR@(7)=RA7
+20 ;CPT
if $DATA(RA9)
SET @RAR@(9)=RA9
+21 ;Rad approval
if $DATA(RA11)
SET @RAR@(11)=RA11
+22 ;Imaging Type
if $DATA(RA12)
SET @RAR@(12)=RA12
+23 ;Display Edu Desc
if $DATA(RA17)
SET @RAR@(17)=RA17
+24 ;Contrast Used
if $DATA(RA20)
SET @RAR@(20)=RA20
+25 KILL RAERR
DO FILE^DIE("E","RAFDA","RAERR")
KILL RAFDA
+26 IF $DATA(RAERR(1,"DIERR"))#2
SET RAGOOD=0
DO MES^XPDUTL("An error occured filing data for "_RA01)
+27 ;
CM ;Contrast Media (RA125)
+1 IF RA20="Yes"
Begin DoDot:2
+2 KILL RAFDA,RAERR,RAIENS
+3 SET RAIENS="+1,"_RASAV_","
+4 SET RAFDA(71.0125,RAIENS,.01)=RA125
+5 DO UPDATE^DIE("","RAFDA","RAIENS","RAERR")
+6 IF $DATA(RAERR(1,"DIERR"))#2
SET RAGOOD=0
DO MES^XPDUTL("An error occured filing Contrast Media data for "_RA01)
QUIT
+7 ;Update Contrast Activity Log
+8 DO FILEAU^RAMAINU1(RASAV,RA125)
+9 QUIT
End DoDot:2
+10 ;
ED ;Educational Description (RA500)
+1 KILL RAFDA,RAERR,RAIENS,^TMP($JOB,"RA213")
+2 SET RAIENS=RASAV_","
+3 if $DATA(RA500)
SET ^TMP($JOB,"RA213",1,0)=$PIECE(RA500,"|")
+4 IF $PIECE(RA500,"|",2)]""
SET ^TMP($JOB,"RA213",2,0)=$PIECE(RA500,"|",2)
+5 DO WP^DIE(71,RAIENS,500,"","^TMP($J,""RA213"")","RAERR")
+6 IF $DATA(RAERR(1,"DIERR"))#2
SET RAGOOD=0
DO MES^XPDUTL("An error occured filing the Educational Description for "_RA01)
+7 ;
MOD ;Modality (RA731)
+1 KILL RAFDA,RAERR,RAIENS
+2 SET RAIENS="+1,"_RASAV_","
+3 if $DATA(RA731)
SET RAFDA(71.0731,RAIENS,.01)=RA731
+4 DO UPDATE^DIE("","RAFDA","RAIENS","RAERR")
+5 IF $DATA(RAERR(1,"DIERR"))#2
SET RAGOOD=0
DO MES^XPDUTL("An error occured filing the Modality data for "_RA01)
+6 ;
OI ;Update Orderable Item
+1 NEW RAENALL,RAFILE,RASTAT
+2 SET RAENALL=0
SET RAFILE=71
SET RASTAT=1
SET RAY=RASAV_"^"_RA01_"^"_1
+3 DO PROC^RAO7MFN(RAENALL,RAFILE,RASTAT,RAY)
+4 ;
+5 ;Feedback to installer
+6 IF RAGOOD=1
DO MES^XPDUTL(RA01_" Procedure successfully created!")
+7 IF RAGOOD=0
DO MES^XPDUTL("There were errors creating procedure "_RA01_". Contact the radiology developers.")
+8 QUIT
End DoDot:1
+9 KILL ^TMP($JOB,"RA213"),RAFDA,RAERR,RAIENS
+10 QUIT
+11 ; Field # Name
+12 ; ----------------------------
+13 ; .01 NAME
+14 ; 6 TYPE OF PROCEDURE
+15 ; 7 STAFF REVIEW REQUIRED
+16 ; 9 CPT CODE
+17 ; 11 RAD/NM PHYS APPROVAL REQUIRED
+18 ; 12 TYPE OF IMAGING
+19 ; 17 DISPLAY ED DESC WHEN ORDERED
+20 ; 20 CONTRAST MEDIA USED
+21 ; 125 CONTRAST MEDIA [71.0125]
+22 ; 500 EDUCATIONAL DESCRIPTION [71.09]
+23 ; 731 MODALITY [71.0731]
+24 ;
PROCS ;Liver Procedures
+1 ;;MRI LIVER W/WO IV CONTRAST HCC^DETAILED^YES^74183^NO^MAGNETIC RESONANCE IMAGING^YES^Yes^L^For detection and characterization of liver lesions in patients with|cirrhosis, chronic hepatitis B, and/or fibrosis.^MR
+2 ;;CT LIVER W/ IV CONTRAST 3 PHASE HCC^DETAILED^YES^74160^NO^CT SCAN^YES^Yes^N^For detection and characterization of liver lesions in patients with|cirrhosis, chronic hepatitis B, and/or fibrosis.^CT
+3 ;;CT LIVER W/WO IV CONTRAST 4 PHASE HCC^DETAILED^YES^74170^NO^CT SCAN^YES^Yes^N^For posttreatment HCC surveillance/detection/characterization.|^CT
+4 ;;US LIVER HCC SCREENING^DETAILED^YES^76705^NO^ULTRASOUND^YES^^^For HCC screening in patients with cirrhosis, chronic hepatitis B, and/or|fibrosis.^US
+5 ;;US LIVER W/CONTRAST HCC^DETAILED^YES^76978^NO^ULTRASOUND^YES^Yes^M^For detection and characterization of liver lesions in patients with|cirrhosis, chronic hepatitis B, and/or fibrosis.^US