MAGGSFT ;WOIFO/GEK - Utilities ; 26 May 2010 10:20 AM
;;3.0;IMAGING;**7,8,94,158**;Mar 19, 2002;Build 12;May 19, 2015
;; 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
LIST(MAGRY) ;RPC [MAG4 GET SUPPORTED EXTENSIONS]
;to return a list of supported image file extensions
N I,Y,CT,MAGN0
;NAME [1F] ^ DESCRIPTION [2F] ^VIEWER [3S] ^
; Bitmap for Abstract [4F] ^Abstract Created [5S] ^ Default Object Type [6P]
;
; 2nd "|" piece is system info = Ien of 2005.021 ^ NAME ^ Default Object Type [6P]
S MAGRY(0)="0^Compiling list of supported extensions..."
S MAGRY(1)="Ext^Description^Imaging Viewer^Abs Bitmap^Abs Created"
S CT=1
S I=0 F S I=$O(^MAG(2005.021,I)) Q:'I S MAGN0=^(I,0) D
. I $P(^MAG(2005.021,I,0),"^",7)=0 Q
. S CT=CT+1
. S MAGRY(CT)=$P(MAGN0,U,1,5)_"|"_I_U_$P(MAGN0,U)_U_$P(MAGN0,U,6)
S MAGRY(0)="1^Okay"
Q
EXTSUPP(MAGRY,MAGEXT) ; Is the Extension supported
; MAGRY(0) = 1|0 ^ message
;
N MAGIEN
S MAGEXT=$$UP^XLFSTR(MAGEXT) ; IA #10104
S MAGIEN=$O(^MAG(2005.021,"B",MAGEXT,""))
I 'MAGIEN S MAGRY(0)="0^Unsupported File Extension : "_MAGEXT Q 0
I $P(^MAG(2005.021,MAGIEN,0),"^",7)=0 S MAGRY(0)="0^No Longer Supported File Extension : "_MAGEXT Q 0
S MAGRY(0)="1^OK"
Q MAGIEN
;
INFO(MAGRY,MAGEXT) ;RPC [MAG4 GET FILE FORMAT INFO]
;IMAGE FILE TYPES FILE ^MAG(2005.021
;NAME [1F] ^ DESCRIPTION [2F] ^VIEWER [3S] ^
; Bitmap for Abstract [4F] ^Abstract Created [5S] ^ Default Object Type [6P]
;
;"Ext^Description^Imaging Viewer^Abs Bitmap^Abs Created"
; "|" IEN ^ NAME ^ Default Object Type [6P]
;
N MAGN0,MAGIEN
K MAGRY
S MAGIEN=$$EXTSUPP(.MAGRY,MAGEXT) ; Set MAGRY(0) and get IEN
I 'MAGIEN Q
S MAGN0=^MAG(2005.021,MAGIEN,0)
S MAGRY(1)=$P(MAGN0,U,1,5)_"|"_MAGIEN_U_$P(MAGN0,U)_U_$P(MAGN0,U,6)
Q
ABS4IMAG(MAGIEN) ; True, False If the Image (MAGIEN) has an abstract
; We base this on the Extension of image, in the IMAGE FILE TYPES file.
N X,FTIEN
S X=$P($P($G(^MAG(2005,MAGIEN,0)),"^",2),".",2)
I '$L(X) Q 0
S FTIEN=$O(^MAG(2005.021,"B",X,""))
I 'FTIEN Q 0
Q $P(^MAG(2005.021,FTIEN,0),"^",5)
;
ABSPDFNO(VAL) ;PATCH 158 Backout routine.
; if a site needs to turn OFF creation of abstracts for PDF's, they
; can call this tag.
; Called with VAL = "" it will default to 0)
; Called with VAL = 0 turn off creation of Abstracts for PDF's)
; Called with VAL = 1 turn ON creation of Abstracts for PDF's)
N PDFID
S PDFID=$O(^MAG(2005.021,"B","PDF",""))
I 'PDFID W !,"Error - PDF entry does not exist in IMAGE FILE TYPES File" Q
S VAL=$G(VAL,0)
; if turning off
I 'VAL D W !,"Abstracts for PDF's will not be created" Q
. S $P(^MAG(2005.021,PDFID,0),"^",4)="magpdf.bmp" ;canned bitmap to use.
. S $P(^MAG(2005.021,PDFID,0),"^",5)="0" ; abstracts created = 0 NO
. Q
I VAL D W !,"Abstracts for PDF's will be created" Q
. S $P(^MAG(2005.021,PDFID,0),"^",4)="" ; erase the canned bitmap.
. S $P(^MAG(2005.021,PDFID,0),"^",5)="1" ; abstracts created = 1 YES
. Q
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HMAGGSFT 4000 printed Dec 13, 2024@02:02:40 Page 2
MAGGSFT ;WOIFO/GEK - Utilities ; 26 May 2010 10:20 AM
+1 ;;3.0;IMAGING;**7,8,94,158**;Mar 19, 2002;Build 12;May 19, 2015
+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
LIST(MAGRY) ;RPC [MAG4 GET SUPPORTED EXTENSIONS]
+1 ;to return a list of supported image file extensions
+2 NEW I,Y,CT,MAGN0
+3 ;NAME [1F] ^ DESCRIPTION [2F] ^VIEWER [3S] ^
+4 ; Bitmap for Abstract [4F] ^Abstract Created [5S] ^ Default Object Type [6P]
+5 ;
+6 ; 2nd "|" piece is system info = Ien of 2005.021 ^ NAME ^ Default Object Type [6P]
+7 SET MAGRY(0)="0^Compiling list of supported extensions..."
+8 SET MAGRY(1)="Ext^Description^Imaging Viewer^Abs Bitmap^Abs Created"
+9 SET CT=1
+10 SET I=0
FOR
SET I=$ORDER(^MAG(2005.021,I))
if 'I
QUIT
SET MAGN0=^(I,0)
Begin DoDot:1
+11 IF $PIECE(^MAG(2005.021,I,0),"^",7)=0
QUIT
+12 SET CT=CT+1
+13 SET MAGRY(CT)=$PIECE(MAGN0,U,1,5)_"|"_I_U_$PIECE(MAGN0,U)_U_$PIECE(MAGN0,U,6)
End DoDot:1
+14 SET MAGRY(0)="1^Okay"
+15 QUIT
EXTSUPP(MAGRY,MAGEXT) ; Is the Extension supported
+1 ; MAGRY(0) = 1|0 ^ message
+2 ;
+3 NEW MAGIEN
+4 ; IA #10104
SET MAGEXT=$$UP^XLFSTR(MAGEXT)
+5 SET MAGIEN=$ORDER(^MAG(2005.021,"B",MAGEXT,""))
+6 IF 'MAGIEN
SET MAGRY(0)="0^Unsupported File Extension : "_MAGEXT
QUIT 0
+7 IF $PIECE(^MAG(2005.021,MAGIEN,0),"^",7)=0
SET MAGRY(0)="0^No Longer Supported File Extension : "_MAGEXT
QUIT 0
+8 SET MAGRY(0)="1^OK"
+9 QUIT MAGIEN
+10 ;
INFO(MAGRY,MAGEXT) ;RPC [MAG4 GET FILE FORMAT INFO]
+1 ;IMAGE FILE TYPES FILE ^MAG(2005.021
+2 ;NAME [1F] ^ DESCRIPTION [2F] ^VIEWER [3S] ^
+3 ; Bitmap for Abstract [4F] ^Abstract Created [5S] ^ Default Object Type [6P]
+4 ;
+5 ;"Ext^Description^Imaging Viewer^Abs Bitmap^Abs Created"
+6 ; "|" IEN ^ NAME ^ Default Object Type [6P]
+7 ;
+8 NEW MAGN0,MAGIEN
+9 KILL MAGRY
+10 ; Set MAGRY(0) and get IEN
SET MAGIEN=$$EXTSUPP(.MAGRY,MAGEXT)
+11 IF 'MAGIEN
QUIT
+12 SET MAGN0=^MAG(2005.021,MAGIEN,0)
+13 SET MAGRY(1)=$PIECE(MAGN0,U,1,5)_"|"_MAGIEN_U_$PIECE(MAGN0,U)_U_$PIECE(MAGN0,U,6)
+14 QUIT
ABS4IMAG(MAGIEN) ; True, False If the Image (MAGIEN) has an abstract
+1 ; We base this on the Extension of image, in the IMAGE FILE TYPES file.
+2 NEW X,FTIEN
+3 SET X=$PIECE($PIECE($GET(^MAG(2005,MAGIEN,0)),"^",2),".",2)
+4 IF '$LENGTH(X)
QUIT 0
+5 SET FTIEN=$ORDER(^MAG(2005.021,"B",X,""))
+6 IF 'FTIEN
QUIT 0
+7 QUIT $PIECE(^MAG(2005.021,FTIEN,0),"^",5)
+8 ;
ABSPDFNO(VAL) ;PATCH 158 Backout routine.
+1 ; if a site needs to turn OFF creation of abstracts for PDF's, they
+2 ; can call this tag.
+3 ; Called with VAL = "" it will default to 0)
+4 ; Called with VAL = 0 turn off creation of Abstracts for PDF's)
+5 ; Called with VAL = 1 turn ON creation of Abstracts for PDF's)
+6 NEW PDFID
+7 SET PDFID=$ORDER(^MAG(2005.021,"B","PDF",""))
+8 IF 'PDFID
WRITE !,"Error - PDF entry does not exist in IMAGE FILE TYPES File"
QUIT
+9 SET VAL=$GET(VAL,0)
+10 ; if turning off
+11 IF 'VAL
Begin DoDot:1
+12 ;canned bitmap to use.
SET $PIECE(^MAG(2005.021,PDFID,0),"^",4)="magpdf.bmp"
+13 ; abstracts created = 0 NO
SET $PIECE(^MAG(2005.021,PDFID,0),"^",5)="0"
+14 QUIT
End DoDot:1
WRITE !,"Abstracts for PDF's will not be created"
QUIT
+15 IF VAL
Begin DoDot:1
+16 ; erase the canned bitmap.
SET $PIECE(^MAG(2005.021,PDFID,0),"^",4)=""
+17 ; abstracts created = 1 YES
SET $PIECE(^MAG(2005.021,PDFID,0),"^",5)="1"
+18 QUIT
End DoDot:1
WRITE !,"Abstracts for PDF's will be created"
QUIT
+19 QUIT