source: WorldVistAEHR/trunk/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RAUTL16A.m@ 1407

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

initial load of WorldVistAEHR

File size: 3.5 KB
RevLine 
[613]1RAUTL16A ;HISC/DAD-EXAM STATUS IMAGING TYPE INCONSISTENCIES REPORT (FULL FILE SCAN) ;1/26/95 10:23
2 ;;5.0;Radiology/Nuclear Medicine;;Mar 16, 1998
3 ;
4 W !,"This report requires a 132 column output device."
5 K %ZIS,IOP S %ZIS="QM" W ! D ^%ZIS G:POP EXIT
6 I $D(IO("Q")) D G EXIT
7 . S ZTDESC="Rad/Nuc Med EXAM STATUS IMAGING TYPE INCONSISTENCIES REPORT"
8 . S ZTRTN="ENTSK^RAUTL16A" D ^%ZTLOAD
9 . Q
10ENTSK ;
11 K ^TMP("RAUTL16",$J)
12 S RAD0=0
13 F S RAD0=$O(^RADPT(RAD0)) Q:RAD0'>0 D
14 . S RADFN=$P($G(^RADPT(RAD0,0)),U) Q:RADFN'>0
15 . S RAD1=0
16 . F S RAD1=$O(^RADPT(RAD0,"DT",RAD1)) Q:RAD1'>0 D
17 .. S RA=$G(^RADPT(RAD0,"DT",RAD1,0))
18 .. S RAEXAMDT=$P(RA,U),RAIMTYPE=$P(RA,U,2)
19 .. I RAEXAMDT'>0!(RAIMTYPE'>0) D MISSING
20 .. S RAD2=0
21 .. F S RAD2=$O(^RADPT(RAD0,"DT",RAD1,"P",RAD2)) Q:RAD2'>0 D
22 ... S RA=$G(^RADPT(RAD0,"DT",RAD1,"P",RAD2,0))
23 ... S RACASENO=$P(RA,U),RAEXAMST=$P(RA,U,3)
24 ... I RACASENO'>0!(RAEXAMST'>0) D MISSING
25 ... S RAIMEXAM=$P($G(^RA(72,+RAEXAMST,0)),U,7)
26 ... I RAIMTYPE'=RAIMEXAM D SORT
27 ... Q
28 .. Q
29 . Q
30 ;
31 S RAEXIT=0,RAPAGE=1,RATODAY=$$FMTE^XLFDT($$DT^XLFDT)
32 K RAUNDL S $P(RAUNDL,"-",133)=""
33 U IO D HEADER
34 I $O(^TMP("RAUTL16",$J,""))="" D D PAUSE G EXIT
35 . W !!,"The imaging type of the visit matches the imaging type"
36 . W !,"of the exam status for all current incomplete exams."
37 . Q
38 S RADFN="",RAEXIT=0
39 F S RADFN=$O(^TMP("RAUTL16",$J,RADFN)) Q:RADFN=""!RAEXIT D
40 . S RASSN=""
41 . F S RASSN=$O(^TMP("RAUTL16",$J,RADFN,RASSN)) Q:RASSN=""!RAEXIT D
42 .. S RAEXAMDT=""
43 .. F S RAEXAMDT=$O(^TMP("RAUTL16",$J,RADFN,RASSN,RAEXAMDT)) Q:RAEXAMDT=""!RAEXIT D
44 ... S RACASENO=""
45 ... F S RACASENO=$O(^TMP("RAUTL16",$J,RADFN,RASSN,RAEXAMDT,RACASENO)) Q:RACASENO=""!RAEXIT D PRINT
46 ... Q
47 .. Q
48 . Q
49 I 'RAEXIT D PAUSE
50EXIT ;
51 S:$D(ZTQUEUED) ZTREQ="@" D ^%ZISC,KVA^VADPT
52 K %ZIS,DFN,DIR,DIROUT,DTOUT,DUOUT,POP,RA,RACASENO,RAD0,RAD1,RAD2,RADFN
53 K RAEXAMDT,RAEXAMST,RAEXIT,RAIMAGE,RAIMEXAM,RAIMTYPE,RAPAGE,RASSN
54 K RATODAY,RAUNDL,X,Y,ZTDESC,ZTRTN,^TMP("RAUTL16",$J)
55 Q
56MISSING ;
57 S:$G(RAEXAMDT)'>0 RAEXAMDT="Missing"
58 S:$G(RAIMTYPE)'>0 RAIMTYPE="Missing"
59 S:$G(RACASENO)'>0 RACASENO="Missing"
60 S:$G(RAEXAMST)'>0 RAEXAMST="Missing"
61 S RAIMEXAM=$P($G(^RA(72,+RAEXAMST,0)),U,7)
62SORT ;
63 D KVA^VADPT S DFN=RADFN D DEM^VADPT
64 S RADFN(0)=$G(VADM(1)),RA=$G(VADM(2)),RASSN=$P(RA,U),RASSN(0)=$P(RA,U,2)
65 S RAEXAMDT(0)=$$FMTE^XLFDT(RAEXAMDT)
66 S RAIMTYPE(0)=$P($G(^RA(79.2,+RAIMTYPE,0)),U) I RAIMTYPE(0)="" S RAIMTYPE(0)="Missing"
67 S RAEXAMST(0)=$P($G(^RA(72,+RAEXAMST,0)),U) I RAEXAMST(0)="" S RAEXAMST(0)="Missing"
68 S RAIMEXAM(0)=$P($G(^RA(79.2,+RAIMEXAM,0)),U) I RAIMEXAM(0)="" S RAIMEXAM(0)="Missing"
69 S ^TMP("RAUTL16",$J,RADFN(0),RASSN,RAEXAMDT,RACASENO)=RADFN(0)_U_RASSN(0)_U_RAEXAMDT(0)_U_RAIMTYPE(0)_U_RACASENO_U_RAEXAMST(0)_U_RAIMEXAM(0)_U_+$G(RAD0)_U_+$G(RAD1)_U_+$G(RAD2)
70 Q
71PRINT ;
72 S RA=^TMP("RAUTL16",$J,RADFN,RASSN,RAEXAMDT,RACASENO)
73 S RADFN(0)=$P(RA,U),RASSN(0)=$P(RA,U,2),RAEXAMDT(0)=$P(RA,U,3)
74 S RAIMTYPE(0)=$P(RA,U,4),RACASENO(0)=$P(RA,U,5)
75 S RAEXAMST(0)=$P(RA,U,6),RAIMEXAM(0)=$P(RA,U,7)
76 S RAD0=$P(RA,U,8),RAD1=$P(RA,U,9),RAD2=$P(RA,U,10)
77 W !!,RADFN(0),?34,RASSN(0)
78 W !?3,RAEXAMDT(0),?25,$J(RACASENO(0),5),?34,RAIMTYPE(0)
79 W ?68,RAEXAMST(0),?102,RAIMEXAM(0)
80 I $Y>(IOSL-6) D PAUSE,HEADER
81 Q
82PAUSE ;
83 I $E(IOST)="C" K DIR S DIR(0)="E" D ^DIR K DIR S RAEXIT=$S(Y'>0:1,1:0)
84 Q
85HEADER ;
86 Q:RAEXIT
87 W:$E(IOST)="C"!(RAPAGE>1) @IOF
88 W !?46,"EXAM STATUS IMAGING TYPE INCONSISTENCIES"
89 W ?102,"PAGE: ",RAPAGE,!?102,RATODAY S RAPAGE=RAPAGE+1
90 W !,"PATIENT",?34,"SSN"
91 W !?3,"EXAM DATE/TIME",?25,"CASE#",?34,"IMAGING TYPE OF VISIT"
92 W ?68,"EXAM STATUS",?102,"IMAGING TYPE OF EXAM STATUS",!,RAUNDL
93 Q
Note: See TracBrowser for help on using the repository browser.