source: WorldVistAEHR/trunk/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RAUTL16.m@ 1800

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

initial load of WorldVistAEHR

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