MAGVAD02 ;WOIFO/NST - Delete records in storage files ; 11 Mar 2010 4:39 PM
;;3.0;IMAGING;**118**;Mar 19, 2002;Build 4525;May 01, 2013
;; Per VHA Directive 2004-038, this routine should not be modified.
;; +---------------------------------------------------------------+
;; | Property of the US Government. |
;; | No permission to copy or redistribute this software is given. |
;; | Use of unreleased versions of this software requires the user |
;; | to execute a written test agreement with the VistA Imaging |
;; | Development Office of the Department of Veterans Affairs, |
;; | telephone (301) 734-0100. |
;; | The Food and Drug Administration classifies this software as |
;; | a medical device. As such, it may not be changed in any way. |
;; | Modifications to this software may result in an adulterated |
;; | medical device under 21CFR820, the use of which is considered |
;; | to be a violation of US Federal Statutes. |
;; +---------------------------------------------------------------+
;;
Q
;
;***** Mark an artifact as deleted in ARTIFACT file (#2006.916)
;
; RPC: N/A
;
; Input Parameters
; ================
; TOKEN = ARTIFACT TOKEN field (#2006.916,01)
; DELAPP = DELETING APPLICATION field (#2006.916,9)
; Return Values
; =============
;
; if error MAGRY = Failure status ^ Error message ^
; if success MAGRY = Success Status
;
DELAFACT(MAGRY,TOKEN,DELAPP) ; RPC [N/A]
N IEN,RES,FILE,PFILE,MAGPARAM,ADELETED
D GETAIENT^MAGVAG02(.RES,TOKEN,"") ; Get Artifact IEN by Token
I '$$ISOK^MAGVAF02(RES) S MAGRY=RES Q
S MAGPARAM("PK")=$$GETVAL^MAGVAF02(RES) ; IEN of the record in ARTIFACT file (#2006.916)
;
S FILE=2006.916 ; ARTIFACT file
;
; Get deleting application or create a new one
S PFILE=$$GETFILEP^MAGVAF05(FILE,"DELETING APPLICATION") ; the file that field points to
S MAGRY=$$GETIEN^MAGVAF05(PFILE,DELAPP,1)
I '$$ISOK^MAGVAF02(MAGRY) Q ; Quit if error. MAGRY is already set
S MAGPARAM("DELETING APPLICATION")=$$GETVAL^MAGVAF02(MAGRY) ; Set the internal value
S MAGPARAM("DELETED DATE/TIME")=$$NOW^XLFDT
;
D UPDRCD^MAGVAF01(.MAGRY,FILE,.MAGPARAM) ; Mark artifact as deleted
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HMAGVAD02 2317 printed Nov 22, 2024@17:19:22 Page 2
MAGVAD02 ;WOIFO/NST - Delete records in storage files ; 11 Mar 2010 4:39 PM
+1 ;;3.0;IMAGING;**118**;Mar 19, 2002;Build 4525;May 01, 2013
+2 ;; Per VHA Directive 2004-038, this routine should not be modified.
+3 ;; +---------------------------------------------------------------+
+4 ;; | Property of the US Government. |
+5 ;; | No permission to copy or redistribute this software is given. |
+6 ;; | Use of unreleased versions of this software requires the user |
+7 ;; | to execute a written test agreement with the VistA Imaging |
+8 ;; | Development Office of the Department of Veterans Affairs, |
+9 ;; | telephone (301) 734-0100. |
+10 ;; | The Food and Drug Administration classifies this software as |
+11 ;; | a medical device. As such, it may not be changed in any way. |
+12 ;; | Modifications to this software may result in an adulterated |
+13 ;; | medical device under 21CFR820, the use of which is considered |
+14 ;; | to be a violation of US Federal Statutes. |
+15 ;; +---------------------------------------------------------------+
+16 ;;
+17 QUIT
+18 ;
+19 ;***** Mark an artifact as deleted in ARTIFACT file (#2006.916)
+20 ;
+21 ; RPC: N/A
+22 ;
+23 ; Input Parameters
+24 ; ================
+25 ; TOKEN = ARTIFACT TOKEN field (#2006.916,01)
+26 ; DELAPP = DELETING APPLICATION field (#2006.916,9)
+27 ; Return Values
+28 ; =============
+29 ;
+30 ; if error MAGRY = Failure status ^ Error message ^
+31 ; if success MAGRY = Success Status
+32 ;
DELAFACT(MAGRY,TOKEN,DELAPP) ; RPC [N/A]
+1 NEW IEN,RES,FILE,PFILE,MAGPARAM,ADELETED
+2 ; Get Artifact IEN by Token
DO GETAIENT^MAGVAG02(.RES,TOKEN,"")
+3 IF '$$ISOK^MAGVAF02(RES)
SET MAGRY=RES
QUIT
+4 ; IEN of the record in ARTIFACT file (#2006.916)
SET MAGPARAM("PK")=$$GETVAL^MAGVAF02(RES)
+5 ;
+6 ; ARTIFACT file
SET FILE=2006.916
+7 ;
+8 ; Get deleting application or create a new one
+9 ; the file that field points to
SET PFILE=$$GETFILEP^MAGVAF05(FILE,"DELETING APPLICATION")
+10 SET MAGRY=$$GETIEN^MAGVAF05(PFILE,DELAPP,1)
+11 ; Quit if error. MAGRY is already set
IF '$$ISOK^MAGVAF02(MAGRY)
QUIT
+12 ; Set the internal value
SET MAGPARAM("DELETING APPLICATION")=$$GETVAL^MAGVAF02(MAGRY)
+13 SET MAGPARAM("DELETED DATE/TIME")=$$NOW^XLFDT
+14 ;
+15 ; Mark artifact as deleted
DO UPDRCD^MAGVAF01(.MAGRY,FILE,.MAGPARAM)
+16 QUIT