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

MAGVD008.m

Go to the documentation of this file.
  1. MAGVD008 ;WOIFO/DAC - Delete an image by accession number ; 3 Feb 2012 01:17 PM
  1. ;;3.0;IMAGING;**118**;Mar 19, 2002;Build 4525;May 01, 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. ;Called by legacy delete function
  1. ;
  1. ;Input Variables:
  1. ; ACC - Accession number
  1. ; REASON - The reason for deletion
  1. ;
  1. ;Output Variable:
  1. ;OUT - status`status message
  1. ; a status of 0 indicates success, a negative integer indicates an error occurred
  1. ;
  1. DELNEW(OUT,ACC,REASON) ; Given an accession number delete entries for the 2005.6x structure
  1. N OUT20056,PROCIEN,STUDIEN,ISEP,SSEP,OUTAUD,EVENT,HOST,APP,MESSAGE,DATA,OUTAUD
  1. S ISEP=$$INPUTSEP^MAGVRS41,SSEP=$$STATSEP^MAGVRS41
  1. I $G(ACC)="" S OUT=-8_SSEP_"No accession number provided" Q
  1. I $G(REASON)="" S OUT=-9_SSEP_"No reason provided" Q
  1. I '$D(^MAGV(2005.61,"B",ACC)) S OUT=1_SSEP_"Accession number not found" Q
  1. S OUT=0
  1. S PROCIEN=$O(^MAGV(2005.61,"B",ACC,""))
  1. S STUDIEN=""
  1. F S STUDIEN=$O(^MAGV(2005.62,"C",PROCIEN,STUDIEN)) Q:STUDIEN="" D
  1. . D INACTIVT^MAGVRS41(.OUT20056,2005.62,STUDIEN,"",1,REASON)
  1. . I OUT20056(1)<0 S OUT=OUT20056(1)
  1. . Q
  1. S EVENT="DELETE"
  1. S HOST=""
  1. S APP="MAG SYS-DELETE IMAGEGROUP"
  1. S MESSAGE=""
  1. S DATA(1)="DUZ"_ISEP_DUZ
  1. I OUT'<0 D EVENT^MAGUAUD(.OUTAUD,EVENT,HOST,APP,MESSAGE,.DATA)
  1. Q