MAGVD007 ;WOIFO/DAC,MLH - Get images by accession number ; 30 Jan 2012 04:04 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
;
;+++++ Get Images by Accession Number
;
; Input Parameters
; ================
; ACCNUM - Accession Number
;
; Return Values
; =============
; OUT - status`status message
; a status of 0 indicates success, a negative integer indicates an error occurred
;
; MAGARR(1..n,"IMAGES")
; MAGARR(1..n,"MAGDFN") - Patient DFN
; MAGARR(1..n,"MAGD1") - Radiology DT
; MAGARR(1..n,"MAGD2") - Radiology P
;
GIBYACC(OUT,ACCNUM,MAGARR) ; Get Images by Accession Number
N SSEP,ANY,I
N P,REQ,IARRAY,MAGD0,MAGD1,MAGD2,PROC ; Needed for function call ACCIEN^MAGVD006
S SSEP=$$STATSEP^MAGVRS41
I $G(ACCNUM)="" S OUT=-1_SSEP_"No accession number provided" Q
S OUT=0
K ^TMP("MAG",$J,"QR")
K MAGARR
S REQ("0008,0050",ACCNUM)=ACCNUM
D ACCNUM^MAGDQR07(.REQ,"0008,0050",ACCNUM,.ANY)
S P=""
S I=0
F S P=$O(^TMP("MAG",$J,"QR",6,P)) Q:P="" D
. K IARRAY
. S (MAGD0,MAGD1,MAGD2)=0
. D ACCIEN^MAGVD006(P,.REQ,.IARRAY,.MAGD0,.MAGD1,.MAGD2,.PROC)
. I $O(IARRAY(""))="" Q
. S I=I+1
. M MAGARR(I,"IMAGES")=IARRAY
. S MAGARR(I,"MAGDFN")=$G(MAGD0)
. S MAGARR(I,"MAGD1")=$G(MAGD1)
. S MAGARR(I,"MAGD2")=$G(MAGD2)
. S MAGARR(I,"PROC")=$G(PROC)
. Q
K ^TMP("MAG",$J,"QR")
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HMAGVD007 2380 printed Nov 22, 2024@17:19:48 Page 2
MAGVD007 ;WOIFO/DAC,MLH - Get images by accession number ; 30 Jan 2012 04:04 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 ;+++++ Get Images by Accession Number
+20 ;
+21 ; Input Parameters
+22 ; ================
+23 ; ACCNUM - Accession Number
+24 ;
+25 ; Return Values
+26 ; =============
+27 ; OUT - status`status message
+28 ; a status of 0 indicates success, a negative integer indicates an error occurred
+29 ;
+30 ; MAGARR(1..n,"IMAGES")
+31 ; MAGARR(1..n,"MAGDFN") - Patient DFN
+32 ; MAGARR(1..n,"MAGD1") - Radiology DT
+33 ; MAGARR(1..n,"MAGD2") - Radiology P
+34 ;
GIBYACC(OUT,ACCNUM,MAGARR) ; Get Images by Accession Number
+1 NEW SSEP,ANY,I
+2 ; Needed for function call ACCIEN^MAGVD006
NEW P,REQ,IARRAY,MAGD0,MAGD1,MAGD2,PROC
+3 SET SSEP=$$STATSEP^MAGVRS41
+4 IF $GET(ACCNUM)=""
SET OUT=-1_SSEP_"No accession number provided"
QUIT
+5 SET OUT=0
+6 KILL ^TMP("MAG",$JOB,"QR")
+7 KILL MAGARR
+8 SET REQ("0008,0050",ACCNUM)=ACCNUM
+9 DO ACCNUM^MAGDQR07(.REQ,"0008,0050",ACCNUM,.ANY)
+10 SET P=""
+11 SET I=0
+12 FOR
SET P=$ORDER(^TMP("MAG",$JOB,"QR",6,P))
if P=""
QUIT
Begin DoDot:1
+13 KILL IARRAY
+14 SET (MAGD0,MAGD1,MAGD2)=0
+15 DO ACCIEN^MAGVD006(P,.REQ,.IARRAY,.MAGD0,.MAGD1,.MAGD2,.PROC)
+16 IF $ORDER(IARRAY(""))=""
QUIT
+17 SET I=I+1
+18 MERGE MAGARR(I,"IMAGES")=IARRAY
+19 SET MAGARR(I,"MAGDFN")=$GET(MAGD0)
+20 SET MAGARR(I,"MAGD1")=$GET(MAGD1)
+21 SET MAGARR(I,"MAGD2")=$GET(MAGD2)
+22 SET MAGARR(I,"PROC")=$GET(PROC)
+23 QUIT
End DoDot:1
+24 KILL ^TMP("MAG",$JOB,"QR")
+25 QUIT