source: WorldVistAEHR/trunk/r/UTILIZATION_MGMT_ROLLUP_LOCAL-IBQ/IBQLD3A.m@ 1211

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

initial load of WorldVistAEHR

File size: 2.4 KB
Line 
1IBQLD3A ;LEB/MRY - PROVIDER/PATIENT DOWNLOAD ; 1-SEP-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 S (IBDATA,IBQUIT,IBHDR,IBHDR1,IBPHY)="",IBPAG=0
6 ; -- call to return header dates - IBTDT, IBDRNG
7 D DTC^IBQLPL2
8 D HDR I '$D(^TMP("IBQLD3",$J)) W !!,?20,"<<< NO PATIENTS TO PRINT >>>" Q
9 ;
10 F S IBPHY=$O(^TMP("IBQLD3",$J,IBPHY)) Q:IBPHY="" D Q:IBQUIT
11 .S IBSUBH=IBTYD_": "_IBPHY
12 .D PLINE
13 .S IBDDT="" F S IBDDT=$O(^TMP("IBQLD3",$J,IBPHY,IBDDT)) Q:'IBDDT D Q:IBQUIT
14 ..S IBSSN="" F S IBSSN=$O(^TMP("IBQLD3",$J,IBPHY,IBDDT,IBSSN)) Q:'IBSSN D DATA Q:IBQUIT
15 Q
16 ;
17END K IBDATA,IBTS,IBADM,IBADIAG,IBENRLL,IBPHYAD,IBPHYAT,IBPHYRS,IBAAD,IBRAD,IBLOS,IBRSYCNT,IBHDR,IBHDR1,IBDRNG,IBDT,IBRSY,IBSSN,IBTDT,IBTRND1,IBTRV,IBTRVD
18 Q
19 ;
20DATA ;
21 S IBDATA=^TMP("IBQLD3",$J,IBPHY,IBDDT,IBSSN)
22 S IBADM=$P(IBDATA,"^"),IBADIAG=$P(IBDATA,"^",2),IBENRLL=$P(IBDATA,"^",3)
23 S IBPHYAD=$P(IBDATA,"^",4),IBPHYAT=$P(IBDATA,"^",5),IBPHYRS=$P(IBDATA,"^",6)
24 S IBAAD=$P(IBDATA,"^",7),IBNAD=$P(IBDATA,"^",8),IBRAD=$P(IBDATA,"^",9)
25 S IBCHK=$P(IBDATA,"^",10) I IBCHK=1 D PLINE Q
26 S IBLOS=$G(^TMP("IBQLD3",$J,IBPHY,IBDDT,IBSSN,"LOS"))
27 S IBSACNT=$G(^TMP("IBQLD3",$J,IBPHY,IBDDT,IBSSN,"S-AC"))
28 S IBSNCNT=$G(^TMP("IBQLD3",$J,IBPHY,IBDDT,IBSSN,"S-NAC"))
29 K IBRSY S IBRSY=""
30 F S IBRSY=$O(^TMP("IBQLD3",$J,IBPHY,IBDDT,IBSSN,IBRSY)) Q:'IBRSY D
31 .S IBRSYCNT=^TMP("IBQLD3",$J,IBPHY,IBDDT,IBSSN,IBRSY)
32 .S IBRSY(9999-IBRSYCNT,IBRSY)=""
33 D PLINE
34 Q
35 ;
36PLINE ;
37 I IBSUBH'="",'$G(IBSSN) W !!,IBSUBH,! Q
38 W !,IBSSN,"^" S IBDT=IBADM D DTC W IBDT W "^" S IBDT=IBDDT D DTC W IBDT
39 W "^",IBADIAG,"^",IBENRLL,"^",IBAAD,"^",IBNAD,"^",$P(IBRAD," "),"^",$P(IBRAD," ",2),"^",$P(IBRAD," ",3)
40 I IBCHK=1 W "^ATTENDING PROVIDER CONTAINS ADMITTING PROVIDER'S 'LOS' DATA." Q
41 W "^",IBLOS,"^",IBSACNT,"^",IBSNCNT
42 S RCNT="" F S RCNT=$O(IBRSY(RCNT)) Q:'RCNT S REA="" D
43 .F S REA=$O(IBRSY(RCNT,REA)) Q:REA="" D
44 ..W "^",REA,"^",(9999-RCNT)
45 ;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(...
46 ;.W ?($X+2),$J(IBRSY(RCNT),6),?($X+2),$J(9999-RCNT,3)
47 Q
48 ;
49HDR ;
50 W !!,"^ADMIT^DISCH^^ENRLL^^^A-REA^A-REA^A-REA^^#AC^#N-AC"
51 F I=1:1:IBLVH D ; for Download rpt. use F I=1:1:IBLVH
52 .W "^",$J("S-REA",6),"^"
53 W !,"SSN^DATE^DATE^DIAG^R-D-L^A^N^1^2^3^#LOS^DAYS^DAYS"
54 F I=1:1:IBLVH D ; for Download rpt. use F I=1:1:IBLVH
55 .W "^",$J(I,1),"^",$J("CNT",3)
56 Q
57 ;
58DTC S IBDT=+$E(IBDT,4,5)_"/"_$E(IBDT,6,7)_"/"_$E(IBDT,2,3)
59 Q
Note: See TracBrowser for help on using the repository browser.