Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: DGODNP2

DGODNP2.m

Go to the documentation of this file.
DGODNP2 ;ALB/EG - OUTPUT TOT DISCH BY MEANS TST/ELIGIBILITY; JAN 9 1989 @ 1507
 ;;5.3;Registration;**1015**;Aug 13, 1993;Build 21
 ;;V 4.5
 S U="^",ZRT=0,%DT="T",X="N" D ^%DT S (DGGE,T2)=Y X ^DD("DD") S T2=Y
 S I5("V")="SC 50-100%^A&A/HB/WW1/POW/MEX^SC<50%^NSC/PEN^NSC^DOM^",I5("N")="CHAMPVA^COLLATERAL^EMPLOYEE^OTHER FED^ALLIED VET^HUMANITARIAN^SHARING^REIMB INSURANCE^"
 D ET^DGODUTL F K=1:1:A2 S DGDV=$P(A(K),U,2),DGDVN=$P(A(K),U,1),^UTILITY("DGOD",$J,DGJB,DGTN,DGDV,"HOSP")=$S($D(Z(DGDV))>0:Z(DGDV),1:0) Q:ZRT[U  D PRI
 D ^DGODNSM W !,"Elapsed time for this run: ",DGTOUT,!
END K DGBD,DGDV,DGDVN,DGEL,DGG,DGND,DGTOUT,DGV,I,I2,I3,I5,L,T2,X,Y,Z,ZRT,ZRT1
 Q
HDR U IO W @IOF,!,?1,"INPATIENT DISCHARGES REPORT",?IOM-20,T2 S $P(L,"-",IOM-1)="" W !,L,!
 W !,?1,"DATE RANGE: FROM  " S Y=DGBD X ^DD("DD") W Y,"  TO  " S Y=DGND X ^DD("DD") W Y,!
 W !,?(IOM-26\2),"MEANS TEST CLASSIFICATION",! Q
PRI Q:ZRT[U  Q:$D(^UTILITY("DGOD",$J,DGJB,DGTN,"TOT",DGDV))=0
 Q:^UTILITY("DGOD",$J,DGJB,DGTN,"TOT",DGDV)=0
 D HDR W !,?1,"FACILITY: ",DGDV,?20,DGDVN,?40,"TOTAL DISCHARGES: ",?50,^UTILITY("DGOD",$J,DGJB,DGTN,"TOT",DGDV)
 W:$D(^UTILITY("DGOD",$J,DGJB,DGTN,DGDV,"HOSP"))>0 ?65,"Patients remaining  on "_T2_" : ",^UTILITY("DGOD",$J,DGJB,DGTN,DGDV,"HOSP"),!
 W !,?30,"AS",?40,"AN",?50,"B0",?60,"C0",?70,"N0",?80,"X0",?90,"U0",?100,"TOTAL",?110,"%",!
 F I=30:10:110 W ?I,"------"
 F DGV="V","N" W !,?1,$S(DGV="V":"VETERAN ELIGIBILITY",DGV="N":"NON-VETERAN ELIGIBILITY",1:0),!,?1,"-----------------------",! F DGEL=1:1:8,"*" D PRI1
 S:$D(Z(DGDV))=0 Z(DGDV)=0 D:^UTILITY("DGOD",$J,DGJB,DGTN,"TOT",DGDV)>0 TOTI^DGODTOT S ^UTILITY("DGOD",$J,DGJB,DGTN,DGDV)=$C(35)_U_DGGE_U_DGDV_U_DGJB_U_DGBD_U_DGND_U_Z(DGDV)_U_DGTOUT Q
PRI1 ;print each row
 Q:ZRT[U  S ZRT1="Hit RETURN to continue" I (IOST["C-")&(IO=IO(0))&(IOSL-$Y<4) W !,?IOM-$L(ZRT1)-2,ZRT1 R ZRT:DTIME S:'$T ZRT=U D:$D(ZRT) HDR
 W:'((DGV="V")&(DGEL>6)) !,?1,$P(I5(DGV),U,DGEL)
 W:DGEL="*" ?1,"ERROR"
 W:'((DGV="V")&(DGEL>6)) ?30,^UTILITY("DGOD",$J,DGJB,DGTN,DGDV,DGV,"AS",DGEL),?40,^UTILITY("DGOD",$J,DGJB,DGTN,DGDV,DGV,"AN",DGEL),?50,^UTILITY("DGOD",$J,DGJB,DGTN,DGDV,DGV,"B",DGEL),?60,^UTILITY("DGOD",$J,DGJB,DGTN,DGDV,DGV,"C",DGEL)
 W:'((DGV="V")&(DGEL>6)) ?70,^UTILITY("DGOD",$J,DGJB,DGTN,DGDV,DGV,"N",DGEL),?80,^UTILITY("DGOD",$J,DGJB,DGTN,DGDV,DGV,"X",DGEL),?90,^UTILITY("DGOD",$J,DGJB,DGTN,DGDV,DGV,"U",DGEL)
 W:'((DGV="V")&(DGEL>6)) ?100,^UTILITY("DGOD",$J,DGJB,DGTN,DGDV,DGV,"TOT",DGEL),?110,"("_$J(^UTILITY("DGOD",$J,DGJB,DGTN,DGDV,DGV,"TOT",DGEL)/^UTILITY("DGOD",$J,DGJB,DGTN,"TOT",DGDV)*100,2,2)_")",!
 D:DGEL="*" TOT1
 Q
 ;
TOT1 ;column subtotal
 Q:ZRT[U  F I=30:10:110 W ?I,"------"
 W !,?1,"SUBTOTAL",?30,^UTILITY("DGOD",$J,DGJB,DGTN,DGDV,DGV,"TOT","AS"),?40,^("AN"),?50,^("B"),?60,^("C"),?70,^("N"),?80,^("X"),?90,^("U")
 W ?100,^UTILITY("DGOD",$J,DGJB,DGTN,DGDV,"TOT",DGV),?110,"("_$J(^UTILITY("DGOD",$J,DGJB,DGTN,DGDV,"TOT",DGV)/^UTILITY("DGOD",$J,DGJB,DGTN,"TOT",DGDV)*100,2,2)_")"
 W !,?1,"SUBTOTAL %",?30,$J(^UTILITY("DGOD",$J,DGJB,DGTN,DGDV,DGV,"TOT","AS")/^UTILITY("DGOD",$J,DGJB,DGTN,"TOT",DGDV)*100,2,2),?40,$J(^UTILITY("DGOD",$J,DGJB,DGTN,DGDV,DGV,"TOT","AN")/^UTILITY("DGOD",$J,DGJB,DGTN,"TOT",DGDV)*100,2,2)
 W ?50,$J(^UTILITY("DGOD",$J,DGJB,DGTN,DGDV,DGV,"TOT","B")/^UTILITY("DGOD",$J,DGJB,DGTN,"TOT",DGDV)*100,2,2),?60,$J(^UTILITY("DGOD",$J,DGJB,DGTN,DGDV,DGV,"TOT","C")/^UTILITY("DGOD",$J,DGJB,DGTN,"TOT",DGDV)*100,2,2)
 W ?70,$J(^UTILITY("DGOD",$J,DGJB,DGTN,DGDV,DGV,"TOT","N")/^UTILITY("DGOD",$J,DGJB,DGTN,"TOT",DGDV)*100,2,2),?80,$J(^UTILITY("DGOD",$J,DGJB,DGTN,DGDV,DGV,"TOT","X")/^UTILITY("DGOD",$J,DGJB,DGTN,"TOT",DGDV)*100,2,2)
 W ?90,$J(^UTILITY("DGOD",$J,DGJB,DGTN,DGDV,DGV,"TOT","U")/^UTILITY("DGOD",$J,DGJB,DGTN,"TOT",DGDV)*100,2,2)
 W ?100,$J(^UTILITY("DGOD",$J,DGJB,DGTN,DGDV,"TOT",DGV)/^UTILITY("DGOD",$J,DGJB,DGTN,"TOT",DGDV)*100,2,2),!
 Q
 ;