source: WorldVistAEHR/trunk/r/IMAGING-MAG-ZMAG/MAGQE5.m@ 1042

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

initial load of WorldVistAEHR

File size: 7.5 KB
Line 
1MAGQE5 ;WOIFO/RMP - Support for MAG Enterprise ; 08/29/2006 09:48
2 ;;3.0;IMAGING;**27,29,8,30,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 ;;
18ISU2 ;
19 ; Workstation Session and Patient counts
20 N CCNT,D0,DATE,ICNT,M1,M2,PCNT,RES,SCNAD,SCNMN,SCNT,TD,TD1,UNSCN,VD,VI,X1,X2,YR,AI,DUP,IQ,TIOP,TGPP,TIEDP
21 N GRPPRNT,IMAGE,DELETED
22 S (SCNT,PCNT,ICNT,CCNT,DUP,TIOP,TGPP,TIEDP,GRPPRNT,IMAGE,DELETED)=0
23 S (VD,VI)=""
24 I '$$CONSOLID() D
25 . S DATE="L"_START
26 . F S DATE=$O(^MAG(2006.82,"AC",DATE)) Q:DATE="" Q:$P(DATE,"L",2)\1>STOP D
27 . . S D0=0 F S D0=$O(^MAG(2006.82,"AC",DATE,D0)) Q:'D0 D
28 . . . Q:'$D(^MAG(2006.82,D0,1))
29 . . . S SCNT=SCNT+1
30 . . . S PCNT=PCNT+$P($G(^MAG(2006.82,D0,1)),"^",1)
31 . . . D ACT^MAGQE3(D0,.ICNT,.CCNT,.VD,.VI,.RES)
32 . . . Q
33 . . Q
34 . Q
35 E D
36 . S DATE=START
37 . F S DATE=$O(^MAG(2006.82,"APL",PLACE,DATE)) Q:DATE="" Q:DATE\1>STOP D
38 . . S D0=0 F S D0=$O(^MAG(2006.82,"APL",PLACE,DATE,D0)) Q:D0'?1.N D
39 . . . Q:'$D(^MAG(2006.82,D0,1))
40 . . . S SCNT=SCNT+1
41 . . . S PCNT=PCNT+$P($G(^MAG(2006.82,D0,1)),"^",1)
42 . . . D ACT^MAGQE3(D0,.ICNT,.CCNT,.VD,.VI,.RES)
43 . . . Q
44 . . Q
45 . Q
46 S X1=START,X2=STOP D ^%DTC S X=$TR(X,"-")+1_" day "
47 D MSG^MAGQE2(X_"Image Workstation Sessions: "_SCNT)
48 D MSG^MAGQE2(X_"Image Workstation Patients: "_PCNT)
49 D MSG^MAGQE2(X_"Image Workstation Images: "_ICNT)
50 D MSG^MAGQE2(X_"Image Workstation Captures: "_CCNT)
51 D MSG^MAGQE2(X_"VistaRad WS Display: "_VD)
52 D MSG^MAGQE2(X_"VistaRad WS Interpretations: "_VI)
53 K VD,VI
54 I $T(AVERAGE^MAGBRTLD)'="" D
55 . D MSG^MAGQE2(X_"average daily routed images: "_$$AVERAGE^MAGBRTLD())
56 . Q
57 D BPV^MAGQE1(PLACE)
58 D MSG^MAGQE2("Vista Image Version/Build: "_$$VSTAV^MAGQE1())
59 D DICOMV^MAGQE1()
60 D MSG^MAGQE2("Image file namespace(s): "_$$SNS^MAGQE1(PLACE))
61 S I="" F S I=$O(RES(I)) Q:I="" D
62 . S RES="" F S RES=$O(RES(I,RES)) Q:RES="" D
63 . . S X=$TR(I,"^")_"^"_RES S $P(X,"^",6)=RES(I,RES)
64 . . D MSG^MAGQE2(" RESOLUTION: "_X)
65 . . Q
66 . Q
67 K RES
68 ;
69 S AI=$$GETAI(PLACE)
70 D COUNT^MAGQE3(START,STOP,INST,AI,.IQ,.DUP,.TIOP,.TGPP,.TIEDP,.GRPPRNT,.IMAGE,.DELETED)
71 D MSG^MAGQE2("Total Image Objects for Place: "_TIOP)
72 D MSG^MAGQE2("Total Group Parents for Place: "_TGPP)
73 D MSG^MAGQE2("Total Image Entry Deletes for Place: "_TIEDP)
74 D MSG^MAGQE2("Image file group parents: "_GRPPRNT)
75 D MSG^MAGQE2("Image file objects: "_IMAGE)
76 D MSG^MAGQE2("Image file deletes: "_DELETED)
77 ;
78 S (I,D0)=0 F S D0=$O(^TMP($J,"MAGQ","ACQPAT",D0)) Q:D0="" S I=I+1
79 D MSG^MAGQE2("Unique Image patients captured: "_I)
80 K ^TMP($J,"MAGQ","ACQPAT")
81 S (I,D0)=0 F S D0=$O(^TMP($J,"MAGQ","DISPAT",D0)) Q:D0="" S I=I+1
82 D MSG^MAGQE2("Unique Image patients display: "_I)
83 K ^TMP($J,"MAGQ","DISPAT")
84 S (I,D0)=0 F S D0=$O(^TMP($J,"MAGQ","ALLPAT",D0)) Q:D0="" S I=I+1
85 D MSG^MAGQE2("Unique Image patients All: "_I)
86 K ^TMP($J,"MAGQ","ALLPAT")
87 D MSG^MAGQE2("Total Non-Verified Images for Place: "_$P(IQ,U,1))
88 D MSG^MAGQE2("Total Verified Images for Place: "_$P(IQ,U,2))
89 D MSG^MAGQE2("Total Integrity Issues for Place: "_$P(IQ,U,3))
90 D MSG^MAGQE2("Total Duplicate Images for Place: "_DUP)
91 D START^MAGQE6(START,STOP,INST,"TLR")
92 D ADCNT^MAGQE3(START,STOP,INST,AI)
93 D GPACHX^MAGQE3()
94 D GS1^MAGQE5() ;Get Share data
95 D AI1^MAGQE5() ;Get Associated Institutions
96 Q
97 ;
98AHOPT ;
99 N %DT,START,STOP
100 S STOP=$$FMADD^XLFDT($$NOW^XLFDT()\100_"01",-1)
101 S START=STOP\100_"01"
102 S Y=START D DD^%DT S %DT("B")=Y
103 S %DT="AEXP",%DT("A")="Enter starting Date: "
104 D ^%DT I ((X="")!(X="^")!($D(DTOUT))) K %DT(0),DTOUT Q
105 S START=Y
106 S Y=STOP D DD^%DT S %DT("B")=Y
107 S %DT="AEXP",%DT("A")="Enter ending Date: "
108 D ^%DT I ((X="")!(X="^")!($D(DTOUT))) K %DT(0),DTOUT Q
109 S STOP=Y
110 W !!,"Creating ad-hoc report over the period "
111 W $$DT(START)," until ",$$DT(STOP),".",!
112 D AHISU^MAGQE2(START,STOP)
113 Q
114 ;
115DT(X) ;
116 Q (X\1#100)_"-"_$P("Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec"," ",X\100#100)_"-"_(X\10000+1700)
117 ;
118LLOAD(AR,LBL) ;
119 N I
120 S I="" F S I=$O(AR(I)) Q:I="" D MSG^MAGQE2(" "_LBL_" "_I_"^"_AR(I))
121 Q
122 ;
123GETPLACE(PLACE) ; Validate place
124 S PLACE=$S($$CONSOLID():$G(PLACE),1:+$O(^MAG(2006.1," "),-1)) Q:'PLACE 0
125 S:$P($G(^MAG(2006.1,PLACE,0)),"^",1)="" PLACE=0
126 Q PLACE
127 ;
128CONSOLID() ;
129 ; Return value: 0 = site not consolidated,
130 ; 1 = site is consolidated
131 N FLDNFO
132 D FIELD^DID(2006.1,.01,"","SPECIFIER","FLDNFO")
133 I $G(FLDNFO("SPECIFIER"))["P" Q 1
134 Q 0
135 ;
136PLACE(INST) ;
137 Q:'$$CONSOLID() +$O(^MAG(2006.1," "),-1)
138 Q $$GETPLACE(+$O(^MAG(2006.1,"B",INST,"")))
139 ;
140QCNT(READY,PLACE) ;
141 N D0,FAILED,NEXT,TYPE
142 S (READY,FAILED)=0
143 I $$CONSOLID() D
144 . S TYPE="" F S TYPE=$O(^MAGQUEUE(2006.031,"C",PLACE,TYPE)) Q:TYPE="" D
145 . . S NEXT=+$O(^MAGQUEUE(2006.031,"C",PLACE,TYPE,""))
146 . . S NEXT=+$P($G(^MAGQUEUE(2006.031,NEXT,0)),"^",2)
147 . . S D0=0 F S D0=$O(^MAGQUEUE(2006.03,"C",PLACE,TYPE,D0)) Q:'D0 D
148 . . . I D0<NEXT S FAILED=FAILED+1
149 . . . E S READY=READY+1
150 . . . Q
151 . . Q
152 E D
153 . S TYPE="" F S TYPE=$O(^MAGQUEUE(2006.031,"B",TYPE)) Q:TYPE="" D
154 . . S NEXT=+$O(^MAGQUEUE(2006.031,"B",TYPE,""))
155 . . S NEXT=+$P($G(^MAGQUEUE(2006.031,NEXT,0)),"^",2)
156 . . S D0=0 F S D0=$O(^MAGQUEUE(2006.03,"B",TYPE,D0)) Q:'D0 D
157 . . . I D0<NEXT S FAILED=FAILED+1
158 . . . E S READY=READY+1
159 . . . Q
160 . . Q
161 . Q
162 Q READY+FAILED
163 ;
164WSP(PLACE) ; Imaging workstations per place
165 N COUNT,D0,RD
166 S RD=$$FMADD^XLFDT($$NOW^XLFDT,-180,"","","")
167 S (D0,COUNT)=0 F S D0=$O(^MAG(2006.81,"C",PLACE,D0)) Q:'D0 D
168 . S:$P(^MAG(2006.81,D0,0),"^",3)'<RD COUNT=COUNT+1
169 . Q
170 Q COUNT
171 ;
172MAGDUZ2() Q $G(DUZ(2),$$KSP^XUPARAM("INST"))
173 ;
174GS1() ; Get local Network location share data
175 N I,L,M,MSG,RESULT,TAR
176 S RESULT(0)="NETWORK LOCATION^PHYSICAL REFERENCE^TOTAL SPACE^SPACE USED^FREE SPACE^OPERATIONAL STATUS^STORAGE TYPE^HASH"
177 D LIST^DIC(2005.2,"","@;.01;1;2;3;4;5;6;7","","","","","","I $P(^(0),U,10)=PLACE","","TAR","MSG")
178 Q:$D(MSG("DIERR"))
179 S L=0 F S L=$O(TAR("DILIST","ID",L)) Q:'L D
180 . S RESULT(L)=$P(TAR("DILIST","ID",L,.01),U,1)
181 . F M=1,2,3,4,5,6,7 S RESULT(L)=RESULT(L)_U_$P(TAR("DILIST","ID",L,M),U,1)
182 . Q
183 S I="" F S I=$O(RESULT(I)) Q:I="" D
184 . D MSG^MAGQE2("LOCAL NETWORK LOCATIONS: "_I_"^"_RESULT(I))
185 . Q
186 K TAR,MSG,RESULT
187 Q
188AI1() ; get Associated Institutions list per place
189 N I,L,M,MSG,RESULT,TAR
190 S RESULT(0)="Associated Institutions"
191 D LIST^DIC(2006.12,","_PLACE_",","@;.01","","","","","","","","TAR","MSG")
192 Q:$D(MSG("DIERR"))
193 S L=0 F S L=$O(TAR("DILIST","ID",L)) Q:'L D
194 . S RESULT(L)=$P(TAR("DILIST","ID",L,.01),U,1)
195 . Q
196 S I="" F S I=$O(RESULT(I)) Q:I="" D
197 . D MSG^MAGQE2("ASSOCIATED INSTITUTIONS: "_I_"^"_RESULT(I))
198 . Q
199 K TAR,MSG,RESULT
200 Q
201GETAI(PLACE,PARAM) ;
202 N I,J
203 S PARAM=$S('$D(PARAM):U,PARAM="":U,1:PARAM)
204 S I="",J=PARAM
205 F S I=$O(^MAG(2006.1,PLACE,"INSTS","B",I)) Q:I="" S J=J_I_PARAM
206 Q J
207 ;
Note: See TracBrowser for help on using the repository browser.