Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: MAGGTU3

MAGGTU3.m

Go to the documentation of this file.
  1. MAGGTU3 ;WOIFO/GEK/SG/NST - Silent calls for Imaging ; 21 Jun, 2023@13:43:01
  1. ;;3.0;IMAGING;**7,8,48,45,20,46,59,93,117,151,356**;Mar 19, 2002;Build 8
  1. ;; Per VHA Directive 2004-038, this routine should not be modified.
  1. ;; +---------------------------------------------------------------+
  1. ;; | Property of the US Government. |
  1. ;; | No permission to copy or redistribute this software is given. |
  1. ;; | Use of unreleased versions of this software requires the user |
  1. ;; | to execute a written test agreement with the VistA Imaging |
  1. ;; | Development Office of the Department of Veterans Affairs, |
  1. ;; | telephone (301) 734-0100. |
  1. ;; | The Food and Drug Administration classifies this software as |
  1. ;; | a medical device. As such, it may not be changed in any way. |
  1. ;; | Modifications to this software may result in an adulterated |
  1. ;; | medical device under 21CFR820, the use of which is considered |
  1. ;; | to be a violation of US Federal Statutes. |
  1. ;; +---------------------------------------------------------------+
  1. ;;
  1. Q
  1. IMAGEINF(MAGRY,IEN,NOCHK) ;RPC [MAGG IMAGE INFO] Call to return information for 1 image;
  1. ; IEN = Image IEN ^MAG(2005,IEN
  1. ; NOCHK = 1|"" if 1 then do not run QA check on this image.
  1. ;
  1. N ERR,MAGFILE,Y,Z,MAGNOCHK
  1. ;--- Check if the image is deleted
  1. I $$ISDEL^MAGGI11(IEN,.ERR) D Q
  1. . S Y=$$NODE^MAGGI11(IEN) S:Y'="" Y=$G(@Y@(2))
  1. . S MAGRY(0)="0^Image : """_$P(Y,U,4)_""" has been deleted."
  1. . Q
  1. ;--- Check for errors. Ignore the problem if there are 2 records
  1. ; with the same IEN in files #2005 and #2005.1. After the file
  1. ;--- #2005.1 is completeley eliminated, ",+ERR'=-43" can be deleted.
  1. I ERR<0,+ERR'=-43 S MAGRY(0)="0^INVALID Image number "_IEN Q
  1. ;--- MAGGTII queries the variable MAGNOCHK to run QA check or not.
  1. S MAGNOCHK=+$G(NOCHK)
  1. S MAGFILE=$$INFO^MAGGAII(IEN,"E")
  1. S Z=$P(^MAG(2005,IEN,0),U,7)
  1. I '$D(^DPT(Z)) S Z="1^Invalid patient pointer"
  1. E S Z=Z_U_$P(^DPT(Z,0),U)
  1. S MAGRY(0)="1^"_MAGFILE
  1. S MAGRY(1)=Z ; dfn^name
  1. Q
  1. USERINF2(MAGRY,MAGWRKID) ;RPC [MAGGUSER2] Return user info.
  1. ; MAGRY(1) = DUZ ^ FULL NAME ^ INITIALS
  1. ; MAGRY(2) = Network UserName ^ PassWord.
  1. ; MAGRY(3) = MUSE Site number. ( default = 1)
  1. ; Node 4 is data from IMAGING SITE PARAMATERS File #2006.1 and INSTITUTION File #4
  1. ; MAGRY(4)= PLACE IEN ^ SITE CODE ^ DUZ(2) ^ INSTITUTION NAME (.01) ^ $$CONSOLID ^ User's local STATION NUMBER (99)
  1. ; MAGRY(5) = +<CP Version>|0 ^ Version of CP installed on Server
  1. ; MAGRY(6) = Warning message if we can't resolve which Site Parameter entry to use.
  1. ; MAGRY(7) = Warning message <reserved for future>
  1. ; MAGRY(8) = 1|0 1 = Production account 0 = Test Account (or couldn't determine) ;Patch 41
  1. ; MAGRY(9) = Vista Site Service PHYSICAL REFERENCE from Network Location File.
  1. ; MAGRY(10)=Domain Name
  1. ; MAGRY(11)=Primary Division IEN
  1. ; MAGRY(12)=Primary Division STATION NUMBER
  1. ; p151 Added 13 and 14
  1. ; MAGRY(13)=Clinical Display User Manual URL
  1. ; MAGRY(14)=Clinical Capture User Manual URL
  1. ;
  1. N J,K,Y,MAGPLC,MAGWARN,MAGWARN1,VSRV,PHYREF,X,XUSAPP,ISTELER ; SEB 9/20/2002 - P356 CD 06/20/2023
  1. S MAGPLC=0
  1. I $D(DUZ(2)) S MAGPLC=+$$PLACE^MAGBAPI(DUZ(2)) ; DBI - SEB 9/20/2002
  1. ;
  1. ; SET THE PARTITION VARIABLE MAGSYS i.e.'IGK_Garrett's Desk'
  1. S MAGSYS=$G(MAGWRKID,"")
  1. I +$G(DUZ)=0 S MAGRY(0)="0^DUZ Undefined, Null or Zero" Q
  1. I 'MAGPLC D
  1. . S MAGWARN="Can't resolve Site Param, DUZ(2): "_$S($D(DUZ(2)):DUZ(2),1:"NULL")_" DUZ: "_DUZ
  1. . S MAGPLC=$$DUZ2PLC^MAGBAPIP(.MAGWARN1) ; DBI - SEB 9/20/2002
  1. . Q
  1. S MAGRY(0)="1^"
  1. ; DUZ FULL NAME INITIALS
  1. S MAGRY(1)=DUZ_U_$$GET1^DIQ(200,DUZ_",",.01)_U_$$GET1^DIQ(200,DUZ_",",1)
  1. ; NOW NET STUFF
  1. I 'MAGPLC Q
  1. ; From IMAGING SITE PARAMETERS File
  1. ; get the Network UserName and PassWord.
  1. S MAGRY(2)=$P($G(^MAG(2006.1,MAGPLC,"NET")),U,1,2)
  1. ; get the default MUSE Site number.
  1. S MAGRY(3)=+$P($G(^MAG(2006.1,MAGPLC,"USERPREF")),U,2)
  1. ; default to 1 if nothing is entered in Site Parameters File
  1. I MAGRY(3)=0 S MAGRY(3)=1
  1. ; This SITEIEN^SITECODE^USER INSTITUTION IEN^INSTITUTION NAME^CONSOLIDATED^User's local STATION NUMBER
  1. ; is used by Display to determine location of Workstation
  1. ; and used by Capture to determine the Write Location.
  1. S MAGRY(4)=MAGPLC_U_$$GET1^DIQ(2006.1,MAGPLC,.09)_U_$G(DUZ(2))_U_$$GET1^DIQ(2006.1,MAGPLC,.01,"E")
  1. S MAGJOB("PLC")=MAGPLC
  1. S MAGJOB("PLCODE")=$$GET1^DIQ(2006.1,MAGPLC,.09)
  1. S MAGRY(4)=MAGRY(4)_U_$$CONSOLID^MAGBAPI_U_$$GET1^DIQ(4,DUZ(2),99,"E")
  1. ; is CP not installed at this site, the Client will hide options
  1. ; related to CP.
  1. S X=$$VERSION^XPDUTL("CLINICAL PROCEDURES")
  1. S MAGRY(5)=+X_U_X
  1. S MAGRY(6)=$G(MAGWARN)
  1. S MAGRY(7)=$G(MAGWARN1)
  1. S MAGRY(8)=$S($L($T(PROD^XUPROD)):+$$PROD^XUPROD,1:0)
  1. S VSRV=$P($G(^MAG(2006.1,MAGPLC,"NET")),"^",5)
  1. I VSRV I +$P($G(^MAG(2005.2,VSRV,0)),"^",6) S PHYREF=$P($G(^MAG(2005.2,VSRV,0)),"^",2)
  1. ; Start Site Service URL (9) for TeleReader Client, otherwise PHYREF - P356 CD 06/21/2023
  1. S XUSAPP=$P($G(DUZ("REMAPP")),U,2)
  1. S:XUSAPP'="" ^TMP($J,"MAGTELER")=0
  1. S ISTELER=$S(XUSAPP="VISTA IMAGING TELEREADER":1,$G(^TMP($J,"MAGTELER")):1,1:0)
  1. S MAGRY(9)=$S(ISTELER:$$GET^XPAR("SYS","MAG TELER SSERV URL",1,"Q"),1:$G(PHYREF))
  1. K ^TMP($J,"MAGTELER") ; Kill TeleReader Boolean set in MAGGTU4 - P356 CD 06/21/2023
  1. ; End of Site Service URL (9) setting with custom TeleReader handling - P356 CD 06/21/2023
  1. S MAGRY(10)=$$KSP^XUPARAM("WHERE")
  1. S MAGRY(11)=$P($$SITE^VASITE(),"^")
  1. S MAGRY(12)=$P($$SITE^VASITE(),"^",3)
  1. S MAGRY(13)=$P($G(^MAG(2006.1,MAGPLC,"HELPD")),"^",1) ; p151
  1. S MAGRY(14)=$P($G(^MAG(2006.1,MAGPLC,"HELPC")),"^",1) ; p151
  1. Q
  1. ;
  1. CATEGORY(MAGRY) ; RPC [MAGGDESCCAT] Call to return Mag Descriptive Categories in array
  1. ; for listing in a list box.
  1. N I,K,CT,Y
  1. S I=0,CT=0
  1. I '$D(^MAG(2005.81)) D Q
  1. . S MAGRY(0)="0^ERROR Mag Descriptive Category File doesn't exist"
  1. F S I=$O(^MAG(2005.81,"B",I)) Q:I="" D
  1. . ;Next line adds ADMIN, CLIN 3rd piece of the data returned
  1. . S K=$O(^MAG(2005.81,"B",I,"")),CT=CT+1
  1. . S MAGRY(CT)=I_U_K_U_$P(^MAG(2005.81,K,0),U,2)
  1. S MAGRY(0)=CT_"^Categories on file"
  1. Q
  1. USERKEYS(MAGKEY) ; RPC [MAGGUSERKEYS]
  1. ; Call to return an array of IMAGING Security Keys
  1. D USERKEYS^MAGGTU31(.MAGKEY)
  1. Q
  1. MAIL(MAGRY,MAGFILE,MAGIEN) ;RPC [MAGG OFFLINE IMAGE ACCESSED]
  1. ; Called to log an Offline Image accessed.
  1. ; ^MAGQUEUE(2006.033,0) = OFFLINE IMAGES
  1. ; User must edit 2006.033 by hand to mark images as OFFLINE.
  1. ;
  1. N FILEREF,PLATTER,A
  1. S MAGRY="0^Error : logging access to Off-Line Image"
  1. N $ETRAP,$ESTACK S $ETRAP="D ERR^MAGGTERR"
  1. S FILEREF=$$UP^XLFSTR($P(MAGFILE,"\",$L(MAGFILE,"\")))
  1. S PLATTER=$O(^MAGQUEUE(2006.033,"B",FILEREF,""))
  1. S PLATTER=$P(^MAGQUEUE(2006.033,PLATTER,0),U,2)
  1. I MAGFILE[".ABS" Q
  1. N XMDUZ,XMSUB,XMTEXT,XMY
  1. S XMDUZ=$S($D(DUZ):DUZ,1:.5)
  1. S XMSUB="Offline Image Request"
  1. S XMTEXT="A("
  1. S A(1)="Patient : "_$P(^DPT($P($G(^MAG(2005,+MAGIEN,0)),U,7),0),U,1)
  1. S A(2)="FileName : "_MAGFILE_" "_MAGIEN
  1. S A(3)="Desc : "_$P($G(^MAG(2005,MAGIEN,2)),U,4)
  1. S A(4)="Procedure : "_$P($G(^MAG(2005,MAGIEN,0)),U,8)
  1. S A(5)="Platter : "_PLATTER
  1. S A(6)="User : "_$$GET1^DIQ(200,DUZ_",",.01)_"("_$G(DUZ)_")"
  1. S XMY("G.OFFLINE IMAGE TRACKERS")="" D ^XMD
  1. S MAGRY="1^Message sent : Offline Image Accessed"
  1. Q
  1. LOGERROR(MAGRY,TEXT) ;RPC [MAGG LOG ERROR TEXT]
  1. ; Call to stuff error information from Delphi app into the Session file.
  1. Q:($P($G(MAGJOB("VERSION")),".",1,2))<"3.0"
  1. D LOGERR^MAGGTERR("---- New Error ----")
  1. S I="" F S I=$O(TEXT(I)) Q:I="" D LOGERR^MAGGTERR(TEXT(I))
  1. S MAGRY="1^Error text saved to Session file"
  1. Q
  1. RSLVABS(MAGIEN,FILENAME) ;Resolve Abstract into the Default Bitmap
  1. ; Return the default bitmap, If the image file extension resolves into a default bitmap
  1. ; MAGIEN : Image internal entry number
  1. ; FILENAME : "" or Relative Path and Default Bitmap. ie ('.\BMP\magavi.bmp')
  1. N FTIEN,EXT ;
  1. S FILENAME=""
  1. I '$D(^MAG(2005.021)) Q ; IMAGE FILE TYPES doesn't exist on this system.
  1. S EXT=$P($P(^MAG(2005,MAGIEN,0),"^",2),".",2) ; image file extension JPG, TGA, etc.
  1. Q:EXT="" ;
  1. S FTIEN=$O(^MAG(2005.021,"B",EXT,""))
  1. Q:'FTIEN ; No extension in IMAGE FILE TYPES file.
  1. ; stop dependency on "c:\program files"
  1. I '+$P(^MAG(2005.021,FTIEN,0),"^",5) S FILENAME=".\BMP\"_$P(^MAG(2005.021,FTIEN,0),"^",4)
  1. ;out 151T6; I +$P(^MAG(2005.021,FTIEN,0),"^",5) S FILENAME=".\BMP\NOTEXIST.BMP"
  1. Q