MAGGETUIDSTATUS ;WOIFO/RRM - GET UID STATUS ; Feb 24, 2023@12:26:15
;;3.0;IMAGING;**345**;Mar 19, 2002;Build 2
;; Per VA Directive 6402, 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. |
;; | |
;; | 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 ;No direct call
;
STUDYUIDSTAT(STUDYUID) ;Get the STUDY UID status
N STUDYIEN,STATUS
S STATUS=""
I $D(^MAGV(2005.62,"B",STUDYUID)) D
. ;get UID status of the latest entry
. S STUDYIEN=$O(^MAGV(2005.62,"B",STUDYUID,""),-1)
. S STATUS=$P($G(^MAGV(2005.62,STUDYIEN,5)),U,2)
Q $G(STATUS)
;
GETSERIESUIDSTAT(SERIESUID) ;
N SERIESIEN,STATUS
S STATUS=""
I $D(^MAGV(2005.63,"B",SERIESUID)) D
. ;get UID status of the latest entry
. S SERIESIEN=$O(^MAGV(2005.63,"B",SERIESUID,""),-1)
. S STATUS=$G(^MAGV(2005.63,SERIESIEN,9))
Q $G(STATUS)
;
GETSOPUIDSTAT(SOPUID) ;
N SOPIEN,STATUS,ISAOF
S STATUS=""
I $D(^MAGV(2005.64,"B",SOPUID)) D
. ;get UID status of the the latest entry
. S SOPIEN=$O(^MAGV(2005.64,"B",SOPUID,""),-1)
. S STATUS=$G(^MAGV(2005.64,SOPIEN,11))
. S ISAOF=$P($G(^MAGV(2005.64,SOPIEN,6)),U,2)
Q $G(STATUS)
;
GETUIDSTAT2005(UID) ;
N MAGIEN,STATUS
S STATUS=""
I $D(^MAG(2005,"P",UID)) D Q:$G(STATUS)
. ;get the latest entry
. S MAGIEN=$O(^MAG(2005,"P",UID,""),-1)
. S STATUS=$P($G(^MAG(2005,MAGIEN,100)),"^",8)
I $D(^MAG(2005,"SERIESUID",UID)) D
. S MAGIEN=$O(^MAG(2005,"SERIESUID",UID,""),-1)
. S STATUS=$P($G(^MAG(2005,MAGIEN,100)),"^",8)
Q $G(STATUS)
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HMAGGETUIDSTATUS 2357 printed Dec 13, 2024@02:02:26 Page 2
MAGGETUIDSTATUS ;WOIFO/RRM - GET UID STATUS ; Feb 24, 2023@12:26:15
+1 ;;3.0;IMAGING;**345**;Mar 19, 2002;Build 2
+2 ;; Per VA Directive 6402, 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 ;; | |
+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 ;
+18 ;No direct call
QUIT
+19 ;
STUDYUIDSTAT(STUDYUID) ;Get the STUDY UID status
+1 NEW STUDYIEN,STATUS
+2 SET STATUS=""
+3 IF $DATA(^MAGV(2005.62,"B",STUDYUID))
Begin DoDot:1
+4 ;get UID status of the latest entry
+5 SET STUDYIEN=$ORDER(^MAGV(2005.62,"B",STUDYUID,""),-1)
+6 SET STATUS=$PIECE($GET(^MAGV(2005.62,STUDYIEN,5)),U,2)
End DoDot:1
+7 QUIT $GET(STATUS)
+8 ;
GETSERIESUIDSTAT(SERIESUID) ;
+1 NEW SERIESIEN,STATUS
+2 SET STATUS=""
+3 IF $DATA(^MAGV(2005.63,"B",SERIESUID))
Begin DoDot:1
+4 ;get UID status of the latest entry
+5 SET SERIESIEN=$ORDER(^MAGV(2005.63,"B",SERIESUID,""),-1)
+6 SET STATUS=$GET(^MAGV(2005.63,SERIESIEN,9))
End DoDot:1
+7 QUIT $GET(STATUS)
+8 ;
GETSOPUIDSTAT(SOPUID) ;
+1 NEW SOPIEN,STATUS,ISAOF
+2 SET STATUS=""
+3 IF $DATA(^MAGV(2005.64,"B",SOPUID))
Begin DoDot:1
+4 ;get UID status of the the latest entry
+5 SET SOPIEN=$ORDER(^MAGV(2005.64,"B",SOPUID,""),-1)
+6 SET STATUS=$GET(^MAGV(2005.64,SOPIEN,11))
+7 SET ISAOF=$PIECE($GET(^MAGV(2005.64,SOPIEN,6)),U,2)
End DoDot:1
+8 QUIT $GET(STATUS)
+9 ;
GETUIDSTAT2005(UID) ;
+1 NEW MAGIEN,STATUS
+2 SET STATUS=""
+3 IF $DATA(^MAG(2005,"P",UID))
Begin DoDot:1
+4 ;get the latest entry
+5 SET MAGIEN=$ORDER(^MAG(2005,"P",UID,""),-1)
+6 SET STATUS=$PIECE($GET(^MAG(2005,MAGIEN,100)),"^",8)
End DoDot:1
if $GET(STATUS)
QUIT
+7 IF $DATA(^MAG(2005,"SERIESUID",UID))
Begin DoDot:1
+8 SET MAGIEN=$ORDER(^MAG(2005,"SERIESUID",UID,""),-1)
+9 SET STATUS=$PIECE($GET(^MAG(2005,MAGIEN,100)),"^",8)
End DoDot:1
+10 QUIT $GET(STATUS)
+11 ;