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

MAGGTSR1.m

Go to the documentation of this file.
  1. MAGGTSR1 ;WOIFO/GEK - ADD IMAGES TO SURGERY FILE ; [ 06/20/2001 08:57 ]
  1. ;;3.0;IMAGING;**59**;Nov 27, 2007;Build 20
  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. ;; | |
  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. FILE(MAGRY,MAGIEN,DATA) ;RPC Call to file Image pointers in Surgery package
  1. ; and Surgery pointers in Image File.
  1. ;
  1. ; DATA is same data that we listed in the GET^MAGGTSR call
  1. ; MAGIEN is the Imaging internal number.
  1. ; example
  1. ; for Imaging Versions < 2.5 the data is
  1. ; # DATE DESC SRF(IEN FM DATE
  1. ;CNT_U_(READABLE DATE)_U_SROPS(1)_U_SROP_U_SRSDATE
  1. ;
  1. ; for Imaging Versions > 2.4, the data is different
  1. ;CNT_U_(READABLE DATE)_U_SROPS(1)_U_IMAGECT_U_"|"_SROP_U_SRSDATE
  1. ; example
  1. ; 1^05-06-1997^REMOVE TONSILS (REQUESTED)^8^|9853^2970506^
  1. ;
  1. IF $$NEWERR^%ZTER N $ETRAP,$ESTACK S $ETRAP="D ERR^MAGGTERR"
  1. E S X="ERR^MAGGTERR",@^%ZOSF("TRAP")
  1. N Y,MAGSIEN,MAGPDT,MAGFDA,MAGERR,MAGIENS
  1. ;
  1. I (+$G(MAGJOB("VERSION"))>2.4) D
  1. . S MAGSIEN=$P($P(DATA,$C(124),2),U,1)
  1. . S MAGPDT=$P($P(DATA,$C(124),2),U,2)
  1. E S MAGSIEN=$P(DATA,U,4),MAGPDT=$P(DATA,U,5)
  1. S MAGFDA(130.02005,"+1,"_MAGSIEN_",",.01)=MAGIEN
  1. D UPDATE^DIE("S","MAGFDA","MAGIENS","MAGERR")
  1. I '$G(MAGIENS(1)) D D CLEAN^DILF S MAGRY=MAGERR Q
  1. . S MAGERR="0^ERROR Adding Image to Surgery Package "
  1. . I $D(DIERR) D RTRNERR(.MAGERR)
  1. S MAGRY="1^Image added to Surgery Package"
  1. S $P(^MAG(2005,MAGIEN,2),U,6,8)="130^"_MAGSIEN_U_MAGIENS(1)
  1. D LINKDT^MAGGTU6(.X,MAGIEN)
  1. Q
  1. RTRNERR(ETXT) ; There was error from UPDATE^DIE quit with error text
  1. S ETXT="0^ERROR "_MAGERR("DIERR",1,"TEXT",1)
  1. Q