source: FOIAVistA/trunk/r/UTILIZATION_MGMT_ROLLUP_LOCAL-IBQ/IBQLR2A.m@ 711

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

initial load of FOIAVistA 6/30/08 version

File size: 3.3 KB
Line 
1IBQLR2A ;LEB/MRY - PATIENT REPORT ; 1-JUN-95
2 ;;1.0;UTILIZATION MGMT ROLLUP LOCAL;;Oct 01, 1995
3 ;;Per VHA Directive 10-93-142, this routine should not be modified.
4 ;
5PRINT D SVCTAB^IBQLR1B S (IBDATA,IBTS,IBQUIT,IBHDR,IBHDR1,IBSVC)="",IBPAG=0
6 ; -- call to return header dates - IBTDT, IBDRNG
7 D DTC^IBQLPL2
8 S IBHDR="UTILIZATION MANAGEMENT",IBHDR2="PATIENT REVIEWS FOR "_IBDRNG S:IBTY="S" IBHDR1="SERVICE" S:IBTY="T" IBHDR1="TREATING SPECIALTY,(SERVICE)"
9 ;
10 I '$D(^TMP("IBQLR2",$J)) D HDR W !!,?20,"<<< NO PATIENTS TO PRINT >>>" Q
11 F S IBSVC=$O(^TMP("IBQLR2",$J,IBSVC)) Q:IBSVC="" D TS Q:IBQUIT
12 G END
13TS F S IBTS=$O(^TMP("IBQLR2",$J,IBSVC,IBTS)) Q:IBTS="" D Q:IBQUIT
14 .I IBTS=999 S IBSUBH=$S($D(IBSVC(IBSVC)):IBSVC(IBSVC),1:IBSVC("UNK"))
15 .E S IBSUBH=IBTS_",("_$S($D(IBSVC(IBSVC)):IBSVC(IBSVC),1:IBSVC("UNK"))_")"
16 .D PLINE
17 .S IBDDT="" F S IBDDT=$O(^TMP("IBQLR2",$J,IBSVC,IBTS,IBDDT)) Q:'IBDDT D Q:IBQUIT
18 ..S IBSSN="" F S IBSSN=$O(^TMP("IBQLR2",$J,IBSVC,IBTS,IBDDT,IBSSN)) Q:'IBSSN D DATA Q:IBQUIT
19 Q
20 ;
21END K IBDATA,IBTS,IBADM,IBADIAG,IBENRLL,IBPHYAD,IBPHYAT,IBPHYRS,IBAAD,IBRAD,IBLOS,IBRSYCNT,IBHDR,IBHDR1,IBDRNG,IBDT,IBRSY,IBSSN,IBTDT,IBTRND1,IBTRV,IBTRVD
22 Q
23 ;
24DATA ;
25 S IBDATA=^TMP("IBQLR2",$J,IBSVC,IBTS,IBDDT,IBSSN)
26 S IBADM=$P(IBDATA,"^"),IBADIAG=$P(IBDATA,"^",2),IBENRLL=$P(IBDATA,"^",3)
27 S IBPHYAD=$P(IBDATA,"^",4),IBPHYAT=$P(IBDATA,"^",5),IBPHYRS=$P(IBDATA,"^",6)
28 S IBAAD=$P(IBDATA,"^",7),IBNAD=$P(IBDATA,"^",8),IBRAD=$P(IBDATA,"^",9)
29 S IBLOS=$G(^TMP("IBQLR2",$J,IBSVC,IBTS,IBDDT,IBSSN,"LOS"))
30 S IBSACNT=$G(^TMP("IBQLR2",$J,IBSVC,IBTS,IBDDT,IBSSN,"S-AC"))
31 S IBSNCNT=$G(^TMP("IBQLR2",$J,IBSVC,IBTS,IBDDT,IBSSN,"S-NAC"))
32 K IBRSY S IBRSY=""
33 F S IBRSY=$O(^TMP("IBQLR2",$J,IBSVC,IBTS,IBDDT,IBSSN,IBRSY)) Q:'IBRSY D
34 .S IBRSYCNT=^TMP("IBQLR2",$J,IBSVC,IBTS,IBDDT,IBSSN,IBRSY)
35 .S IBRSY(9999-IBRSYCNT,IBRSY)=""
36 D PLINE
37 Q
38 ;
39PLINE ;
40 I IBPAG=0 D HDR
41 D CHKL Q:IBQUIT
42 I IBSUBH'="",'$G(IBSSN) W !!,IBSUBH,! Q
43 W !,IBSSN,?11 S IBDT=IBADM D DTC W $J(IBDT,8) W ?20 S IBDT=IBDDT D DTC W $J(IBDT,8)
44 W ?29,IBADIAG,?37,IBENRLL,?45,$P(IBRAD," "),?52,$P(IBRAD," ",2),?58,$J(IBLOS,4),?63,$J(IBSACNT,4),?68,$J(IBSNCNT,4)
45 W ?73 S (RCNT,CNT)="" F S RCNT=$O(IBRSY(RCNT)) Q:'RCNT S REA="" D Q:CNT=4
46 .F S REA=$O(IBRSY(RCNT,REA)) Q:REA="" D Q:CNT=4
47 ..W ?($X+2),$J(REA_"/"_(9999-RCNT),8)," " S CNT=CNT+1
48 ;W ?85 S RCNT="" F I=1:1:3 S RCNT=$O(IBRSY(RCNT)) Q:'RCNT D ; for Download rpt. use F S RCNT=$O(...
49 ;.W ?($X+2),$J(IBRSY(RCNT),6),?($X+2),$J(9999-RCNT,3)
50 Q
51 ;
52HDR ;
53 W:$E(IOST,1,2)["C-"!(IBPAG>0) @IOF S IBPAG=IBPAG+1
54 W !,IBTDT,?(IOM-$L(IBHDR)/2),IBHDR,?(IOM-10),"PAGE ",IBPAG
55 W !,?(IOM-$L(IBHDR1)/2),IBHDR1,!,?(IOM-$L(IBHDR2)/2),IBHDR2
56 W !!,?11,"ADMIT",?20,"DISCH",?37,"ENRLL",?45,"ADM. REASONS",?63,"#AC",?68,"#N-AC"
57 W ?76,"C O N T I N U E D S T A Y R E A S O N S"
58 ;W ?73 F I=1:1:4 D ; for Download rpt. use F I=1:1:IBLVH
59 ;.W ?($X+2),$J("S-REA",6),?($X+2)," "
60 W !,"SSN",?11,"DATE",?20,"DATE",?29,"DIAG",?37,"R-D-L",?45,"1",?52,"2",?58,"#LOS",?63,"DAYS",?68,"DAYS"
61 W ?73 F I=1:1:4 D ; for Download rpt. use F I=1:1:IBLVH
62 .W ?($X+2),$J(I_"/CNT",6),?($X+2)," "
63 W !,$TR($J("",IOM)," ","-")
64 Q
65 ;
66CHKL ; -- check end of page
67 I IOSL<($Y+5),$E(IOST,1,2)="C-" D PAUSE^VALM1 S:$D(DIRUT) IBQUIT=1 Q:IBQUIT W @IOF D HDR Q
68 I IOSL<($Y+5) D HDR
69 Q
70 ;
71DTC S IBDT=+$E(IBDT,4,5)_"/"_$E(IBDT,6,7)_"/"_$E(IBDT,2,3)
72 Q
Note: See TracBrowser for help on using the repository browser.