MAGQBAB ;WOIFO/PMK/RMP - Create an ABSTRACT from an image file ; 18 Jan 2011 4:09 PM
;;3.0;IMAGING;**1,8,20,39**;Mar 19, 2002;Build 2010;Mar 08, 2011
;; 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
ENTRY(RESULT,QPTR) ;
; RESULT=STATUS^IMAGE PTR^FROM FILEPATH^ABSTRACT FILEPATH^QPTR^VWP^QSN
; VWP=VISTA WRITE LOCATION,QSN=QUEUE SEQUENCE NUMBER
N IMGPTR,L,X,MAGXX,FILENAME,FILE,ABSNAME,JBPATH
N MAGNODE,MAGFILE,MAGFILE2,QSN,QNODE,MAGDRIVE,CWL,PLACE
S PLACE=$$PLACE^MAGBAPI(+$G(DUZ(2)))
S U="^",QNODE=$G(^MAGQUEUE(2006.03,QPTR,0))
S IMGPTR=$P(QNODE,U,7),QSN=+$P(QNODE,U,9)
S MAGNODE=$G(^MAG(2005,IMGPTR,0))
I $P(MAGNODE,U,2)="" D Q
. S RESULT="-1^"_QPTR_U_"The Image file entry has no file name for IEN: "_IMGPTR_"^^^^"_QSN
. Q
I $P(MAGNODE,U,4)?1N.N D Q
. S RESULT="-1^"_QPTR_U_$P($P(MAGNODE,U,2),".")_" has an .ABS file already referenced on the VistA cache ^^^^"_QSN
. Q
I $P(MAGNODE,U,3)="" D Q
. I $P(MAGNODE,U,5)?1N.N D Q
. . N QN,TMP
. . S QN=$$JBTOHD^MAGBAPI(IMGPTR_U_"FULL",PLACE)
. . S TMP=IMGPTR_" Full File is not on the VC, a JBTOHD queue will retrieve and the ABSTRACT will be requeued"
. . S RESULT="-15^"_QPTR_U_TMP_"^^"_QPTR_"^^"_QSN
. . Q
. S RESULT="-2^"_QPTR_U_IMGPTR_" File not available on the VistA network^^"_QPTR_"^^"_QSN
; get the path and file name for this image
S MAGXX=IMGPTR D VSTNOCP^MAGFILEB I $E(MAGFILE1,1,2)="-1" D Q
. S RESULT="-3^"_QPTR_U_IMGPTR_" File not online^^"_QPTR_"^^"_QSN
S FILENAME=MAGFILE
S L=$L(FILENAME) I '$A(FILENAME,L) S FILENAME=$E(FILENAME,1,L-1)
S L=$L(FILENAME,"\") ; parse the file
S FILE=$P(FILENAME,"\",L)
K MAGFILE1
;
S JBPATH=$P(MAGNODE,U,5)
S JBPATH=$S('JBPATH:"",1:$P(^MAG(2005.2,JBPATH,0),U,2)_$$DIRHASH^MAGFILEB(FILE,JBPATH))
S CWL=$$CWL^MAGBAPI(PLACE),MAGDRIVE=$P(^MAG(2005.2,CWL,0),U,2)
S ABSNAME=MAGDRIVE_$$DIRHASH^MAGFILEB(FILE,CWL)
S ABSNAME=ABSNAME_$P(FILE,".")_".ABS"
S RESULT="1"_U_IMGPTR_U_FILENAME_U_ABSNAME_U_QPTR_U_CWL_U_QSN_U_JBPATH
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HMAGQBAB 2951 printed Dec 13, 2024@02:07:42 Page 2
MAGQBAB ;WOIFO/PMK/RMP - Create an ABSTRACT from an image file ; 18 Jan 2011 4:09 PM
+1 ;;3.0;IMAGING;**1,8,20,39**;Mar 19, 2002;Build 2010;Mar 08, 2011
+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
ENTRY(RESULT,QPTR) ;
+1 ; RESULT=STATUS^IMAGE PTR^FROM FILEPATH^ABSTRACT FILEPATH^QPTR^VWP^QSN
+2 ; VWP=VISTA WRITE LOCATION,QSN=QUEUE SEQUENCE NUMBER
+3 NEW IMGPTR,L,X,MAGXX,FILENAME,FILE,ABSNAME,JBPATH
+4 NEW MAGNODE,MAGFILE,MAGFILE2,QSN,QNODE,MAGDRIVE,CWL,PLACE
+5 SET PLACE=$$PLACE^MAGBAPI(+$GET(DUZ(2)))
+6 SET U="^"
SET QNODE=$GET(^MAGQUEUE(2006.03,QPTR,0))
+7 SET IMGPTR=$PIECE(QNODE,U,7)
SET QSN=+$PIECE(QNODE,U,9)
+8 SET MAGNODE=$GET(^MAG(2005,IMGPTR,0))
+9 IF $PIECE(MAGNODE,U,2)=""
Begin DoDot:1
+10 SET RESULT="-1^"_QPTR_U_"The Image file entry has no file name for IEN: "_IMGPTR_"^^^^"_QSN
+11 QUIT
End DoDot:1
QUIT
+12 IF $PIECE(MAGNODE,U,4)?1N.N
Begin DoDot:1
+13 SET RESULT="-1^"_QPTR_U_$PIECE($PIECE(MAGNODE,U,2),".")_" has an .ABS file already referenced on the VistA cache ^^^^"_QSN
+14 QUIT
End DoDot:1
QUIT
+15 IF $PIECE(MAGNODE,U,3)=""
Begin DoDot:1
+16 IF $PIECE(MAGNODE,U,5)?1N.N
Begin DoDot:2
+17 NEW QN,TMP
+18 SET QN=$$JBTOHD^MAGBAPI(IMGPTR_U_"FULL",PLACE)
+19 SET TMP=IMGPTR_" Full File is not on the VC, a JBTOHD queue will retrieve and the ABSTRACT will be requeued"
+20 SET RESULT="-15^"_QPTR_U_TMP_"^^"_QPTR_"^^"_QSN
+21 QUIT
End DoDot:2
QUIT
+22 SET RESULT="-2^"_QPTR_U_IMGPTR_" File not available on the VistA network^^"_QPTR_"^^"_QSN
End DoDot:1
QUIT
+23 ; get the path and file name for this image
+24 SET MAGXX=IMGPTR
DO VSTNOCP^MAGFILEB
IF $EXTRACT(MAGFILE1,1,2)="-1"
Begin DoDot:1
+25 SET RESULT="-3^"_QPTR_U_IMGPTR_" File not online^^"_QPTR_"^^"_QSN
End DoDot:1
QUIT
+26 SET FILENAME=MAGFILE
+27 SET L=$LENGTH(FILENAME)
IF '$ASCII(FILENAME,L)
SET FILENAME=$EXTRACT(FILENAME,1,L-1)
+28 ; parse the file
SET L=$LENGTH(FILENAME,"\")
+29 SET FILE=$PIECE(FILENAME,"\",L)
+30 KILL MAGFILE1
+31 ;
+32 SET JBPATH=$PIECE(MAGNODE,U,5)
+33 SET JBPATH=$SELECT('JBPATH:"",1:$PIECE(^MAG(2005.2,JBPATH,0),U,2)_$$DIRHASH^MAGFILEB(FILE,JBPATH))
+34 SET CWL=$$CWL^MAGBAPI(PLACE)
SET MAGDRIVE=$PIECE(^MAG(2005.2,CWL,0),U,2)
+35 SET ABSNAME=MAGDRIVE_$$DIRHASH^MAGFILEB(FILE,CWL)
+36 SET ABSNAME=ABSNAME_$PIECE(FILE,".")_".ABS"
+37 SET RESULT="1"_U_IMGPTR_U_FILENAME_U_ABSNAME_U_QPTR_U_CWL_U_QSN_U_JBPATH
+38 QUIT