source: FOIAVistA/trunk/r/UTILIZATION_MGMT_ROLLUP_LOCAL-IBQ/IBQLR2.m@ 1540

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

initial load of FOIAVistA 6/30/08 version

File size: 3.6 KB
Line 
1IBQLR2 ;LEB/MRY - PATIENT REPORT ; 17-MAY-95
2 ;;1.0;UTILIZATION MGMT ROLLUP LOCAL;**2**;Oct 01, 1995
3 ;;Per VHA Directive 10-93-142, this routine should not be modified.
4 ;
5 I '$D(DT) D DT^DICRW
6DATE W ! D DATE^IBOUTL
7 I IBBDT=""!(IBEDT="") G END
8 S X1=IBEDT,X2=IBBDT D ^%DTC I X>365 W !,"<<< please report 1 years of information only. >>>" G DATE
9 S DIR(0)="SA^S:Services;T:Treating Specialties;P:Providers",DIR("A")="Display Services,Treating Specialties, or Providers? [S/T/P]: "
10 W ! D ^DIR G:$D(DUOUT)!($D(DTOUT)) END K DIR
11 S IBTY=Y G:IBTY="P" PHY^IBQLR3
12 I IBTY="S" S DIR(0)="SA^A:All Services;I:Individual Services",DIR("A")="Display ALL or INDIVIDUAL Services? [A/I]: "
13 I IBTY="T" S DIR(0)="SA^A:All Treating Specialties;I:Individual Treating Specialties",DIR("A")="Display ALL or INDIVIDUAL Treating Specialties? [A/I]: "
14 D ^DIR G:$D(DUOUT)!($D(DTOUT)) END K DIR
15 S IBTY1=Y G:IBTY1="A" DEV
16 I IBTY="T" G TSI
17SVCI S DIR(0)="42.4,3O",DIR("A")="Enter SERVICE"
18 D ^DIR G:$D(DUOUT)!($D(DTOUT)) END K DIR I X="" G:$O(IBSVC(""))="" SVCI G DEV
19 S IBSVC(Y)=Y(0) G SVCI
20TSI S DIR(0)="PO^45.7:AEQZ",DIR("A")="Enter TREATING SPECIALTY"
21 D ^DIR G:$D(DUOUT)!($D(DTOUT)) END K DIR I X="" G:$O(IBTS(""))="" TSI G DEV
22 S IBTS(Y(0,0))="" G TSI
23DEV ; -- select device, run option
24 W ! S %ZIS="QM" D ^%ZIS G:POP END
25 I $D(IO("Q")) F I="IBTY","IBBDT","IBEDT","IBTS(","IBSVC(","IBTY1" S ZTSAVE(I)=""
26 I $D(IO("Q")) S ZTRTN="START^IBQLR2",ZTDESC="UM - ACUTE REPORT" D ^%ZTLOAD K IO("Q"),ZTSK D HOME^%ZIS G END
27 U IO
28 ;
29START ;
30 K ^TMP("IBQLR2",$J) S IBDDT=IBBDT-.01,(IBPAG,IBQUIT,IBLVH)=0
31 F S IBDDT=$O(^IBQ(538,"ADIS",IBDDT)) Q:'IBDDT!(IBDDT>IBEDT) D
32 .S IBTRN="" F S IBTRN=$O(^IBQ(538,"ADIS",IBDDT,IBTRN)) Q:'IBTRN D DATA
33 ;
34 I $$STOP,$G(ZTSTOP) G END
35 D PRINT^IBQLR2A
36END ; -- Clean up
37 W ! K ^TMP("IBQLR2",$J),IB,IBDDT,IBBDT,IBEDT,IBTRN,IBTRND,IBTS,IBTY,IBTEXT,IBDATA,IBHDR,IBQUIT,IBPAG,IBREA,IBLV,IBLVH,I,N,X,IBSVC
38 I $D(ZTQUEUED) S ZTREQ="@" Q
39 D ^%ZISC
40 Q
41 ;
42DATA ;
43ADMIT ; -- get Admission Review info.
44 S IBLV=0 D ADMIT^IBQL538
45 S IBSVC=IB(1.07),IBTS=IB(.12) S:IBTY="S" IBTS=999 S:IBSVC="" IBSVC="UNK"
46 I IBTY1="I" G:IBTY="S"&('$D(IBSVC(IBSVC))) STAY G:IBTY="T"&('$D(IBTS(IBTS))) STAY
47 S IBDATA=IB(.09)_"^"_IB(.04)_"^"_IB(.05)_"^"_IB(.06)_"^"_IB(.07)_"^"_IB(.08)_"^"_IB("ACUTE ADMISSION")_"^"_$S('IB("ACUTE ADMISSION"):1,1:"")_"^"_IB(1.03)
48 S ^TMP("IBQLR2",$J,IBSVC,IBTS,IB(.1),IB(.03))=IBDATA
49 S ^("LOS")=$G(^TMP("IBQLR2",$J,IBSVC,IBTS,IB(.1),IB(.03),"LOS"))+1
50 I IB("ACUTE ADMISSION") S ^("S-AC")=$G(^TMP("IBQLR2",$J,IBSVC,IBTS,IB(.1),IB(.03),"S-AC"))+1
51 E S ^("S-NAC")=$G(^TMP("IBQLR2",$J,IBSVC,IBTS,IB(.1),IB(.03),"S-NAC"))+1
52STAY ; -- get Stay Review info.
53 S IBTRV=0 F S IBTRV=$O(^IBQ(538,IBTRN,13,IBTRV)) Q:'IBTRV D
54 .D STAY^IBQL538
55 .S IBSVC=IB(13.08),IBTS=IB(13.07) S:IBTY="S" IBTS=999 S:IBSVC="" IBSVC="UNK"
56 .I IBTY1="I" Q:IBTY="S"&('$D(IBSVC(IBSVC))) Q:IBTY="T"&('$D(IBTS(IBTS)))
57 .I '$G(^TMP("IBQLR2",$J,IBSVC,IBTS,IB(.1),IB(.03))) D
58 ..S IBDATA=IB(.09)_"^"_IB(.04)_"^"_IB(.05)_"^"_IB(.06)_"^"_IB(.07)_"^"_IB(.08)_"^"_"^"_"^"
59 ..S ^TMP("IBQLR2",$J,IBSVC,IBTS,IB(.1),IB(.03))=IBDATA
60 .F I=1:1:3 S REA=$P(IB(13.06)," ",I) Q:'REA D
61 ..I '$G(^TMP("IBQLR2",$J,IBSVC,IBTS,IB(.1),IB(.03),+REA)) S IBLV=IBLV+1
62 ..S ^(+REA)=$G(^TMP("IBQLR2",$J,IBSVC,IBTS,IB(.1),IB(.03),+REA))+1
63 .S ^("LOS")=$G(^TMP("IBQLR2",$J,IBSVC,IBTS,IB(.1),IB(.03),"LOS"))+1
64 .I IB("ACUTE STAY") S ^("S-AC")=$G(^TMP("IBQLR2",$J,IBSVC,IBTS,IB(.1),IB(.03),"S-AC"))+1
65 .E S ^("S-NAC")=$G(^TMP("IBQLR2",$J,IBSVC,IBTS,IB(.1),IB(.03),"S-NAC"))+1
66 .I IBLV>IBLVH S IBLVH=IBLV
67 Q
68 ;
69STOP() ; determine if user has requested the queued report to stop
70 I $D(ZTQUEUED),$$S^%ZTLOAD S ZTSTOP=1 K ZTREQ I +$G(IBPAG) W !,"***TASK STOPPED BY USER***"
71 Q +$G(ZTSTOP)
Note: See TracBrowser for help on using the repository browser.