Ignore:
Timestamp:
Dec 4, 2009, 12:11:15 AM (14 years ago)
Author:
George Lilly
Message:

revised back to 6/30/08 version

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WorldVistAEHR/trunk/r/IMAGING-MAG-ZMAG/MAGGTERR.m

    r613 r623  
    1 MAGGTERR        ;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
    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 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
     1MAGGTERR ;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
     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 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
Note: See TracChangeset for help on using the changeset viewer.