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

MAGVD003.m

Go to the documentation of this file.
  1. MAGVD003 ;WOIFO/NST - Utilities for RPC calls for deletion ; 03 Apr 2012 1:54 PM
  1. ;;3.0;IMAGING;**118,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. ;+++++ Get Accession number by IEN in IMAGE file (#2005)
  1. ;
  1. ; Input Parameters
  1. ; ================
  1. ; MAGDA - IEN in IMAGE file (#2005)
  1. ;
  1. ; Return Values
  1. ; =============
  1. ; if error OUT = Failed Status^Error message
  1. ; if success OUT = Success status^^Accession number
  1. ;
  1. GETACN(OUT,MAGDA) ; get accession number
  1. N PARENTFN,PARENTD0,MAGD2,CONSIX,ERR,ACN
  1. N RESDEL
  1. S RESDEL=$$RESDEL^MAGVAF02() ; Result delimiter
  1. I '$$ISGRP^MAGGI11(MAGDA,.ERR) D Q
  1. . S:$G(ERR)'="" OUT=$$FAILED^MAGVAF02()_RESDEL_$P(ERR,"^",2)
  1. . S:$G(ERR)="" OUT=$$FAILED^MAGVAF02()_RESDEL_"Image "_MAGDA_" is not a group image"
  1. . Q
  1. S MAGD2=$G(^MAG(2005,MAGDA,2))
  1. S PARENTFN=$P(MAGD2,"^",6) ; Parent Data File
  1. S PARENTD0=+$P(MAGD2,"^",7) ; Parent Global Root D0
  1. S ACN=""
  1. I (PARENTFN=74),PARENTD0 D ; Radiology Image
  1. . S ACN=$P($G(^RARPT(PARENTD0,0)),"^") ; IA # 1171 ; Get Accession number
  1. . Q
  1. I (PARENTFN=8925),PARENTD0 D
  1. . S CONSIX=$$GET1^DIQ(8925,PARENTD0,1405,"I") ; #1405 REQUESTING PACKAGE REFERENCE
  1. . S:$P(CONSIX,";",2)="GMR(123," ACN=$$GMRCACN^MAGDFCNV($P(CONSIX,";",1))
  1. . Q
  1. I (PARENTFN=2006.5839),PARENTD0 D ; Consult Image
  1. . S ACN=$$GMRCACN^MAGDFCNV(PARENTD0)
  1. . Q
  1. S:ACN="" OUT=$$FAILED^MAGVAF02()_RESDEL_"Accession number not found"
  1. D:ACN'="" SETOKVAL^MAGVAF02(.OUT,ACN)
  1. Q