source: WorldVistAEHR/trunk/r/IMAGING-MAG-ZMAG/MAGQE1.m@ 1450

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

initial load of WorldVistAEHR

File size: 3.2 KB
Line 
1MAGQE1 ;WOIFO/RMP - Support for MAG Enterprise ; 02/18/2005 09:19
2 ;;3.0;IMAGING;**27,29,30,20**;Apr 12, 2006
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 Q
19 ;
20SDATE(FDAY,ORDER) ; Find first image before/after specified date
21 ; EdM: In a future patch, this function must be replaced by a cross-reference.
22 N I1,I2
23 I $G(ORDER)'="R" Q 0
24 S I1=$O(^MAG(2005," "),-1)+1 S I2=$O(^MAG(2005.1," "),-1)+1
25 Q $S(I1>I2:I1,1:I2)
26 ;
27BPV(PLACE) ;
28 N BPWS,D0,NODE,INDEX,WS
29 K BPWS
30 S WS="" F S WS=$O(^MAG(2006.8,"C",PLACE,WS)) Q:WS="" D
31 . S D0=$O(^MAG(2006.8,"C",PLACE,WS,""))
32 . Q:$P($G(^MAG(2006.8,D0,0)),"^",12)'="1"
33 . S NODE=$G(^MAG(2006.8,D0,1))
34 . D:$P(NODE,"^",2)>0
35 . . S INDEX=$P(NODE,"^",2)_"^"_$P(NODE,"^",4)
36 . . S BPWS(INDEX)=$G(BPWS(INDEX))+1
37 . . S $P(BPWS(INDEX),"^",2)=$P(NODE,"^",3)
38 . . Q
39 . Q
40 D:$D(BPWS) LLOAD^MAGQE5(.BPWS,"BP VERS NUM DATE: ")
41 Q
42 ;
43IWSV(PLACE) ; Image workstation versions
44 N D0,IDX,OS,RD,WSC,WSD,WSV,X
45 S RD=$$FMADD^XLFDT($$NOW^XLFDT,-180,"","","")
46 S D0=0 F S D0=$O(^MAG(2006.81,"C",PLACE,D0)) Q:'D0 D
47 . S X=^MAG(2006.81,D0,0) Q:$P(X,"^",3)<RD
48 . S OS=$P($G(^MAG(2006.81,D0,1)),"^",2)
49 . S:OS?.N OS=$P($G(^MAG(2006.81,D0,1)),"^",3)
50 . S IDX=$P(X,"^",9) D:IDX'="" ; Display Station
51 . . S:OS'="" IDX=IDX_"^"_OS S WSD(IDX)=$G(WSD(IDX))+1
52 . . Q
53 . S IDX=$P(X,"^",13) D:IDX'="" ; Capture Station
54 . . S:OS'="" IDX=IDX_"^"_OS S WSC(IDX)=$G(WSC(IDX))+1
55 . . Q
56 . S IDX=$P(X,"^",15) D:IDX'="" ; VistARad Station
57 . . S:OS'="" IDX=IDX_"^"_OS S WSV(IDX)=$G(WSV(IDX))+1
58 . . Q
59 . Q
60 D LLOAD^MAGQE5(.WSD," WS DIS VERS: ")
61 D LLOAD^MAGQE5(.WSC," WS CAP VERS: ")
62 D LLOAD^MAGQE5(.WSV," WS VR VERS: ")
63 Q
64 ;
65DICOMV() ; Version of DICOM
66 N D0,DCMG,RD,T,VER,X
67 S RD=$$FMADD^XLFDT($$NOW^XLFDT,-30,"","","")
68 S X="" F S X=$O(^MAG(2006.83,"B",X)) Q:X="" D
69 . S D0=$O(^MAG(2006.83,"B",X,"")) Q:'D0
70 . S T=$G(^MAG(2006.83,D0,0)) Q:$P(T,"^",2)<RD
71 . S VER=$P(T,"^",3) S:VER="" VER="?"
72 . S DCMG(VER)=$G(DCMG(VER))+1
73 . Q
74 D:$D(DCMG) LLOAD^MAGQE5(.DCMG,"DICOM Gateway Version: ")
75 Q
76 ;
77VSTAV() ;
78 N VER
79 S VER=$$VERSION^XPDUTL("IMAGING")
80 S:$T(LAST^XPDUTL)'="" VER=VER_"^"_$$LAST^XPDUTL("IMAGING",VER)
81 Q VER
82 ;
83SNS(PLACE) ;
84 N D1,RESULT
85 S RESULT=$P(^MAG(2006.1,PLACE,0),"^",2)
86 S D1=0 F S D1=$O(^MAG(2006.1,PLACE,4,D1)) Q:'D1 D
87 . S RESULT=RESULT_"^"_$P($G(^MAG(2006.1,PLACE,4,D1,0)),"^",1)
88 . Q
89 Q RESULT
90 ;
Note: See TracBrowser for help on using the repository browser.