- MAGGTU7 ;WOIFO/GEK/SG - Silent calls for Queing functions from GUI ; 3/9/09 12:52pm
- ;;3.0;IMAGING;**8,20,93**;Dec 02, 2009;Build 163
- ;; 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
- ONJBOX(MAGIEN,CODE) ;
- ;Check to see if the image ( Abs, Full, or Big ) is on the worm
- ; before queuing it to be copied to HardDrive.
- ; We're testing to see if a pointer to the magnetic exists.
- ; If not then we assume the Image is on JukeBox
- N ZNODE
- S ZNODE=$G(^MAG(2005,+MAGIEN,0))
- IF '$L(ZNODE) Q 0
- IF $$IMOFFLN^MAGFILEB($P(ZNODE,"^",2)) Q 0
- Q:((+$P(ZNODE,U,11))!(+$P(ZNODE,U,12))) 0
- IF CODE="A" Q '$P(ZNODE,U,4)
- IF CODE="F" Q '$P(ZNODE,U,3)
- IF CODE="B" Q $S('$P(^MAG(2005,+MAGIEN,"FBIG"),U,2):0,1:'$P(^MAG(2005,+MAGIEN,"FBIG"),U,1))
- ;
- Q
- QUEIMAGE(MAGRY,CODE,MAGIEN) ;RPC [MAGG QUE IMAGE]
- ; Call to Queue an image for copy from Jukebox
- ; NOTE : This is also called from other M routines.
- ;
- ; CODE is a string code for which images to Queue
- ; ["A" Abatract
- ; ["F" Full Resolution
- ; ["B" Big File
- ;
- N Y,QUE
- S QUE=""
- S MAGRY="0^Error setting Que from JukeBox"
- ;S MAGRY="1^Image was Queued to copy from JukeBox"
- ; GEK 6/27/03 added code (ABS4IMAG) that returns 1|0 1 if this image should have an Abstract
- ; This will stop the Queing of Canned Bitmaps for Images of type DOC, PDF, WAV, AVI etc.
- I (CODE["A"),$$ONJBOX(MAGIEN,"A"),$$ABS4IMAG^MAGGSFT(MAGIEN) S Y=$$JBTOHD^MAGBAPI(+MAGIEN_"^ABSTRACT",$$DA2PLC^MAGBAPIP(MAGIEN,"A")) S QUE="A" ; DBI - SEB 9/20/2002
- I (CODE["F"),$$ONJBOX(MAGIEN,"F") S Y=$$JBTOHD^MAGBAPI(+MAGIEN_"^FULL",$$DA2PLC^MAGBAPIP(MAGIEN,"F")) S QUE=QUE_"F" ; DBI - SEB 9/20/2002
- I (CODE["B"),$$ONJBOX(MAGIEN,"B") S Y=$$JBTOHD^MAGBAPI(+MAGIEN_"^BIG",$$DA2PLC^MAGBAPIP(MAGIEN,"B")) S QUE=QUE_"B" ; DBI - SEB 9/20/2002
- I QUE="" S MAGRY="1^Copy from JukeBox not needed, Image was NOT Queued."
- E S MAGRY="1^Image was Queued to copy from JukeBox ("_QUE_")"
- Q
- QPREFET(MAGRY,CODE,MAGIEN) ;
- ; CODE is a string code for which images to Queue
- ; ["A" Abatract
- ; ["F" Full Resolution
- ; ["B" Big File
- ;
- N Y,QUE
- S QUE=""
- S MAGRY="0^Error setting Prefetch Que from JukeBox"
- ;S MAGRY="1^Image was Queued to copy from JukeBox"
- I (CODE["A"),$$ONJBOX(MAGIEN,"A"),$$ABS4IMAG^MAGGSFT(MAGIEN) S Y=$$PREFET^MAGBAPI(+MAGIEN_"^ABSTRACT",$$DA2PLC^MAGBAPIP(MAGIEN,"A")) S QUE="A" ; DBI - SEB 9/20/2002
- I (CODE["F"),$$ONJBOX(MAGIEN,"F") S Y=$$PREFET^MAGBAPI(+MAGIEN_"^FULL",$$DA2PLC^MAGBAPIP(MAGIEN,"F")) S QUE=QUE_"F" ; DBI - SEB 9/20/2002
- I (CODE["B"),$$ONJBOX(MAGIEN,"B") S Y=$$PREFET^MAGBAPI(+MAGIEN_"^BIG",$$DA2PLC^MAGBAPIP(MAGIEN,"B")) S QUE=QUE_"B" ; DBI - SEB 9/20/2002
- I QUE="" S MAGRY="1^Copy from JukeBox not needed, Image was NOT Queued."
- E S MAGRY="1^Image was Queued to copy from JukeBox"
- Q
- QUELIST(MAGRY,CODE,LIST) ;RPC [MAGG QUE LIST]
- ; Call to queue all images in the input list for a copy from jukebox
- ;
- ; CODE is a string code for which images to Queue
- ; ["A" Abatract
- ; ["F" Full Resolution
- ; ["B" Big File
- ; LIST is an array of Image IEN's, we queue images contained in CODE
- ;
- N Y,CT,XX
- S CT=0
- S X="" F S X=$O(LIST(X)) Q:X="" D QUEIMAGE(.XX,CODE,X) S CT=CT+1
- S MAGRY=CT_"^"_CT_" Image"_$S(CT=1:"",1:"'s")_" Queued to copy from JukeBox"
- Q
- QUEGROUP(MAGRY,CODE,MAGIEN,QCODE) ;RPC [MAGG QUE IMAGE GROUP]
- ; Call to queue all images of an Image group for a copy from JukeBox.
- ; This can also be a PREFETCH, in which case the Images being
- ; Queued have a lower priority than other copies from JukeBox
- ;
- ; CODE is a string code for which images to Queue
- ; ["A" Abatract
- ; ["F" Full Resolution
- ; ["B" Big File
- ; MAGIEN is assumed to be a group image.
- ; QCODE is a QUEUE code. If = 1 then this is a prefetch
- ; here we are queing the images contained in CODE
- ; for all images in the group.
- N X,Y,Z,CT,XX
- S QCODE=$G(QCODE)
- I '$D(^MAG(2005,+MAGIEN,0)) S MAGRY="0^Invalid Image IEN. Queuing Canceled." Q
- S CT=0,X=0
- F S X=$O(^MAG(2005,+MAGIEN,1,X)) Q:'X S Z=+^(X,0) D
- . I QCODE D QPREFET(.XX,CODE,Z) S CT=CT+1
- . I 'QCODE D QUEIMAGE(.XX,CODE,Z) S CT=CT+1
- S MAGRY=CT_"^"_CT_" Group Image"_$S(CT=1:"",1:"'s")_" Queued to copy from JukeBox"
- Q
- QUEPAT(MAGRY,CODE,MAGDFN) ;RPC [MAGG QUE PATIENT]
- ; Call to Prefetch all images for a patient.
- ; CODE is a string code for which images to Queue
- ; ["A" Abatract
- ; ["F" Full Resolution
- ; ["B" Big File
- ; this will queue a JBTOHD copy for all images for the patient.
- ; images queued depend on what is contained in CODE
- ;
- N Y,I,XX
- I '$D(^MAG(2005,"AC",+MAGDFN)) S MAGRY="0^No Images on file for "_$P($G(^DPT(+MAGDFN,0)),U,1) Q
- S I="" F S I=$O(^MAG(2005,"AC",+MAGDFN,I),-1) Q:'I D
- . I $P(^MAG(2005,I,0),U,10) Q
- . Q:$$ISDEL^MAGGI11(I)
- . I $P(^MAG(2005,I,0),U,6)="11" D QUEGROUP(.XX,CODE,I,1) Q
- . D QPREFET(.XX,CODE,I)
- S MAGRY="1^"_$P(^DPT(+MAGDFN,0),U)_"'s Images will be copied from the JukeBox."
- Q
- --- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HMAGGTU7 6033 printed Jan 18, 2025@03:04:44 Page 2
- MAGGTU7 ;WOIFO/GEK/SG - Silent calls for Queing functions from GUI ; 3/9/09 12:52pm
- +1 ;;3.0;IMAGING;**8,20,93**;Dec 02, 2009;Build 163
- +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 ;; | |
- +11 ;; | The Food and Drug Administration classifies this software as |
- +12 ;; | a medical device. As such, it may not be changed in any way. |
- +13 ;; | Modifications to this software may result in an adulterated |
- +14 ;; | medical device under 21CFR820, the use of which is considered |
- +15 ;; | to be a violation of US Federal Statutes. |
- +16 ;; +---------------------------------------------------------------+
- +17 ;;
- +18 QUIT
- ONJBOX(MAGIEN,CODE) ;
- +1 ;Check to see if the image ( Abs, Full, or Big ) is on the worm
- +2 ; before queuing it to be copied to HardDrive.
- +3 ; We're testing to see if a pointer to the magnetic exists.
- +4 ; If not then we assume the Image is on JukeBox
- +5 NEW ZNODE
- +6 SET ZNODE=$GET(^MAG(2005,+MAGIEN,0))
- +7 IF '$LENGTH(ZNODE)
- QUIT 0
- +8 IF $$IMOFFLN^MAGFILEB($PIECE(ZNODE,"^",2))
- QUIT 0
- +9 if ((+$PIECE(ZNODE,U,11))!(+$PIECE(ZNODE,U,12)))
- QUIT 0
- +10 IF CODE="A"
- QUIT '$PIECE(ZNODE,U,4)
- +11 IF CODE="F"
- QUIT '$PIECE(ZNODE,U,3)
- +12 IF CODE="B"
- QUIT $SELECT('$PIECE(^MAG(2005,+MAGIEN,"FBIG"),U,2):0,1:'$PIECE(^MAG(2005,+MAGIEN,"FBIG"),U,1))
- +13 ;
- +14 QUIT
- QUEIMAGE(MAGRY,CODE,MAGIEN) ;RPC [MAGG QUE IMAGE]
- +1 ; Call to Queue an image for copy from Jukebox
- +2 ; NOTE : This is also called from other M routines.
- +3 ;
- +4 ; CODE is a string code for which images to Queue
- +5 ; ["A" Abatract
- +6 ; ["F" Full Resolution
- +7 ; ["B" Big File
- +8 ;
- +9 NEW Y,QUE
- +10 SET QUE=""
- +11 SET MAGRY="0^Error setting Que from JukeBox"
- +12 ;S MAGRY="1^Image was Queued to copy from JukeBox"
- +13 ; GEK 6/27/03 added code (ABS4IMAG) that returns 1|0 1 if this image should have an Abstract
- +14 ; This will stop the Queing of Canned Bitmaps for Images of type DOC, PDF, WAV, AVI etc.
- +15 ; DBI - SEB 9/20/2002
- IF (CODE["A")
- IF $$ONJBOX(MAGIEN,"A")
- IF $$ABS4IMAG^MAGGSFT(MAGIEN)
- SET Y=$$JBTOHD^MAGBAPI(+MAGIEN_"^ABSTRACT",$$DA2PLC^MAGBAPIP(MAGIEN,"A"))
- SET QUE="A"
- +16 ; DBI - SEB 9/20/2002
- IF (CODE["F")
- IF $$ONJBOX(MAGIEN,"F")
- SET Y=$$JBTOHD^MAGBAPI(+MAGIEN_"^FULL",$$DA2PLC^MAGBAPIP(MAGIEN,"F"))
- SET QUE=QUE_"F"
- +17 ; DBI - SEB 9/20/2002
- IF (CODE["B")
- IF $$ONJBOX(MAGIEN,"B")
- SET Y=$$JBTOHD^MAGBAPI(+MAGIEN_"^BIG",$$DA2PLC^MAGBAPIP(MAGIEN,"B"))
- SET QUE=QUE_"B"
- +18 IF QUE=""
- SET MAGRY="1^Copy from JukeBox not needed, Image was NOT Queued."
- +19 IF '$TEST
- SET MAGRY="1^Image was Queued to copy from JukeBox ("_QUE_")"
- +20 QUIT
- QPREFET(MAGRY,CODE,MAGIEN) ;
- +1 ; CODE is a string code for which images to Queue
- +2 ; ["A" Abatract
- +3 ; ["F" Full Resolution
- +4 ; ["B" Big File
- +5 ;
- +6 NEW Y,QUE
- +7 SET QUE=""
- +8 SET MAGRY="0^Error setting Prefetch Que from JukeBox"
- +9 ;S MAGRY="1^Image was Queued to copy from JukeBox"
- +10 ; DBI - SEB 9/20/2002
- IF (CODE["A")
- IF $$ONJBOX(MAGIEN,"A")
- IF $$ABS4IMAG^MAGGSFT(MAGIEN)
- SET Y=$$PREFET^MAGBAPI(+MAGIEN_"^ABSTRACT",$$DA2PLC^MAGBAPIP(MAGIEN,"A"))
- SET QUE="A"
- +11 ; DBI - SEB 9/20/2002
- IF (CODE["F")
- IF $$ONJBOX(MAGIEN,"F")
- SET Y=$$PREFET^MAGBAPI(+MAGIEN_"^FULL",$$DA2PLC^MAGBAPIP(MAGIEN,"F"))
- SET QUE=QUE_"F"
- +12 ; DBI - SEB 9/20/2002
- IF (CODE["B")
- IF $$ONJBOX(MAGIEN,"B")
- SET Y=$$PREFET^MAGBAPI(+MAGIEN_"^BIG",$$DA2PLC^MAGBAPIP(MAGIEN,"B"))
- SET QUE=QUE_"B"
- +13 IF QUE=""
- SET MAGRY="1^Copy from JukeBox not needed, Image was NOT Queued."
- +14 IF '$TEST
- SET MAGRY="1^Image was Queued to copy from JukeBox"
- +15 QUIT
- QUELIST(MAGRY,CODE,LIST) ;RPC [MAGG QUE LIST]
- +1 ; Call to queue all images in the input list for a copy from jukebox
- +2 ;
- +3 ; CODE is a string code for which images to Queue
- +4 ; ["A" Abatract
- +5 ; ["F" Full Resolution
- +6 ; ["B" Big File
- +7 ; LIST is an array of Image IEN's, we queue images contained in CODE
- +8 ;
- +9 NEW Y,CT,XX
- +10 SET CT=0
- +11 SET X=""
- FOR
- SET X=$ORDER(LIST(X))
- if X=""
- QUIT
- DO QUEIMAGE(.XX,CODE,X)
- SET CT=CT+1
- +12 SET MAGRY=CT_"^"_CT_" Image"_$SELECT(CT=1:"",1:"'s")_" Queued to copy from JukeBox"
- +13 QUIT
- QUEGROUP(MAGRY,CODE,MAGIEN,QCODE) ;RPC [MAGG QUE IMAGE GROUP]
- +1 ; Call to queue all images of an Image group for a copy from JukeBox.
- +2 ; This can also be a PREFETCH, in which case the Images being
- +3 ; Queued have a lower priority than other copies from JukeBox
- +4 ;
- +5 ; CODE is a string code for which images to Queue
- +6 ; ["A" Abatract
- +7 ; ["F" Full Resolution
- +8 ; ["B" Big File
- +9 ; MAGIEN is assumed to be a group image.
- +10 ; QCODE is a QUEUE code. If = 1 then this is a prefetch
- +11 ; here we are queing the images contained in CODE
- +12 ; for all images in the group.
- +13 NEW X,Y,Z,CT,XX
- +14 SET QCODE=$GET(QCODE)
- +15 IF '$DATA(^MAG(2005,+MAGIEN,0))
- SET MAGRY="0^Invalid Image IEN. Queuing Canceled."
- QUIT
- +16 SET CT=0
- SET X=0
- +17 FOR
- SET X=$ORDER(^MAG(2005,+MAGIEN,1,X))
- if 'X
- QUIT
- SET Z=+^(X,0)
- Begin DoDot:1
- +18 IF QCODE
- DO QPREFET(.XX,CODE,Z)
- SET CT=CT+1
- +19 IF 'QCODE
- DO QUEIMAGE(.XX,CODE,Z)
- SET CT=CT+1
- End DoDot:1
- +20 SET MAGRY=CT_"^"_CT_" Group Image"_$SELECT(CT=1:"",1:"'s")_" Queued to copy from JukeBox"
- +21 QUIT
- QUEPAT(MAGRY,CODE,MAGDFN) ;RPC [MAGG QUE PATIENT]
- +1 ; Call to Prefetch all images for a patient.
- +2 ; CODE is a string code for which images to Queue
- +3 ; ["A" Abatract
- +4 ; ["F" Full Resolution
- +5 ; ["B" Big File
- +6 ; this will queue a JBTOHD copy for all images for the patient.
- +7 ; images queued depend on what is contained in CODE
- +8 ;
- +9 NEW Y,I,XX
- +10 IF '$DATA(^MAG(2005,"AC",+MAGDFN))
- SET MAGRY="0^No Images on file for "_$PIECE($GET(^DPT(+MAGDFN,0)),U,1)
- QUIT
- +11 SET I=""
- FOR
- SET I=$ORDER(^MAG(2005,"AC",+MAGDFN,I),-1)
- if 'I
- QUIT
- Begin DoDot:1
- +12 IF $PIECE(^MAG(2005,I,0),U,10)
- QUIT
- +13 if $$ISDEL^MAGGI11(I)
- QUIT
- +14 IF $PIECE(^MAG(2005,I,0),U,6)="11"
- DO QUEGROUP(.XX,CODE,I,1)
- QUIT
- +15 DO QPREFET(.XX,CODE,I)
- End DoDot:1
- +16 SET MAGRY="1^"_$PIECE(^DPT(+MAGDFN,0),U)_"'s Images will be copied from the JukeBox."
- +17 QUIT