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

ADGCEN20.m

Go to the documentation of this file.
ADGCEN20 ; IHS/ADC/PDW/ENM - CENSUS AID-LIST BY TX (PRINT) ; [ 03/25/1999  11:48 AM ]
 ;;5.0;ADMISSION/DISCHARGE/TRANSFER;;MAR 25, 1999
 ;
 ;***> initialize variables
 S DGPAGE=0,DGSITE=$P(^DIC(4,DUZ(2),0),U),DGDUZ=$P(^VA(200,DUZ,0),U,2)
 S DGTL=$P(^DIC(45.7,DGSRV,0),U)_" SERVICE"
 S DGTYP=$S(DGAGE=0:"ADULT",1:"PEDIATRIC")
 ;
 ;***> loop thru census file by service and print data
 D HEAD S DGDT=DGBDT-.0001
A1 S DGDT=$O(^ADGTX(DGSRV,1,DGDT)) G END:DGDT="",END:DGDT>DGEDT
 ;
 I '$D(^ADGTX(DGSRV,1,DGDT,DGAGE)) D  G END
 .W !!,"NO CENSUS DATA FOR THIS SERVICE FOR "
 .W $E(DGDT,4,5)_"/"_$E(DGDT,6,7)_"/"_$E(DGDT,2,3),!! Q
 ;
 S DGSTR=^ADGTX(DGSRV,1,DGDT,DGAGE)
 W !,$E(DGDT,4,5)_"/"_$E(DGDT,6,7)_"/"_$E(DGDT,2,3)
 W ?17,$P(DGSTR,U,3-DGAGE),?27,$P(DGSTR,U,5-DGAGE)
 W ?37,$P(DGSTR,U,6-DGAGE),?48,$P(DGSTR,U,4-DGAGE)
 W ?58,$P(DGSTR,U,7-DGAGE),?69,$P(DGSTR,U,2-DGAGE)
 I $Y>(IOSL-6) D NEWPG G END1:DGSTOP=U
 G A1
 ;
END I IOST["C-" K DIR S DIR(0)="E" D ^DIR
END1 I $D(ZTQUEUED) Q
 K DGBDT,DGEDT,DGDT,DGSRV,DGAGE,DGPAGE,DGSITE,DGLIN,DGX
 K DGDUZ,DGTL,DGSTR,DGSTOP,DGTYP,X,Y,DIR
 D ^%ZISC Q
 ;
NEWPG ;***> subrtn for end of page control
 I IOST'?1"C-".E D HEAD S DGSTOP="" Q
 K DIR S DIR(0)="E" D ^DIR S DGSTOP=X
 I DGSTOP'=U D HEAD
 Q
 ;
 I (IOST["C-")!(DGPAGE>0) W @IOF
 S DGPAGE=DGPAGE+1 W !,DGDUZ,?80-$L(DGSITE)/2,DGSITE
 W ! D TIME^ADGUTIL S DGX="ADT "_DGTYP_" CENSUS DATA FOR" W ?80-$L(DGX)/2,DGX
 S Y=DT X ^DD("DD") W !,Y
 W ?80-$L(DGTL)/2,DGTL,?70,"Page: ",DGPAGE
 S DGLIN="",$P(DGLIN,"=",80)="" W !,DGLIN
 W !,"Date",?15,"Admits",?25,"Trans In",?35,"Trans Out"
 W ?46,"Disch",?55,"Deaths",?65,"Remaining"
 S DGLIN="",$P(DGLIN,"-",80)="" W !,DGLIN,!
 Q