Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: MAGDIRVE

MAGDIRVE.m

Go to the documentation of this file.
  1. MAGDIRVE ;WOIFO/PMK - Serious Fatal Image Processing Error Messages ; 17 Sep 2008 7:42 AM
  1. ;;3.0;IMAGING;**11,30,54**;03-July-2009;;Build 1424
  1. ;; Per VHA Directive 2004-038, this routine should not be modified.
  1. ;; +---------------------------------------------------------------+
  1. ;; | Property of the US Government. |
  1. ;; | No permission to copy or redistribute this software is given. |
  1. ;; | Use of unreleased versions of this software requires the user |
  1. ;; | to execute a written test agreement with the VistA Imaging |
  1. ;; | Development Office of the Department of Veterans Affairs, |
  1. ;; | telephone (301) 734-0100. |
  1. ;; | The Food and Drug Administration classifies this software as |
  1. ;; | a medical device. As such, it may not be changed in any way. |
  1. ;; | Modifications to this software may result in an adulterated |
  1. ;; | medical device under 21CFR820, the use of which is considered |
  1. ;; | to be a violation of US Federal Statutes. |
  1. ;; +---------------------------------------------------------------+
  1. ;;
  1. Q
  1. ;
  1. ; new version for RPC client-server image processing error messages
  1. ;
  1. MAGZERO(RTN,LASTIEN,LASTIMG) ; from ^MAGDIR84 for bad ^MAG(2005)
  1. N TITLE
  1. K MSG
  1. S TITLE="DICOM IMAGE PROCESSING ERROR - IMAGE FILE CORRUPTION"
  1. S MSG(2)="The ^MAG(2005) file has been corrupted so that new images will"
  1. S MSG(3)="overwrite old ones and general image database inconsistency"
  1. S MSG(4)="will result."
  1. S MSG(5)=""
  1. S MSG(6)="Latest internal entry number processed: "
  1. S MSG(6)=MSG(6)_LASTIMG ; ^MAGDICOM(2006.563,1,"LAST IMAGE POINTER")
  1. S MSG(7)="Bad ^MAG(2005,0) internal entry number: "_LASTIEN
  1. D BADERROR(RTN,TITLE,.MSG)
  1. Q
  1. ;
  1. ZERONODE(RTN,LASTIEN,LASTPTR,FILE,FILENAME) ; from ^MAGDIR84
  1. ; invoked for an arbitrary file corrupted value
  1. N TITLE,ZERONODE
  1. K MSG
  1. S TITLE="DICOM IMAGE PROCESSING ERROR - "_FILE_" FILE CORRUPTION"
  1. S MSG(2)="The "_FILENAME_" file has been corrupted so that new reports will"
  1. S MSG(3)="overwrite old ones and general image/report database inconsistency"
  1. S MSG(4)="will result."
  1. S MSG(5)=""
  1. S MSG(6)="Latest internal entry number processed: "
  1. S MSG(6)=MSG(6)_LASTPTR ; from ^MAGDICOM(2006.563,1,"LAST ... POINTER")
  1. S ZERONODE=$S(FILE[")":$P(FILE,")")_",0)",1:FILE_"(0)")
  1. S MSG(7)="Bad "_ZERONODE_" internal entry number: "_LASTIEN
  1. D BADERROR(RTN,TITLE,.MSG)
  1. Q
  1. ;
  1. OBJECT(RTN,MAGGP) ; from ^MAGDIR9B
  1. N TITLE
  1. K MSG
  1. S TITLE="DICOM IMAGE PROCESSING ERROR - WRONG GROUP OBJECT TYPE"
  1. S MSG(2)="The group entry in ^MAG(2005) does not have the proper group"
  1. S MSG(3)="object type."
  1. S MSG(4)=""
  1. S MSG(5)="The expected value is 11. The value in the group entry is "
  1. S MSG(5)=MSG(5)_$P($G(^MAG(2005,MAGGP,0),"^^^^^not defined"),"^",6)_"."
  1. S MSG(6)=""
  1. S MSG(7)="Internal entry number of incorrect group: "_MAGGP
  1. D BADERROR(RTN,TITLE,.MSG)
  1. Q
  1. ;
  1. MISMATCH(RTN,DFN,MAGGP) ; from ^MAGDIR9A/B/E for a patient mismatch
  1. N GROUPDFN,TITLE
  1. K MSG
  1. S TITLE="DICOM IMAGE PROCESSING ERROR - PATIENT MISMATCH PROBLEM"
  1. S GROUPDFN=$P($G(^MAG(2005,MAGGP,0)),"^",7)
  1. S MSG(2)="The image and the group point to different patients."
  1. S MSG(3)=""
  1. S MSG(4)="The Image points to PATIENT file internal entry number "_DFN
  1. S MSG(5)=$$PATDEMO(DFN)
  1. S MSG(6)=""
  1. S MSG(7)="The Group points to PATIENT file internal entry number "_GROUPDFN
  1. S MSG(8)=$$PATDEMO(GROUPDFN)
  1. S MSG(9)=""
  1. S MSG(10)="Internal entry number of group: ^MAG(2005,"_MAGGP_")"
  1. D BADERROR(RTN,TITLE,.MSG)
  1. Q
  1. ;
  1. PATDEMO(DFN) ; display patient demographics
  1. N %,%H,DISYS,DTIME,VA,VADM,VAERR
  1. Q:'$G(DFN) "<null DFN>"
  1. D DEM^VADPT
  1. Q "("_$P($G(VADM(5)),"^",2)_" - "_$P($G(VADM(3)),"^",2)_")" ; sex & dob
  1. ;
  1. RADMISS(RTN,DFN,RARPT,RARPTDFN) ; from ^MAGDIR9A for a patient mismatch
  1. ; this is bad DFN value for the radiology report in ^RARPT
  1. N TITLE
  1. K MSG
  1. S TITLE="DICOM IMAGE PROCESSING ERROR - RAD PATIENT/REPORT MISMATCH"
  1. S MSG(2)="The image and the radiology report point to different patients."
  1. S MSG(3)=""
  1. S MSG(4)="The Image points to PATIENT file internal entry number "_DFN
  1. S MSG(5)=$$PATDEMO(DFN)
  1. S MSG(6)=""
  1. S MSG(7)="The Rad Report points to PATIENT file internal entry number "_RARPTDFN
  1. S MSG(8)=$$PATDEMO(RARPTDFN)
  1. S MSG(9)=""
  1. S MSG(10)="Internal entry number of report: ^RARPT("_RARPT_")"
  1. D BADERROR(RTN,TITLE,.MSG)
  1. Q
  1. ;
  1. TIUMISS(RTN,DFN,TIUIEN,TIUDFN) ; from ^MAGDIR9E for a patient mismatch
  1. ; this is bad DFN value for the consult/procedure request note in ^TIU(8925)
  1. N TITLE
  1. K MSG
  1. S TITLE="DICOM IMAGE PROCESSING ERROR - TIU PATIENT/REPORT MISMATCH"
  1. S MSG(2)="The image and the TIU note point to different patients."
  1. S MSG(3)=""
  1. S MSG(4)="The Image points to PATIENT file internal entry number "_DFN
  1. S MSG(5)=$$PATDEMO(DFN)
  1. S MSG(6)=""
  1. S MSG(7)="The TIU note points to PATIENT file internal entry number "_TIUDFN
  1. S MSG(8)=$$PATDEMO(TIUDFN)
  1. S MSG(9)=""
  1. S MSG(10)="Internal entry number of TIU note: ^TIU(8925,"_TIUIEN_")"
  1. D BADERROR(RTN,TITLE,.MSG)
  1. Q
  1. ;
  1. TIUMISS2(RTN,TIUIEN1,TIUIEN2,TIUXDIEN,MAGGP) ; from ^MAGDIR9E - TIU mismatch
  1. ; mismatch between TIU, TIU External Data File, and the image group
  1. N TITLE
  1. K MSG
  1. S TITLE="DICOM IMAGE PROCESSING ERROR - TIU/IMAGE GROUP MISMATCH"
  1. S MSG(2)="The image group and TIU point to different notes."
  1. S MSG(3)=""
  1. S MSG(4)="TIU points to TUI note ien #"_TIUIEN1
  1. S MSG(5)="The image points to TIU note ien #"_TIUIEN2
  1. S MSG(6)="TIU External Data File (8925.91) ien #"_TIUXDIEN
  1. S MSG(7)="points to image group ien #"_MAGGP
  1. D BADERROR(RTN,TITLE,.MSG)
  1. Q
  1. ;
  1. TMPMISS(RTN,PARENTFP,MAGGP) ; from ^MAGDIR9E
  1. ; the image group does not have 2006.5839 for the PARENT FILE
  1. N TITLE
  1. K MSG
  1. S TITLE="DICOM IMAGE PROCESSING ERROR - IMAGE GROUP MISMATCH"
  1. S MSG(2)="The image group does not point to PARENT FILE 2006.5839."
  1. S MSG(3)=""
  1. S MSG(4)="The image group should point to PARENT FILE 2006.5839."
  1. S MSG(5)="Instead it point to PARENT FILE #"_PARENTFP
  1. S MSG(6)="The image group is ^MAG(2005,"_MAGGP_")"
  1. D BADERROR(RTN,TITLE,.MSG)
  1. Q
  1. ;
  1. IMAGEPTR(RTN,IMAGEPTR,LASTIMG) ; from ^MAGDIR9B for a corrupted image pointer value
  1. N TITLE
  1. K MSG
  1. S TITLE="DICOM IMAGE PROCESSING ERROR - IMAGE ENTRY NUMBER PROBLEM"
  1. S MSG(2)="The internal entry number for this image is less than that of the"
  1. S MSG(3)="last processed image. This will cause new images to overwrite"
  1. S MSG(4)="old ones and general image database inconsistency will result."
  1. S MSG(5)=""
  1. S MSG(6)="Latest internal entry number processed: "
  1. S MSG(6)=MSG(6)_LASTIMG ; ^MAGDICOM(2006.563,1,"LAST IMAGE POINTER")
  1. S MSG(7)="Bad internal entry number of new image: "_IMAGEPTR
  1. D BADERROR(RTN,TITLE,.MSG)
  1. Q
  1. ;
  1. GROUPPTR(RTN,MAGGP,LASTIMG) ; from ^MAGDIR9A for bad group pointer
  1. N TITLE
  1. K MSG
  1. S TITLE="DICOM IMAGE PROCESSING ERROR - GROUP ENTRY NUMBER PROBLEM"
  1. S MSG(2)="The internal entry number for this group is less than that of the"
  1. S MSG(3)="last processed image. This will cause new images to overwrite"
  1. S MSG(4)="old ones and general image database inconsistency will result."
  1. S MSG(5)=""
  1. S MSG(6)="Latest internal entry number processed: "
  1. S MSG(6)=MSG(6)_LASTIMG ; ^MAGDICOM(2006.563,1,"LAST IMAGE POINTER")
  1. S MSG(7)="Bad internal entry number of new group: "_MAGGP
  1. D BADERROR(RTN,TITLE,.MSG)
  1. Q
  1. ;
  1. BADERROR(RTN,TITLE,MSG) ; final common pathway for all msgs
  1. ; invoked by other image processing error checking code as well
  1. N I
  1. S I=$O(MSG(" "),-1)
  1. S MSG(1)=$G(MSG(1)) ; usually null
  1. S MSG(I+1)="Gateway: """_$G(SYSTITLE,"<unknown>")_""""
  1. S MSG(I+2)=""
  1. S MSG(I+3)=" This is a VERY SERIOUS ERROR. Image processing"
  1. S MSG(I+4)=" will be halted until it is resolved."
  1. S MSG(I+5)=""
  1. S MSG(I+6)="Call IRM and the National VistA Support Help Desk (888) 596-HELP"
  1. S MSG(I+7)=""
  1. S MSG(I+8)="Problem detected by routine "_RTN_"."
  1. S MSG(I+9)=""
  1. S MSG("TITLE")=TITLE,MSG("CRITICAL")=1 ; send email to Silver Spring
  1. Q
  1. ;
  1. ERROR(RTN,TITLE,MSG) ; application error - local to the site - no email
  1. N I
  1. S I=$O(MSG(" "),-1)
  1. S MSG(I+1)="Problem detected by routine "_RTN_"."
  1. S MSG(I+2)=""
  1. S MSG("TITLE")=TITLE,MSG("CRITICAL")=0 ; no email to Silver Spring
  1. Q