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

MAGVD002.m

Go to the documentation of this file.
  1. MAGVD002 ;WOIFO/DAC,MLH - Delete old and new studies ; 3 Feb 2012 01:19 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. ; Input Variables:
  1. ; MAGARR(1..n,"IMAGES")
  1. ; MAGARR(1..n,"MAGDFN") - Patient DFN
  1. ; MAGARR(1..n,"MAGD1") - Radiology DT
  1. ; MAGARR(1..n,"MAGD2") - Radiology P
  1. ; REASON - Reason for deletion
  1. ;
  1. ; Output Variable:
  1. ; OUT - status`status message
  1. ; 0 indicates success, a negative integer indicates an error occurred
  1. ;
  1. DELACC(OUT,MAGARR,REASON) ; Delete old and new studies using MAGARR info - called from option MAG SYS-DELETE STUDY
  1. N SSEP,ISEP,IMAGEIEN,OUTAUD,EVENT,HOST,APP,MESSAGE,DATA,I,STUDIEN
  1. N RESULT
  1. S SSEP=$$STATSEP^MAGVRS41
  1. S ISEP=$$INPUTSEP^MAGVRS41
  1. I $G(REASON)="" S OUT=-8_SSEP_"No reason provided" Q
  1. I '$D(MAGARR(1,"IMAGES")) S OUT=-9_SSEP_"No image IENs provided" Q
  1. S IMAGEIEN="",OUT=""
  1. F I=1:1 Q:'$D(MAGARR(I,"IMAGES"))!(OUT'="") D
  1. . F S IMAGEIEN=$O(MAGARR(I,"IMAGES",IMAGEIEN)) Q:IMAGEIEN="" D
  1. . . I MAGARR(I,"IMAGES",IMAGEIEN)="" D
  1. . . . D IMAGEDEL^MAGGTID(.RESULT,IMAGEIEN,1,REASON)
  1. . . . I $P($G(RESULT(0)),"^")=0 S OUT=-10_SSEP_$P($G(RESULT(0)),"^",2) Q
  1. . . . Q
  1. . . I MAGARR(I,"IMAGES",IMAGEIEN)'="" D
  1. . . . S STUDIEN=MAGARR(I,"IMAGES",IMAGEIEN)
  1. . . . D INACTIVT^MAGVRS41(.RESULT,2005.62,STUDIEN,"",1,REASON)
  1. . . . I +$G(RESULT(1))<0 S OUT=RESULT(1) Q
  1. . . . Q
  1. . . Q
  1. . Q
  1. I OUT="" S OUT=0 ; set success value
  1. S EVENT="DELETE"
  1. S HOST=""
  1. S APP="MAG SYS-DELETE STUDY"
  1. S MESSAGE=""
  1. S DATA(1)="DUZ"_ISEP_DUZ
  1. D EVENT^MAGUAUD(.OUTAUD,EVENT,HOST,APP,MESSAGE,.DATA)
  1. Q