| [623] | 1 | MAGGTERR ;WOIFO/GEK - IMAGING ERROR TRAP, AND ERROR LOG ; [ 06/20/2001 08:56 ] | 
|---|
|  | 2 | ;;3.0;IMAGING;**8**;Sep 15, 2004 | 
|---|
|  | 3 | ;; +---------------------------------------------------------------+ | 
|---|
|  | 4 | ;; | Property of the US Government.                                | | 
|---|
|  | 5 | ;; | No permission to copy or redistribute this software is given. | | 
|---|
|  | 6 | ;; | Use of unreleased versions of this software requires the user | | 
|---|
|  | 7 | ;; | to execute a written test agreement with the VistA Imaging    | | 
|---|
|  | 8 | ;; | Development Office of the Department of Veterans Affairs,     | | 
|---|
|  | 9 | ;; | telephone (301) 734-0100.                                     | | 
|---|
|  | 10 | ;; |                                                               | | 
|---|
|  | 11 | ;; | The Food and Drug Administration classifies this software as  | | 
|---|
|  | 12 | ;; | a medical device.  As such, it may not be changed in any way. | | 
|---|
|  | 13 | ;; | Modifications to this software may result in an adulterated   | | 
|---|
|  | 14 | ;; | medical device under 21CFR820, the use of which is considered | | 
|---|
|  | 15 | ;; | to be a violation of US Federal Statutes.                     | | 
|---|
|  | 16 | ;; +---------------------------------------------------------------+ | 
|---|
|  | 17 | ;; | 
|---|
|  | 18 | Q | 
|---|
|  | 19 | ;  Imaging routines should have this code for setting error trap | 
|---|
|  | 20 | ;  This will enable logging Imaging errors and Sending messages for | 
|---|
|  | 21 | ;  certain errors etc. later | 
|---|
|  | 22 | ;IF $$NEWERR^%ZTER N $ETRAP,$ESTACK S $ETRAP="D ERRA^MAGGTERR" | 
|---|
|  | 23 | ;E  S X="ERRA^MAGGTERR",@^%ZOSF("TRAP") | 
|---|
|  | 24 | ; | 
|---|
|  | 25 | ; This assumes the Return variable or array is MAGRY or MAGRY() | 
|---|
|  | 26 | Q | 
|---|
|  | 27 | ERRA ; 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 | ; | 
|---|
|  | 34 | AERRA ; 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 | 
|---|
|  | 40 | ERR ; 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 | 
|---|
|  | 46 | LOGERR(ERROR) ; | 
|---|
|  | 47 | Q:'$G(MAGJOB("SESSION")) | 
|---|
|  | 48 | N MAGGFDA,MAGXERR,MAGXIEN,MAGNODE | 
|---|
|  | 49 | S MAGNODE="+1,"_+MAGJOB("SESSION")_"," | 
|---|
|  | 50 | ;S MAGNODE="+1,10," | 
|---|
|  | 51 | S MAGGFDA(2006.823,MAGNODE,.01)=ERROR | 
|---|
|  | 52 | D UPDATE^DIE("","MAGGFDA","MAGXIEN","MAGXERR") | 
|---|
|  | 53 | ; error flag for this session in workstation file | 
|---|
|  | 54 | S MAGNODE=+MAGJOB("WRKSIEN")_"," | 
|---|
|  | 55 | S MAGGFDA(2006.81,MAGNODE,11)=+MAGXIEN(1) ; | 
|---|
|  | 56 | D UPDATE^DIE("","MAGGFDA","MAGXIEN","MAGXERR") | 
|---|
|  | 57 | Q | 
|---|