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

MAGNU002.m

Go to the documentation of this file.
  1. MAGNU002 ;WOIFO/NST - Utilities for RPC calls ; 02 May 2017 4:16 PM
  1. ;;3.0;IMAGING;**185**;Mar 19, 2002;Build 92;Aug 02, 2012
  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. ;; | 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. ;
  1. OK() Q 0 ; Success status
  1. ;
  1. FAILED() Q -1 ; Failure status
  1. ;
  1. RESDEL() Q "^" ; Result delimiter
  1. ;
  1. RESDATA() Q 3 ; Returns the piece number where the result data value is stored in MAGRY
  1. ;
  1. ISOK(MAGRY) ; Returns 0 (failed) or 1 (success): Checks if first piece of MAGRY is success
  1. Q +MAGRY=$$OK()
  1. ;
  1. GETVAL(MAGRY) ; Returns data value in MAGRY
  1. Q $P(MAGRY,$$RESDEL(),$$RESDATA())
  1. ;
  1. SETVAL(MAGRY,VAL) ; set VAL in RY data piece
  1. S $P(MAGRY,$$RESDEL(),$$RESDATA())=VAL
  1. Q
  1. ;
  1. SETOKVAL(VAL) ; set OK result and value
  1. N RY
  1. S RY=$$OK()
  1. D SETVAL(.RY,VAL)
  1. Q RY
  1. ;
  1. SETERROR(VAL) ; set Error result and value
  1. Q $$FAILED()_$$RESDEL()_VAL
  1. ;
  1. ;
  1. ; Input Parameters
  1. ; ================
  1. ; MSG = VA FileMan error array
  1. ;
  1. ; Return Values
  1. ; =============
  1. ; MAGRY(0) = Success status
  1. ; MAGRY(0) = Failure status^Error Message
  1. ;
  1. ; Return 1 = error in MSG array
  1. ; 0 = no error in MSG array
  1. ISERROR(MAGRY,MSG) ; Check for error message
  1. I '$D(MSG("DIERR")) S MAGRY(0)=$$OK() Q 0 ; No error
  1. ;
  1. N MAGRESA
  1. D MSG^DIALOG("A",.MAGRESA,245,5,"MSG")
  1. S MAGRY(0)=$$SETERROR(MAGRESA(1))
  1. Q 1