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

ADGADSP.m

Go to the documentation of this file.
  1. ADGADSP ; IHS/ADC/PDW/ENM - A & D SHEET PRINT (DETAILED) ; [ 03/25/1999 11:48 AM ]
  1. ;;5.0;ADMISSION/DISCHARGE/TRANSFER;;MAR 25, 1999
  1. ;
  1. ;Detailed Version of ADMISSIONS & DISCHARGES SHEET
  1. ;
  1. S (DGZRM,X)=110 X ^%ZOSF("RM") ;change right margin to 110
  1. W !?26,"*****Confidential Patient Data Covered by Privacy Act*****"
  1. S DGX=$P($G(^DIC(4,DUZ(2),0)),U) ;facility name
  1. W !?DGZRM-$L(DGX)/2,DGX,?DGZRM-5,$P(^VA(200,DUZ,0),U,2) ;user initials
  1. S DGX="ADMISSIONS & DISCHARGES" W !?DGZRM-$L(DGX)/2,DGX
  1. W ?DGZRM-8,$E(DT,4,7)_$E(DT,2,3)
  1. S Y=DGDATE X ^DD("DD") W !?DGZRM-$L(Y)/2,Y,?DGZRM-9 D ^%T
  1. ;
  1. COUNTS ;***> find inpatient counts
  1. ;S (DGW,DGINPCT)=0
  1. S (DGW,DGINPCT,DGNEWCT)=0
  1. F Q:DGW'?1N.N D ;loop thru adt census-ward file;gather totals
  1. .S DGW=$O(^ADGWD(DGW)) Q:DGW'?1N.N ;
  1. .S:$D(^ADGWD(DGW,1,DGDATE)) DGINPCT=DGINPCT+$P(^(DGDATE,0),U,2)
  1. .S:$D(^ADGWD(DGW,1,DGDATE)) DGNEWCT=DGNEWCT+$P(^(DGDATE,0),U,12)
  1. ;get newborn count, if any
  1. ;S DGZ=$O(^DIC(45.7,"B","NEWBORN",0))
  1. ;S DGNEWCT=$S(DGZ="":0,'$D(^ADGTX(DGZ,1,DGDATE,1)):0,1:$P(^ADGTX(DGZ,1,DGDATE,1),U))
  1. ;S DGINPCT=DGINPCT-DGNEWCT
  1. W !!!?10,"INPATIENTS: ",DGINPCT,?94,"NEWBORNS: ",DGNEWCT
  1. ;
  1. W !?10,"NAME",?37,"HRCN",?47,"PROVIDER",?71,"AGE"
  1. W ?80,"WD SVRC",?90,"COMMUNITY"
  1. ;
  1. G ^ADGADSP1