source: FOIAVistA/trunk/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RANMUSE3.m@ 794

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

initial load of FOIAVistA 6/30/08 version

File size: 3.3 KB
Line 
1RANMUSE3 ;HISC/SWM-Nuclear Medicine Usage reports ;10/20/97 11:09
2 ;;5.0;Radiology/Nuclear Medicine;;Mar 16, 1998
3PGHD ; Page Header
4 I RAPG!($E(IOST,1,2)="C-") W:$Y>0 @IOF
5 S RAPG=RAPG+1
6 W !?35,">>> "_RATITLE_" Report <<<",?90,"Run Date: ",RATDY
7 W ?121,"Page: ",RAPG
8 W !?50,$S($G(RAHDTYP)="D":"(Division",$G(RAHDTYP)="I":"(Imaging",1:"") W:$G(RAHDTYP)]"" " Summary)"
9 W ?85,"For: ",RADTBEG("X")," - ",RADTEND("X")
10 W !,"Division: ",RANUMD(RASEQD) W:$G(RAHDTYP)'="D" ?45,"Imaging Type: ",RANUMI(RASEQI)
11 Q
12COLHD ; Column Header for detailed report
13 W !!,"Long-Case@Time",?16,"Patient Name",?35,"SSN",?44,"Radiopharm",?59,"Act.Drawn",?69,"Dose Adm'd",?83,"Low",?93,"High",?100,"Procedure",?116,"Who Adm'd"
14 W !,RALN
15 Q
16COLHDS ; Column Header for summary report
17 W !!,$S(RATITLE["Usage":"Radiopharm",1:"Who Admin Dose"),?35,"Total Drawn",?50,"Total Adm'd",?64,"No. cases",?79,"(%)",?90,"No. outside range"
18 W !,RALN
19 Q
20SUM S RAXIT=$$EOS^RAUTL5 Q:RAXIT
21 S RA0=0
22SM0 S RA0=$O(^TMP($J,"RATUNIQ",RA0)) Q:'RA0 S RA1=0
23SM2 S RA1=$O(^TMP($J,"RATUNIQ",RA0,RA1)) I RA1'=+RA1 D DIVSUM Q:RAXIT G SM0
24 ; if RA1 is alpha, then node is for division summary
25 ; if RA1 is numeric, then node is for imaging summary
26 S RASEQD=RA0,RASEQI=RA1
27 S RAHDTYP="I" D PGHD,COLHDS
28SM3 S RA2=$O(^TMP($J,"RATUNIQ",RA0,RA1,RA2)) I RA2="" D FOOTIMG S RAXIT=$$EOS^RAUTL5 Q:RAXIT G SM2
29 W !,$E(RA2,1,30)
30 W ?30,$J($G(^TMP($J,"RATDRAWN",RA0,RA1,RA2)),15,4)
31 W ?45,$J($G(^TMP($J,"RATDOSE",RA0,RA1,RA2)),15,4)
32 W ?64,$J($G(^TMP($J,"RATUNIQ",RA0,RA1,RA2)),7)
33 W ?78,$J(100*$S(+$G(^TMP($J,"RATUNIQ",RA0,RA1))=0:0,1:$G(^TMP($J,"RATUNIQ",RA0,RA1,RA2))/^TMP($J,"RATUNIQ",RA0,RA1)),5,2)
34 W ?90,$J($G(^TMP($J,"RATOUTSD",RA0,RA1,RA2)),7)
35 I ($Y+4)>IOSL!(RAPG=0) S RAXIT=$$EOS^RAUTL5 Q:RAXIT D PGHD,COLHDS
36 G SM3
37DIVSUM ;
38 ; skip div summary page if div has only 1 img typ
39 Q:$O(^TMP($J,"RATUNIQ",RA0,0))=$O(^TMP($J,"RATUNIQ",RA0,"A"),-1)
40 S RAHDTYP="D",RA2="A"
41 D PGHD,COLHDS
42DV1 S RA2=$O(^TMP($J,"RATUNIQ",RA0,RA2))
43 I RA2="" D FOOTDIV S RAXIT=$$EOS^RAUTL5 Q
44 W !,$E(RA2,1,30)
45 W ?30,$J($G(^TMP($J,"RATDRAWN",RA0,RA2)),15,4)
46 W ?45,$J($G(^TMP($J,"RATDOSE",RA0,RA2)),15,4)
47 W ?64,$J($G(^TMP($J,"RATUNIQ",RA0,RA2)),7)
48 W ?78,$J(100*$S(+$G(^TMP($J,"RATUNIQ",RA0))=0:0,1:$G(^TMP($J,"RATUNIQ",RA0,RA2))/^TMP($J,"RATUNIQ",RA0)),5,2)
49 W ?90,$J($G(^TMP($J,"RATOUTSD",RA0,RA2)),7)
50 I ($Y+4)>IOSL!(RAPG=0) S RAXIT=$$EOS^RAUTL5 Q:RAXIT D PGHD,COLHDS
51 G DV1
52FOOTDIV ; footnotes division
53 W !!,RANUMD(RASEQD),"'s Total number of unique cases: ",^TMP($J,"RATUNIQ",RA0)
54 D FOOT Q
55FOOTIMG ; footnotes img type
56 W !!,RANUMI(RASEQI),"'s Total number of unique cases: ",^TMP($J,"RATUNIQ",RA0,RA1)
57 D FOOT Q
58FOOT W !!,"Notes: A case may have more than 1 radiopharm, so total no. unique cases may be less than total no. radiopharms listed."
59 W !," * denotes administered dosage outside of normal range."
60 Q:RAINPUT
61 W !!,$S(RATITLE["Usage":"Radiopharm",1:"Dose administerers")," selected for this report :" W !?6
62 S RA2=0 F S RA2=$O(^TMP($J,"RA EITHER",RA2)) Q:RA2="" W:$X+$L(RA2)>(IOM+2) !?6 W RA2 W:$O(^(RA2))]"" ", "
63 Q
64ZERO ; zero out total for imaging type(s) that has no data
65 S RA0=""
66Z1 S RA0=$O(^TMP($J,"RA D-TYPE",RA0)) Q:RA0']"" S RA1=""
67Z2 S RA1=$O(RACCESS(DUZ,"DIV-IMG",RA0,RA1)) G:RA1']"" Z1
68 G:'$D(^TMP($J,"RA I-TYPE",RA1)) Z2
69 S:'$D(^TMP($J,"RATUNIQ",RASEQD(RA0),RASEQI(RA1))) ^TMP($J,"RATUNIQ",RASEQD(RA0),RASEQI(RA1))=0
70 G Z2
Note: See TracBrowser for help on using the repository browser.