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

MAGUE006.m

Go to the documentation of this file.
  1. MAGUE006 ;WOIFO/MLH - IMAGING - utilities - ICN lookup ; 19-Jul-2013 3:44 PM
  1. ;;3.0;IMAGING;**138**;Mar 19, 2002;Build 5380;Sep 03, 2013
  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. ;+++++ GET ICN GIVEN DFN
  1. ;
  1. ; MAGDFN DFN of patient (internal entry number on PATIENT file (#2) )
  1. ;
  1. ; DELIM (optional) single punctuation character (e.g., comma (,))
  1. ; to which to change the up-arrow (^) delimiter returned
  1. ; by $$GETICN^MPIF001
  1. ;
  1. ; SUPPRESS (optional) set nonzero if error text only (no code) is desired
  1. ;
  1. ; RETURN VALUES
  1. ; =============
  1. ;
  1. ; OUTPUT Description
  1. ; ^01: -97 if invalid DELIM;
  1. ; else -98 if MAGDFN parameter missing;
  1. ; else -99 if no ICN (e.g., IHS);
  1. ; else -1 if ICN fetch raises exception;
  1. ; else ICN value
  1. ; ^02: "INVALID DELIMITER VALUE" if invalid DELIM;
  1. ; else "MAGDFN PARAMETER MISSING" if MAGDFN parameter missing;
  1. ; else "ICN NOT USED" if no ICN (e.g., IHS);
  1. ; else error message if ICN fetch raises exception;
  1. ; else empty
  1. ;
  1. ; Note: on exception, ^02 -> ^01 if code suppressed
  1. ;
  1. GETICN(MAGDFN,DELIM,SUPPRESS) ;
  1. N OUTPUT
  1. D ; is ICN used / defined?
  1. . I $D(DELIM)#10,DELIM'?1ANP D Q
  1. . . S OUTPUT="-97^INVALID DELIMITER VALUE"
  1. . . Q
  1. . I $D(MAGDFN)#10=0 D Q
  1. . . S OUTPUT="-98^MAGDFN PARAMETER MISSING"
  1. . . Q
  1. . I $T(GETICN^MPIF001)="" D Q
  1. . . S OUTPUT="-99^ICN NOT USED"
  1. . . Q
  1. . S OUTPUT=$$GETICN^MPIF001(MAGDFN) ; Supported IA #2701
  1. . S:OUTPUT="" OUTPUT="-1^ICN UNDEFINED"
  1. . Q
  1. I $D(DELIM)#10,DELIM?1ANP S OUTPUT=$TR(OUTPUT,"^",DELIM)
  1. I $G(SUPPRESS),OUTPUT["^" S OUTPUT=$P(OUTPUT,"^",2)
  1. Q $G(OUTPUT)
  1. ;
  1. ; MAGUE006