source: WorldVistAEHR/trunk/r/REGISTRATION-DGQE-DG-DPT-GRPX-VAD-VAF-VAS-VAT-VAU--VA-VIC--DGBT--DGJ--DGYA--VALM/DGOIL1.m@ 1093

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

initial load of WorldVistAEHR

File size: 2.3 KB
Line 
1DGOIL1 ;ALB/AAS - INPATIENT LIST (CONT.) ; 28-SEPT-90
2 ;;5.3;Registration;**162,498**;Aug 13, 1993
3 ;
4PRINT ; -- print line for one entry
5 I IOSL<($Y+6) D HDR^DGOIL Q:$D(DUOUT)
6 N I,J,K D INP^VADPT,PID^VADPT
7 I $D(^DGPM(DGPM,0)),$P(^(0),"^",3)'=DFN W !!,"BAD 'CN' CROSS REFERENCE FOR WARD ",W,", PATIENT NUMBER",DFN,!! Q
8 S DGPMIFN=DGPM D ^DGOIL2 S X=X3,DGL=+X3
9 W !,$P(X,"^",10),$P(X,"^",9),$E(N,1,17),?19,VA("BID")
10 D PRINT2:DGBRK,PRINT1:'DGBRK
11 D END
12 Q
13 ;
14PRINT2 ; -- Print with ward breakout, if DGDRG add DRG data
15 I '$O(X(0)) D PRINT1 Q
16 F M=0:0 S M=$O(X(M)) Q:'M S X=X(M),Y=$P(X,"^",7),W1=W,W=$P(X,"^",8) D PRINT1 S W=W1 W:$O(X(M)) !
17 I $O(X(1)) S X=X3 W !?41,"TOTAL" D NUM
18 I DGDRG D DRG
19 D BED
20 Q
21 ;
22PRINT1 ; -- Print without ward breakout
23 S Y=$P(X,"^",7) I Y S Y=$$FMTE^XLFDT(Y,"5DF"),Y=$TR(Y," ","0")
24 W ?27,Y,?38,$E(W,1,10)
25NUM W ?49 F L=1:1:5 W $J(+$P(X,"^",L),5)
26 D:'DGBRK BED
27 Q
28 ;
29DRG ; - calculate DRG from PTF and print on total line
30 S PTF=$S($D(^DGPM(DGPM,0)):$P(^(0),U,16),1:"") Q:PTF'>0
31 S (DRG,DRGCAL)="",AGE=$P(^DPT(DFN,0),U,3),SEX=$P(^(0),U,2),DGCPT=1 D EN1^DGPTFD K DGCPT I DRG="" W ?76,"No DRG can be calculated" Q
32 S DRGCAL=$S($D(^ICD(DRG,0)):^(0),1:"") W ?76,DRG,?83,$J($P(DRGCAL,"^",8),3,1),?88,$J($P(DRGCAL,"^",$S('AFFIL:7,AFFIL=2:11,1:2)),3,1),?96,$P(DRGCAL,U,3),"/",$P(DRGCAL,"^",4),?104,$P(DRGCAL,"^",9),"/",$P(DRGCAL,"^",10)
33 S NTT=$P(DRGCAL,U,4)-DGL,LTT=$P(DRGCAL,U,10)-DGL,PNT=$S($P(DRGCAL,U,4)>0:DGL/$P(DRGCAL,U,4)*100\1,1:"*"),PLT=$S($P(DRGCAL,U,10)>0:DGL/$P(DRGCAL,U,10)*100\1,1:"*")
34 S FLG=$S($P(DRGCAL,U,10)&(LTT<0)!(('$P(DRGCAL,U,10))&(NTT<0)):"####",$S(+PLT=0:PNT,1:PLT)>69:"**",$S(+PLT=0:PNT,1:PLT)>49:"@",1:"") S:LTT<0 LTT=0 S:NTT<0 NTT=0
35 W ?112,NTT,"/",LTT,?120,PNT,"/",PLT,?128,FLG
36 ;I DGL'=+XW W !,?48,$J("("_DGL_")",7)
37 Q
38 ;
39END K AGE,SEX,NTT,LTT,PLT,PLN,VA,W1,VAERR,PTF,DGL,DRG,DRGCAL,PNT,FLG
40 Q
41% D %^DGOIL
42 Q
43 ;
44EN1 ;
45 ; - tasked entry , no ward breakout
46 ;
47 S DGBEG="",DGEND="ZZZZZZZ",DGWARD=1,DGBRK=0,DGDRG=0 G DQ^DGOIL
48 Q
49 ;
50EN2 ;
51 ; - tasked entry, with ward breakout, no drg
52 ;
53 S DGBEG="",DGEND="ZZZZZZZ",DGWRD=1,DGBRK=1,DGDRG=0 G DQ^DGOIL
54 Q
55 ;
56EN3 ;
57 ; - tasked entry, with ward breakout, with drg info
58 ;
59 S DGBEG="",DGEND="ZZZZZZZ",DGWRD=1,DGBRK=1,DGDRG=1 G DQ^DGOIL
60 Q
61BED ; -- Print room and treating specialty
62 W !?38,"Rm: ",VAIN(5),?55,"Spec: ",$E($P(VAIN(3),"^",2),1,19)
63 Q
Note: See TracBrowser for help on using the repository browser.