source: WorldVistAEHR/trunk/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RADLQ2.m@ 619

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

initial load of WorldVistAEHR

File size: 3.6 KB
RevLine 
[613]1RADLQ2 ;HISC/GJC-Delq Status/Incomplete Rpt's ;3/6/97 08:50
2 ;;5.0;Radiology/Nuclear Medicine;**15**;Mar 16, 1998
3DATE ; Sort by date
4 S RADIV="" F S RADIV=$O(^TMP($J,"RADLQ",RADIV)) Q:RADIV']"" D Q:RAXIT
5 . S RA1=$P($G(^DIC(4,RADIV,0)),"^"),RAITYPE=""
6 . F S RAITYPE=$O(^TMP($J,"RADLQ",RADIV,RAITYPE)) Q:RAITYPE']"" D Q:RAXIT
7 .. S RA2=RAITYPE,RAVAR=""
8 .. F S RAVAR=$O(^TMP($J,"RADLQ",RADIV,RAITYPE,RAVAR)) Q:RAVAR']"" D Q:RAXIT
9 ... S RADTE=0
10 ... F S RADTE=$O(^TMP($J,"RADLQ",RADIV,RAITYPE,RAVAR,RADTE)) Q:RADTE'>0 D Q:RAXIT
11 .... S RANME=""
12 .... F S RANME=$O(^TMP($J,"RADLQ",RADIV,RAITYPE,RAVAR,RADTE,RANME)) Q:RANME']"" D Q:RAXIT
13 ..... S RACN=0
14 ..... F S RACN=$O(^TMP($J,"RADLQ",RADIV,RAITYPE,RAVAR,RADTE,RANME,RACN)) Q:RACN'>0 D Q:RAXIT
15 ...... S RANODE=$G(^TMP($J,"RADLQ",RADIV,RAITYPE,RAVAR,RADTE,RANME,RACN))
16 ...... D:RANODE]"" OUTPUT^RADLQ3
17 ...... Q
18 ..... Q
19 .... Q
20 ... Q
21 .. D:'RAXIT IMGCHK
22 .. Q
23 . D:'RAXIT DIVCHK
24 . Q
25 Q
26HDR ; Header for reports
27 I RAPG!($E(IOST,1,2)="C-") W @IOF
28 S RAPG=RAPG+1 W !?(IOM-$L(RAHD(0))\2),RAHD(0)
29 W !,"Division: ",$S($D(RAFLAG):"",1:RA1),?RATAB("HEAD"),"Page: ",RAPG
30 W !,"Imaging Type: ",$S($D(RAFLAG):"",1:RA2),?RATAB("HEAD"),"Date: "
31 W $$FMTE^XLFDT($$DT^XLFDT,1)
32 W !,RALN2
33 W !,"Patient Name",?RATAB(1),"Case #",?RATAB(2),"Pt ID"
34 W ?RATAB(3),"Date",?RATAB(4),"Ward/Clinic"
35 W ?RATAB(5),"Rpt Stat",!?RATAB(6),"Procedure"
36 W ?RATAB(7),"Exam Status",?RATAB(8),"Rpt Text"
37 W ?RATAB(9),"Interp. Phys.",?RATAB(10),"Tech",!,RALN2
38 I $D(ZTQUEUED) D STOPCHK^RAUTL9 S:$G(ZTSTOP)=1 RAXIT=1
39 Q
40PATIENT ; Sort by patient
41 S RADIV="" F S RADIV=$O(^TMP($J,"RADLQ",RADIV)) Q:RADIV']"" D Q:RAXIT
42 . S RA1=$P($G(^DIC(4,RADIV,0)),"^"),RAITYPE=""
43 . F S RAITYPE=$O(^TMP($J,"RADLQ",RADIV,RAITYPE)) Q:RAITYPE']"" D Q:RAXIT
44 .. S RA2=RAITYPE,RAVAR=""
45 .. F S RAVAR=$O(^TMP($J,"RADLQ",RADIV,RAITYPE,RAVAR)) Q:RAVAR']"" D Q:RAXIT
46 ... S RANME=""
47 ... F S RANME=$O(^TMP($J,"RADLQ",RADIV,RAITYPE,RAVAR,RANME)) Q:RANME']"" D Q:RAXIT
48 .... S RADTE=0
49 .... F S RADTE=$O(^TMP($J,"RADLQ",RADIV,RAITYPE,RAVAR,RANME,RADTE)) Q:RADTE'>0 D Q:RAXIT
50 ..... S RACN=0
51 ..... F S RACN=$O(^TMP($J,"RADLQ",RADIV,RAITYPE,RAVAR,RANME,RADTE,RACN)) Q:RACN'>0 D Q:RAXIT
52 ...... S RANODE=$G(^TMP($J,"RADLQ",RADIV,RAITYPE,RAVAR,RANME,RADTE,RACN))
53 ...... D:RANODE]"" OUTPUT^RADLQ3
54 ...... Q
55 ..... Q
56 .... Q
57 ... Q
58 .. D:'RAXIT IMGCHK
59 .. Q
60 . D:'RAXIT DIVCHK
61 . Q
62 Q
63PRINT ; Outputting the data
64 S RATAB(1)=$S(IOM=132:40,1:22),RATAB(2)=$S(IOM=132:54,1:32)
65 S RATAB(3)=$S(IOM=132:74,1:45),RATAB(4)=$S(IOM=132:90,1:55)
66 S RATAB(5)=$S(IOM=132:120,1:72),RATAB(6)=1 ; for 132 & 80 column
67 S RATAB(7)=$S(IOM=132:40,1:23),RATAB(8)=$S(IOM=132:75,1:36)
68 S RATAB(9)=$S(IOM=132:90,1:46),RATAB(10)=$S(IOM=132:114,1:63)
69 S RATAB("HEAD")=$S(IOM=132:102,1:62)
70 S RADIV=$O(^TMP($J,"RADLQ","")),RA2=$O(^TMP($J,"RADLQ",RADIV,""))
71 S RA1=$P($G(^DIC(4,RADIV,0)),"^") D HDR
72 D @$S(RASORT2="P":"PATIENT",1:"DATE")
73 Q
74DIVCHK ; Output statistics within division
75 N RA3 I $Y>(IOSL-4) S RAXIT=$$EOS^RAUTL5() D:'RAXIT HDR Q:RAXIT
76 W !!?RATAB(6),"Division Total '"_RA1_"': ",+$G(^TMP($J,"RADLQ",RADIV))
77 S RA3=+$O(^TMP($J,"RADLQ",RADIV))
78 I RA3 N RA1,RA4 S RA1=$P($G(^DIC(4,RA3,0)),"^") D
79 . S RA4=$O(^TMP($J,"RADLQ",RA3,"")) S:RA4]"" RA2=RA4
80 . S:$E(IOST,1,2)="C-" RAXIT=$$EOS^RAUTL5() D:'RAXIT HDR
81 . Q
82 Q
83IMGCHK ; Output statistics within Imaging Type
84 N RA5
85 I $Y>(IOSL-4) S RAXIT=$$EOS^RAUTL5() D:'RAXIT HDR Q:RAXIT
86 W !!?RATAB(6),"Imaging Type Total '"_RA2_"': "
87 W +$G(^TMP($J,"RADLQ",RADIV,RA2))
88 S RA5=$O(^TMP($J,"RADLQ",RADIV,RAITYPE))
89 I RA5]"" S RA2=RA5 D
90 . N RA1 S RA1=$P($G(^DIC(4,RADIV,0)),"^")
91 . S:$E(IOST,1,2)="C-" RAXIT=$$EOS^RAUTL5() D:'RAXIT HDR
92 . Q
93 Q
Note: See TracBrowser for help on using the repository browser.