MAGVRS24 ;WOIFO/DAC - RPC calls for DICOM file processing ; 09 Feb 2012 12:53 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
GETSOP(OUT,SERIEN,SOPIEN,OVERRIDE) ;RPC - MAGV GET SOP
D REFRESH^MAGVRS41(.OUT,2005.64,$G(SOPIEN),$G(SERIEN),$G(OVERRIDE))
Q
INSOP(OUT,SOPIEN,SERIEN,OVERRIDE) ; RPC - MAGV INACTIVATE SOP
D INACTIVT^MAGVRS41(.OUT,2005.64,$G(SOPIEN),$G(SERIEN),$G(OVERRIDE))
Q
GETORIG(OUT,SOPIEN) ; Get the original file(s) associated with a SOP instance
; IIFIEN - Image file IEN ORIG - Is Original
N IIFIEN,ORIG,I,SSEP,STATUS
S IIFIEN="",SSEP=$$STATSEP^MAGVRS41,I=2
I $G(SOPIEN)="" S OUT(1)="-3"_SSEP_"no IEN provided" Q
I '$D(^MAGV(2005.64,SOPIEN)) S OUT(1)="-1"_SSEP_"IEN does not exist" Q
F S IIFIEN=$O(^MAGV(2005.65,"C",SOPIEN,IIFIEN)) Q:IIFIEN="" D
. S ORIG=$P($G(^MAGV(2005.65,IIFIEN,1)),U,2)
. S STATUS=$P($G(^MAGV(2005.65,IIFIEN,1)),U,5)
. I $G(ORIG)="1",STATUS'="I" S OUT(I)=IIFIEN,I=I+1 ; Add original Image Instance IEN to output array
. Q
S OUT(1)=$S($D(OUT(2)):"0"_SSEP_SSEP,1:"-2"_SSEP_"No associated original file instances found")
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HMAGVRS24 2117 printed Nov 22, 2024@17:20:19 Page 2
MAGVRS24 ;WOIFO/DAC - RPC calls for DICOM file processing ; 09 Feb 2012 12:53 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
GETSOP(OUT,SERIEN,SOPIEN,OVERRIDE) ;RPC - MAGV GET SOP
+1 DO REFRESH^MAGVRS41(.OUT,2005.64,$GET(SOPIEN),$GET(SERIEN),$GET(OVERRIDE))
+2 QUIT
INSOP(OUT,SOPIEN,SERIEN,OVERRIDE) ; RPC - MAGV INACTIVATE SOP
+1 DO INACTIVT^MAGVRS41(.OUT,2005.64,$GET(SOPIEN),$GET(SERIEN),$GET(OVERRIDE))
+2 QUIT
GETORIG(OUT,SOPIEN) ; Get the original file(s) associated with a SOP instance
+1 ; IIFIEN - Image file IEN ORIG - Is Original
+2 NEW IIFIEN,ORIG,I,SSEP,STATUS
+3 SET IIFIEN=""
SET SSEP=$$STATSEP^MAGVRS41
SET I=2
+4 IF $GET(SOPIEN)=""
SET OUT(1)="-3"_SSEP_"no IEN provided"
QUIT
+5 IF '$DATA(^MAGV(2005.64,SOPIEN))
SET OUT(1)="-1"_SSEP_"IEN does not exist"
QUIT
+6 FOR
SET IIFIEN=$ORDER(^MAGV(2005.65,"C",SOPIEN,IIFIEN))
if IIFIEN=""
QUIT
Begin DoDot:1
+7 SET ORIG=$PIECE($GET(^MAGV(2005.65,IIFIEN,1)),U,2)
+8 SET STATUS=$PIECE($GET(^MAGV(2005.65,IIFIEN,1)),U,5)
+9 ; Add original Image Instance IEN to output array
IF $GET(ORIG)="1"
IF STATUS'="I"
SET OUT(I)=IIFIEN
SET I=I+1
+10 QUIT
End DoDot:1
+11 SET OUT(1)=$SELECT($DATA(OUT(2)):"0"_SSEP_SSEP,1:"-2"_SSEP_"No associated original file instances found")
+12 QUIT