source: FOIAVistA/trunk/r/IMAGING-MAG-ZMAG/MAGGTERR.m@ 785

Last change on this file since 785 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 2.4 KB
Line 
1MAGGTERR ;WOIFO/GEK - IMAGING ERROR TRAP, AND ERROR LOG ; [ 06/20/2001 08:56 ]
2 ;;3.0;IMAGING;**8,59**;Nov 27, 2007;Build 20
3 ;;Per VHA Directive 2004-038, this routine should not be modified.
4 ;; +---------------------------------------------------------------+
5 ;; | Property of the US Government. |
6 ;; | No permission to copy or redistribute this software is given. |
7 ;; | Use of unreleased versions of this software requires the user |
8 ;; | to execute a written test agreement with the VistA Imaging |
9 ;; | Development Office of the Department of Veterans Affairs, |
10 ;; | telephone (301) 734-0100. |
11 ;; | |
12 ;; | The Food and Drug Administration classifies this software as |
13 ;; | a medical device. As such, it may not be changed in any way. |
14 ;; | Modifications to this software may result in an adulterated |
15 ;; | medical device under 21CFR820, the use of which is considered |
16 ;; | to be a violation of US Federal Statutes. |
17 ;; +---------------------------------------------------------------+
18 ;;
19 Q
20 ; Imaging routines should have this code for setting error trap
21 ; This will enable logging Imaging errors and Sending messages for
22 ; certain errors etc. later
23 ;N $ETRAP,$ESTACK S $ETRAP="D ERRA^MAGGTERR"
24 ;
25 ; This assumes the Return variable or array is MAGRY or MAGRY()
26 Q
27ERRA ; ERROR TRAP FOR Array Return variables
28 N ERR S ERR=$$EC^%ZOSV
29 S MAGRY(0)="0^"_ERR
30 D LOGERR(ERR)
31 D @^%ZOSF("ERRTN")
32 Q
33 ;
34AERRA ; ERROR TRAP FOR Global Return Variables
35 N ERR S ERR=$$EC^%ZOSV
36 S @MAGRY@(0)="0^ERROR "_ERR
37 D LOGERR(ERR)
38 D @^%ZOSF("ERRTN")
39 Q
40ERR ; ERROR TRAP FOR String Return variables
41 N ERR S ERR=$$EC^%ZOSV
42 S MAGRY="0^ERROR "_ERR
43 D LOGERR(ERR)
44 D @^%ZOSF("ERRTN")
45 Q
46LOGERR(ERROR) ;
47 Q:'$G(MAGJOB("SESSION"))
48 N SESS,WRKS,ERR
49 S SESS=$G(MAGJOB("SESSION"))
50 ; Quit if No entry in Session File.
51 Q:'$D(^MAG(2006.82,SESS,0))
52 I '$D(^MAG(2006.82,SESS,"ERR",0)) S ^MAG(2006.82,SESS,"ERR",0)="^2006.823A^0^0"
53 S ERR=$O(^MAG(2006.82,SESS,"ERR"," "),-1)+1
54 S ^MAG(2006.82,SESS,"ERR",ERR,0)=ERROR
55 S $P(^MAG(2006.82,SESS,"ERR",0),"^",3,4)=ERR_"^"_ERR
56 ;
57 Q:'$G(MAGJOB("WRKSIEN"))
58 S WRKS=$G(MAGJOB("WRKSIEN"))
59 ; Quit if No entry in Workstation File.
60 Q:'$D(^MAG(2006.81,WRKS,0))
61 S $P(^MAG(2006.81,WRKS,0),"^",11)=ERR
62 Q
Note: See TracBrowser for help on using the repository browser.