source: FOIAVistA/tag/r/IMAGING-MAG-ZMAG/MAGGTU3.m@ 1540

Last change on this file since 1540 was 636, checked in by George Lilly, 15 years ago

WorldVistAEHR overlayed on FOIAVistA

File size: 9.5 KB
Line 
1MAGGTU3 ;WOIFO/GEK - Silent calls for Imaging ; [ 06/20/2001 08:57 ]
2 ;;3.0;IMAGING;**7,8,48,45,20,46**;16-February-2007;;Build 1023
3 ;; Per VHA Directive 2004-038, this routine should not be modified.
4 ;; +---------------------------------------------------------------+
5 ;; | Property of the US Government. |
6 ;; | No permission to copy or redistribute this software is given. |
7 ;; | Use of unreleased versions of this software requires the user |
8 ;; | to execute a written test agreement with the VistA Imaging |
9 ;; | Development Office of the Department of Veterans Affairs, |
10 ;; | telephone (301) 734-0100. |
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 Q
19IMAGEINF(MAGRY,IEN,NOCHK) ;RPC [MAGG IMAGE INFO] Call to return information for 1 image;
20 ; IEN = Image IEN ^MAG(2005,IEN
21 ; NOCHK = If Flag = 1, then do not run QA check on this image.
22 ;
23 N MAGFILE,Y,Z,MAGNOCHK
24 I '$D(^MAG(2005,IEN)) D Q
25 . I $D(^MAG(2005.1,IEN)) S MAGRY(0)="0^Image : """_$P($G(^MAG(2005.1,IEN,2)),U,4)_""" has been deleted." Q
26 . S MAGRY(0)="0^INVALID Image number "_IEN
27 . Q
28 ; MAGGTII queries the variable MAGNOCHK to run QA check or not.
29 S MAGNOCHK=+$G(NOCHK)
30 S MAGXX=IEN D INFO^MAGGTII ; this'll give us the MAGFILE variable
31 S Z=$P(^MAG(2005,IEN,0),U,7)
32 I '$D(^DPT(Z)) S Z="1^Invalid patient pointer"
33 E S Z=Z_U_$P(^DPT(Z,0),U)
34 S MAGRY(0)="1^"_MAGFILE
35 S MAGRY(1)=Z ; dfn^name
36 Q
37USERINF2(MAGRY,MAGWRKID) ;RPC [MAGGUSER2] Return user info.
38 ; MAGRY(1) = DUZ ^ FULL NAME ^ INITIALS
39 ; MAGRY(2) = Network UserName ^ PassWord.
40 ; MAGRY(3) = MUSE Site number. ( default = 1)
41 ; Node 4 is data from IMAGING SITE PARAMATERS File #2006.1 and INSTITUTION File #4
42 ; MAGRY(4)= PLACE IEN ^ SITE CODE ^ DUZ(2) ^ INSTITUTION NAME (.01) ^ $$CONSOLID ^ User's local STATION NUMBER (99)
43 ; MAGRY(5) = +<CP Version>|0 ^ Version of CP installed on Server
44 ; MAGRY(6) = Warning message if we can't resolve which Site Parameter entry to use.
45 ; MAGRY(7) = Warning message <reserved for future>
46 ; MAGRY(8) = 1|0 1 = Production account 0 = Test Account (or couldn't determine) ;Patch 41
47 ; MAGRY(9) = Vista Site Service PHYSICAL REFERENCE from Network Location File.
48 ; MAGRY(10)=Domain Name
49 ; MAGRY(11)=Primary Division IEN
50 ; MAGRY(12)=Primary Division STATION NUMBER
51 ;
52 N J,K,Y,MAGPLC,MAGWARN,MAGWARN1,VSRV,PHYREF ; DBI - SEB 9/20/2002
53 S MAGPLC=0
54 I $D(DUZ(2)) S MAGPLC=+$$PLACE^MAGBAPI(DUZ(2)) ; DBI - SEB 9/20/2002
55 ;
56 ; SET THE PARTITION VARIABLE MAGSYS i.e.'IGK_Garrett's Desk'
57 S MAGSYS=$G(MAGWRKID,"")
58 I +$G(DUZ)=0 S MAGRY(0)="0^DUZ Undefined, Null or Zero" Q
59 I 'MAGPLC D
60 . S MAGWARN="Can't resolve Site Param, DUZ(2): "_$S($D(DUZ(2)):DUZ(2),1:"NULL")_" DUZ: "_DUZ
61 . S MAGPLC=$$DUZ2PLC^MAGBAPIP(.MAGWARN1) ; DBI - SEB 9/20/2002
62 . Q
63 S MAGRY(0)="1^"
64 ; DUZ FULL NAME INITIALS
65 S MAGRY(1)=DUZ_U_$$GET1^DIQ(200,DUZ_",",.01)_U_$$GET1^DIQ(200,DUZ_",",1)
66 ; NOW NET STUFF
67 I 'MAGPLC Q
68 ; Get info from IMAGING SITE PARAMETERS File
69 ; get the Network UserName and PassWord.
70 S MAGRY(2)=$P($G(^MAG(2006.1,MAGPLC,"NET")),U,1,2)
71 ; get the default MUSE Site number.
72 S MAGRY(3)=+$P($G(^MAG(2006.1,MAGPLC,"USERPREF")),U,2)
73 ; default to 1 if nothing is entered in Site Parameters File
74 I MAGRY(3)=0 S MAGRY(3)=1
75 ; This SITEIEN^SITECODE^USER INSTITUTION IEN^INSTITUTION NAME^CONSOLIDATED^User's local STATION NUMBER
76 ; is used by Display to determine location of Workstation
77 ; and used by Capture to determine the Write Location.
78 S MAGRY(4)=MAGPLC_U_$$GET1^DIQ(2006.1,MAGPLC,.09)_U_$G(DUZ(2))_U_$$GET1^DIQ(2006.1,MAGPLC,.01,"E")
79 S MAGJOB("PLC")=MAGPLC
80 S MAGJOB("PLCODE")=$$GET1^DIQ(2006.1,MAGPLC,.09)
81 S MAGRY(4)=MAGRY(4)_U_$$CONSOLID^MAGBAPI_U_$$GET1^DIQ(4,DUZ(2),99,"E")
82 ; is CP installed at this site, the Front End will hide options
83 ; related to CP if not installed.
84 S X=$$VERSION^XPDUTL("CLINICAL PROCEDURES")
85 S MAGRY(5)=+X_U_X
86 S MAGRY(6)=$G(MAGWARN)
87 S MAGRY(7)=$G(MAGWARN1)
88 S MAGRY(8)=$S($L($T(PROD^XUPROD)):+$$PROD^XUPROD,1:0)
89 S VSRV=$P($G(^MAG(2006.1,MAGPLC,"NET")),"^",5)
90 I VSRV I +$P($G(^MAG(2005.2,VSRV,0)),"^",6) S PHYREF=$P($G(^MAG(2005.2,VSRV,0)),"^",2)
91 S MAGRY(9)=$G(PHYREF)
92 S MAGRY(10)=$$KSP^XUPARAM("WHERE")
93 S MAGRY(11)=$P($$SITE^VASITE(),"^")
94 S MAGRY(12)=$P($$SITE^VASITE(),"^",3)
95 Q
96 ;
97CATEGORY(MAGRY) ; RPC [MAGGDESCCAT] Call to return Mag Descriptive Categories in array
98 ; for listing in a list box.
99 N I,K,CT,Y
100 S I=0,CT=0
101 I '$D(^MAG(2005.81)) D Q
102 . S MAGRY(0)="0^ERROR Mag Descriptive Category File doesn't exist"
103 F S I=$O(^MAG(2005.81,"B",I)) Q:I="" D
104 . ;Next line adds ADMIN, CLIN 3rd piece of the data returned
105 . S K=$O(^MAG(2005.81,"B",I,"")),CT=CT+1
106 . S MAGRY(CT)=I_U_K_U_$P(^MAG(2005.81,K,0),U,2)
107 S MAGRY(0)=CT_"^Categories on file"
108 Q
109USERKEYS(MAGKEY) ; RPC [MAGGUSERKEYS]
110 ; Call to return an array of IMAGING Security Keys
111 D USERKEYS^MAGGTU31(.MAGKEY)
112 Q
113MAIL(MAGRY,MAGFILE,MAGIEN) ;RPC [MAGG OFFLINE IMAGE ACCESSED]
114 ; Called to log an Offline Image accessed.
115 ; ^MAGQUEUE(2006.033,0) = OFFLINE IMAGES
116 ; User must edit 2006.033 by hand to mark images as OFFLINE.
117 ;
118 N FILEREF,PLATTER,A
119 S MAGRY="0^Error : logging access to Off-Line Image"
120 N $ETRAP,$ESTACK S $ETRAP="D ERR^MAGGTERR"
121 S FILEREF=$$UP^XLFSTR($P(MAGFILE,"\",$L(MAGFILE,"\")))
122 S PLATTER=$O(^MAGQUEUE(2006.033,"B",FILEREF,""))
123 S PLATTER=$P(^MAGQUEUE(2006.033,PLATTER,0),U,2)
124 I MAGFILE[".ABS" Q
125 N XMDUZ,XMSUB,XMTEXT,XMY
126 S XMDUZ=$S($D(DUZ):DUZ,1:.5)
127 S XMSUB="Offline Image Request"
128 S XMTEXT="A("
129 S A(1)="Patient : "_$P(^DPT($P($G(^MAG(2005,+MAGIEN,0)),U,7),0),U,1)
130 S A(2)="FileName : "_MAGFILE_" "_MAGIEN
131 S A(3)="Desc : "_$P($G(^MAG(2005,MAGIEN,2)),U,4)
132 S A(4)="Procedure : "_$P($G(^MAG(2005,MAGIEN,0)),U,8)
133 S A(5)="Platter : "_PLATTER
134 S A(6)="User : "_$$GET1^DIQ(200,DUZ_",",.01)_"("_$G(DUZ)_")"
135 S XMY("G.OFFLINE IMAGE TRACKERS")="" D ^XMD
136 S MAGRY="1^Message sent : Offline Image Accessed"
137 Q
138LOGERROR(MAGRY,TEXT) ;RPC [MAGG LOG ERROR TEXT]
139 ; Call to stuff error information from Delphi app into the Session file.
140 Q:($P($G(MAGJOB("VERSION")),".",1,2))<"3.0"
141 D LOGERR^MAGGTERR("---- New Error ----")
142 S I="" F S I=$O(TEXT(I)) Q:I="" D LOGERR^MAGGTERR(TEXT(I))
143 S MAGRY="1^Error text saved to Session file"
144 Q
145RSLVABS(MAGIEN,FILENAME) ;Resolve Abstract into the Default Bitmap
146 ; Return the default bitmap, If the image file extension resolves into a default bitmap
147 ; MAGIEN : Image internal entry number
148 ; FILENAME : "" or Relative Path and Default Bitmap. ie ('.\BMP\magavi.bmp')
149 N FTIEN,EXT ;
150 S FILENAME=""
151 I '$D(^MAG(2005.021)) Q ; IMAGE FILE TYPES doesn't exist on this system.
152 S EXT=$P($P(^MAG(2005,MAGIEN,0),"^",2),".",2) ; image file extension JPG, TGA, etc.
153 Q:EXT="" ;
154 S FTIEN=$O(^MAG(2005.021,"B",EXT,""))
155 Q:'FTIEN ; No extension in IMAGE FILE TYPES file.
156 ; stop dependency on "c:\program files"
157 I '+$P(^MAG(2005.021,FTIEN,0),"^",5) S FILENAME=".\BMP\"_$P(^MAG(2005.021,FTIEN,0),"^",4)
158 Q
159GETINFO(MAGRY,IEN) ; RPC [MAG4 GET IMAGE INFO]
160 ; Call (3.0p8) to get information on 1 image
161 N Y,J,JI,I,CT,IENC,FLAGS,SNGRP,Z,M40,T,QACHK
162 S I=0,CT=0
163 S MAGRY(CT)="Image ID#: "_IEN
164 I $D(^MAG(2005.1,IEN)) D Q
165 . S CT=CT+1,MAGRY(CT)=" STATUS: "_"HAS BEEN DELETED. !!"
166 . S CT=CT+1,MAGRY(CT)="Deleted By: "_$$GET1^DIQ(2005.1,IEN,30,"E")
167 . S CT=CT+1,MAGRY(CT)=" Reason: "_$$GET1^DIQ(2005.1,IEN,30.2,"E")
168 . S CT=CT+1,MAGRY(CT)=" Date: "_$$GET1^DIQ(2005.1,IEN,30.1,"E")
169 . Q
170 S M40=$G(^MAG(2005,IEN,40)),T=$P(M40,"^",3)
171 S Z=$P($G(^MAG(2005,IEN,0)),"^",10) I Z D
172 . S CT=CT+1,MAGRY(CT)=" is in Group#: "_Z_" ("_+$P(^MAG(2005,Z,1,0),"^",4)_" images)"
173 . D CHK^MAGGSQI(.QACHK,Z) Q:QACHK(0)
174 . S CT=CT+1,MAGRY(CT)=" QA Warning - Group#: "_Z_" "_$P(QACHK(0),"^",2)
175 . Q
176 S SNGRP="FLDS"
177 I (+$O(^MAG(2005,IEN,1,0)))!($P(^MAG(2005,IEN,0),"^",6)=11)!($P(^MAG(2005,IEN,0),"^",6)=16) D
178 . S CT=CT+1,MAGRY(CT)=$P(^MAG(2005,IEN,0),"^",8)_" Group of "_+$P($G(^MAG(2005,IEN,1,0)),U,4)
179 . S SNGRP="FLDG"
180 . Q
181 K QACHK
182 D CHK^MAGGSQI(.QACHK,IEN) I 'QACHK(0) D
183 . S CT=CT+1,MAGRY(CT)=" QA Warning - Image#: "_IEN_" "_$P(QACHK(0),"^",2)
184 N MAGOUT,MAGERR,MAGVAL
185 S IENC=IEN_","
186 S FLAGS="EN"
187 S I=-1
188 F S I=I+1,Z=$T(@SNGRP+I) Q:$P(Z,";",3)="end" D
189 . S J=$P(Z,";",4),JI=J_";"
190 . K MAGOUT
191 . S CT=CT+1,MAGRY(CT)=$P(Z,";",3)
192 . I J=41 D Q ; Need to compute the Class. Class field in Image File is wrong.
193 . . S MAGVAL=$S('T:"",'$D(^MAG(2005.83,T,0)):"",1:$P(^MAG(2005.82,$P(^MAG(2005.83,T,0),"^",2),0),"^",1))
194 . . S MAGRY(CT)=MAGRY(CT)_" "_MAGVAL
195 . . Q
196 . D GETS^DIQ(2005,IEN,JI,FLAGS,"MAGOUT","MAGERR")
197 . ; Get Extension from FileRef
198 . I J=1 S MAGVAL=$P($G(MAGOUT(2005,IENC,J,"E")),".",2)
199 . E S MAGVAL=$G(MAGOUT(2005,IENC,J,"E"))
200 . S MAGRY(CT)=MAGRY(CT)_" "_MAGVAL
201 ; Compare Parent Association Date with Date/Time Note Signed.
202 I $P(^MAG(2005,IEN,0),"^",10) S IEN=$P(^MAG(2005,IEN,0),"^",10)
203 I $P(^MAG(2005,IEN,2),"^",6)=8925 S CT=CT+1,MAGRY(CT)=$$ATTSTAT^MAGGTU31(IEN)
204 Q
205 ;
206FLDS ;;Format: ;3;;
207 ;;Extension: ;1;;
208FLDG ;;Patient: ;5;;
209 ;;Desc: ;10;;
210 ;;Procedure: ;6;;
211 ;; Date: ;15;;
212 ;;Class: ;41;;
213 ;;Package: ;40;;
214 ;;Type: ;42;;
215 ;;Proc/Event: ;43;;
216 ;;Spec/SubSpec: ;44;;
217 ;;Origin: ;45;;
218 ;;Captured on: ;7;;
219 ;; by: ;8;;
220 ;;end;;
Note: See TracBrowser for help on using the repository browser.