source: WorldVistAEHR/trunk/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RAESR2.m@ 1578

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

initial load of WorldVistAEHR

File size: 3.6 KB
Line 
1RAESR2 ;HISC/GJC-Exam Statistics Rpt ;1/20/95 09:53
2 ;;5.0;Radiology/Nuclear Medicine;;Mar 16, 1998
3PURGE ; Kill variables, close device and exit
4 K %,%DT,%W,%Y1,A,B,BEGDATE,BEGDTX,ENDDATE,ENDDTX,I,RABEG,RACMP,RACNB
5 K RACNI,RACTE,RAD0,RADAT,RADFN,RADNB,RADNM,RADTE,RADTI,RADU,RAEND,RAFLG
6 K RAINM,RALINE,RALNM,RAP0,RAPGE,RAPOP,RAQUIT,RARD,RARPT,RARUNDT,RASTAT
7 K RATMEFRM,RATMP,RATOT,RAXIT,RAZ,T,T1,X,X1,Y,Z,ZTDESC,ZTRTN,ZTSAVE
8 K ^TMP($J,"RASTAT"),^TMP($J,"RA D-TYPE"),^TMP($J,"RA I-TYPE")
9 K:$D(RAPSTX) RACCESS,RAPSTX
10 D CLOSE^RAUTL
11 K POP,RAMES
12 Q
13DIVCHK ; Output stats by division
14 ; Print out totals for division 'RADNM'. Move on to next set of
15 ; division, imaging type, and location data.
16 Q:RAXIT N RA1,RA2,RA3,RASWTCH S RASWTCH=0
17 S RATOT=$G(^TMP($J,"RASTAT","RADIV",RADNM))
18 I $Y>(IOSL-4) D Q:RAXIT
19 . N RAINM,RALNM S (RAINM,RALNM)=""
20 . S RAXIT=$$EOS^RAUTL5() Q:RAXIT D HD^RAESR3
21 . Q
22 I 'RASWTCH D
23 . W !!!?5,"Division: ",RADNM,!
24 . Q
25 D TOT1^RAESR3
26 ; Now get the next division name. If null quit, if not get I-Type
27 ; and Location data to print generic header.
28 I RARPT=1 S RA1=$O(^TMP($J,"RASTAT","RALOC",RADNM))
29 I RARPT=2 S RA1=$O(^TMP($J,"RASTAT","RAIMG",RADNM))
30 I RARPT=3 S RA1=$O(^TMP($J,"RASTAT","RADIV",RADNM))
31 I RA1]"" D
32 . N RADNM,RAINM,RALNM S RADNM=RA1
33 . S:RARPT=1 RA2=$O(^TMP($J,"RASTAT","RALOC",RADNM,""))
34 . S:RARPT=2 RA2=$O(^TMP($J,"RASTAT","RAIMG",RADNM,""))
35 . I RA2]"" D
36 .. S RAINM=RA2
37 .. I RARPT=1 D
38 ... S RA3=$O(^TMP($J,"RASTAT","RALOC",RADNM,RAINM,"")),RALNM=$G(RA3)
39 ... Q
40 .. Q
41 . S RAXIT=$$EOS^RAUTL5() Q:RAXIT D HD^RAESR3
42 . Q
43 Q
44IMGCHK ; Output stats by imaging type.
45 ; Print out totals for I-Type 'RAINM'. Move on to next set of
46 ; imaging type and location data.
47 Q:RAXIT N RASWTCH S RASWTCH=0
48 S RATOT=$G(^TMP($J,"RASTAT","RAIMG",RADNM,RAINM))
49 I $Y>(IOSL-4) D Q:RAXIT
50 . N RALNM S RALNM="",RASWTCH=1
51 . S RAXIT=$$EOS^RAUTL5() Q:RAXIT D HD^RAESR3
52 . Q
53 I 'RASWTCH D
54 . W !!!?5,"Imaging Type: ",RAINM,!
55 . Q
56 D TOT1^RAESR3
57 ; Now get the next I-Type name. If null quit, if not get Location
58 ; data to print generic header.
59 N RA1,RA2
60 S:RARPT=1 RA1=$O(^TMP($J,"RASTAT","RALOC",RADNM,RAINM))
61 S:RARPT=2 RA1=$O(^TMP($J,"RASTAT","RAIMG",RADNM,RAINM))
62 I RA1]"" D
63 . N RAINM S RAINM=RA1
64 . I RARPT=1 D
65 .. S RA2=$O(^TMP($J,"RASTAT","RALOC",RADNM,RAINM,"")) S RALNM=RA2
66 .. Q
67 . S RAXIT=$$EOS^RAUTL5() Q:RAXIT D HD^RAESR3
68 . Q
69 Q
70LOCCHK ; Output stats by location.
71 ; Print out totals for location 'RALNM'. Move on to next set of
72 ; location data.
73 Q:RAXIT N RASWTCH S RASWTCH=0
74 S RATOT=$G(^TMP($J,"RASTAT","RALOC",RADNM,RAINM,RALNM))
75 I $Y>(IOSL-4) D Q:RAXIT
76 . S RASWTCH=1,RAXIT=$$EOS^RAUTL5() Q:RAXIT D HD^RAESR3
77 . Q
78 I 'RASWTCH D
79 . W !?13,"------",?20,"------",?29,"------",?35
80 . F T=1:1 Q:T>RACNB W ?($X+1),"------"
81 . Q
82 D TOT1^RAESR3
83 ; Now get the next location name. If null quit, if not print generic
84 ; header.
85 N RA1 S RA1=$O(^TMP($J,"RASTAT","RALOC",RADNM,RAINM,RALNM))
86 I RA1]"" N RALNM S RALNM=RA1 D
87 . S RAXIT=$$EOS^RAUTL5() Q:RAXIT D HD^RAESR3
88 . Q
89 Q
90DIVSYN ; Division synopsis
91 S RAXIT=$$EOS^RAUTL5() Q:RAXIT
92 S (RADNM,RAINM,RALNM)="" D HD^RAESR3
93 N A,B,C S A="",C=0
94 F S A=$O(^TMP($J,"RASTAT","RAIMG",A)) Q:A']"" D Q:RAXIT
95 . W !!,"Division: ",A,!?3,"Imaging Type(s): " S B="",C=C+1
96 . F S B=$O(^TMP($J,"RASTAT","RAIMG",A,B)) Q:B']"" D Q:RAXIT
97 .. I $Y>(IOSL-4) S RAXIT=$$EOS^RAUTL5() Q:RAXIT D HD^RAESR3
98 .. W:$X>(IOM-25) !?($X+$L("Imaging Type(s): ")+3) W B,?($X+3)
99 .. Q
100 . W ! S RATOT=$G(^TMP($J,"RASTAT","RADIV",A)) D TOT1^RAESR3
101 . Q
102 I C>1 D
103 . I $Y>(IOSL-4) S RAXIT=$$EOS^RAUTL5() Q:RAXIT D HD^RAESR3
104 . W !!?3,"Total Over All Divisions:",!
105 . S RATOT=$G(^TMP($J,"RASTAT","RATOT")) D TOT1^RAESR3
106 . Q
107 Q
Note: See TracBrowser for help on using the repository browser.