| 1 | MAGGSERR ;WOIFO/GEK - IMAGING ERROR TRAP, AND ERROR LOG ; [ 12/27/2000 10:49 ] | 
|---|
| 2 | ;;3.0;IMAGING;**7**;Jul 12, 2002 | 
|---|
| 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 | ;  Calling this error trap will enable logging Imaging errors and | 
|---|
| 20 | ;  sending messages for certain errors etc. later | 
|---|
| 21 | ; set it using : | 
|---|
| 22 | ;    >N $ETRAP,$ESTACK S $ETRAP="D ERRA^MAGGSERR" | 
|---|
| 23 | ; | 
|---|
| 24 | ; This assumes the Return variable or array is MAGRY or MAGRY() | 
|---|
| 25 | ; | 
|---|
| 26 | ERRA ; ERROR TRAP FOR Array Return variables | 
|---|
| 27 | N ERR S ERR=$$EC^%ZOSV | 
|---|
| 28 | S MAGRY(0)="0^"_ERR | 
|---|
| 29 | D LOGERR(ERR) | 
|---|
| 30 | D @^%ZOSF("ERRTN") | 
|---|
| 31 | Q | 
|---|
| 32 | ; | 
|---|
| 33 | AERRA ; ERROR TRAP FOR Global Return Variables | 
|---|
| 34 | N ERR S ERR=$$EC^%ZOSV | 
|---|
| 35 | S @MAGRY@(0)="0^ERROR "_ERR | 
|---|
| 36 | D LOGERR(ERR) | 
|---|
| 37 | D @^%ZOSF("ERRTN") | 
|---|
| 38 | Q | 
|---|
| 39 | ERR ; ERROR TRAP FOR String Return variables | 
|---|
| 40 | N ERR S ERR=$$EC^%ZOSV | 
|---|
| 41 | S MAGRY="0^ERROR "_ERR | 
|---|
| 42 | D LOGERR(ERR) | 
|---|
| 43 | D @^%ZOSF("ERRTN") | 
|---|
| 44 | Q | 
|---|
| 45 | LOGERR(ERROR,MAGSESS) ; | 
|---|
| 46 | N SESSIEN | 
|---|
| 47 | S SESSIEN=$S($G(MAGSESS):MAGSESS,$D(MAGJOB("SESSION")):MAGJOB("SESSION"),1:0) | 
|---|
| 48 | I 'SESSIEN Q | 
|---|
| 49 | N MAGGFDA,MAGXERR,MAGXIEN,MAGNODE | 
|---|
| 50 | S MAGNODE="+1,"_+SESSIEN_"," | 
|---|
| 51 | ;S MAGNODE="+1,10," | 
|---|
| 52 | S MAGGFDA(2006.823,MAGNODE,.01)=ERROR | 
|---|
| 53 | D UPDATE^DIE("","MAGGFDA","MAGXIEN","MAGXERR") | 
|---|
| 54 | ; error flag for this session in workstation file | 
|---|
| 55 | I $G(MAGJOB("WRKSIEN")) D | 
|---|
| 56 | . S MAGNODE=+MAGJOB("WRKSIEN")_"," | 
|---|
| 57 | . S MAGGFDA(2006.81,MAGNODE,11)=+MAGXIEN(1) ; | 
|---|
| 58 | . D UPDATE^DIE("","MAGGFDA","MAGXIEN","MAGXERR") | 
|---|
| 59 | Q | 
|---|