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

MAGGTERR.m

Go to the documentation of this file.
  1. MAGGTERR ;WOIFO/GEK - IMAGING ERROR TRAP, AND ERROR LOG ; [ 06/20/2001 08:56 ]
  1. ;;3.0;IMAGING;**8,59**;Nov 27, 2007;Build 20
  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. ;; | |
  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. ; Imaging routines should have this code for setting error trap
  1. ; This will enable logging Imaging errors and Sending messages for
  1. ; certain errors etc. later
  1. ;N $ETRAP,$ESTACK S $ETRAP="D ERRA^MAGGTERR"
  1. ;
  1. ; This assumes the Return variable or array is MAGRY or MAGRY()
  1. Q
  1. ERRA ; ERROR TRAP FOR Array Return variables
  1. N ERR S ERR=$$EC^%ZOSV
  1. S MAGRY(0)="0^"_ERR
  1. D LOGERR(ERR)
  1. D @^%ZOSF("ERRTN")
  1. Q
  1. ;
  1. AERRA ; ERROR TRAP FOR Global Return Variables
  1. N ERR S ERR=$$EC^%ZOSV
  1. S @MAGRY@(0)="0^ERROR "_ERR
  1. D LOGERR(ERR)
  1. D @^%ZOSF("ERRTN")
  1. Q
  1. ERR ; ERROR TRAP FOR String Return variables
  1. N ERR S ERR=$$EC^%ZOSV
  1. S MAGRY="0^ERROR "_ERR
  1. D LOGERR(ERR)
  1. D @^%ZOSF("ERRTN")
  1. Q
  1. LOGERR(ERROR) ;
  1. Q:'$G(MAGJOB("SESSION"))
  1. N SESS,WRKS,ERR
  1. S SESS=$G(MAGJOB("SESSION"))
  1. ; Quit if No entry in Session File.
  1. Q:'$D(^MAG(2006.82,SESS,0))
  1. I '$D(^MAG(2006.82,SESS,"ERR",0)) S ^MAG(2006.82,SESS,"ERR",0)="^2006.823A^0^0"
  1. S ERR=$O(^MAG(2006.82,SESS,"ERR"," "),-1)+1
  1. S ^MAG(2006.82,SESS,"ERR",ERR,0)=ERROR
  1. S $P(^MAG(2006.82,SESS,"ERR",0),"^",3,4)=ERR_"^"_ERR
  1. ;
  1. Q:'$G(MAGJOB("WRKSIEN"))
  1. S WRKS=$G(MAGJOB("WRKSIEN"))
  1. ; Quit if No entry in Workstation File.
  1. Q:'$D(^MAG(2006.81,WRKS,0))
  1. S $P(^MAG(2006.81,WRKS,0),"^",11)=ERR
  1. Q