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

AGGRPRT.m

Go to the documentation of this file.
AGGRPRT ; VNGT/HS/KDC -  DAILY REGISTRATION ACTIVITY REPORT
 ;;1.0;PATIENT REGISTRATION GUI;;Nov 15, 2010
 ;
 ; Copied from AGREPRT
 ; 
 Q
 ;
EN(DATA,BDT,EDT,TYPE,AGGDUZ2) ; EP -- AGG DAILY REGISTRATION ACTIVITY REPORT
 ;Description
 ;  Generates DAILY REGISTRATION ACTIVITY REPORT
 ;
 ;Input
 ;  BDT - Beginning Date
 ;  EDT - Ending Date
 ;  TYPE - Type of daily report
 ;
 ;Output
 ;  DATA - Name of global in which data is stored(^TMP("AGGRPRT"))
 ;
 NEW UID,X,AGGI,HSTEXT,HSPATH,HSFN,Y,IOSL,IOST,IOM,I,N
 NEW AGBDT,AGBDTS,AGBM,AGTIME,AGUCI,AGBDTS,DFN
 NEW AG,AGB,AGE,AGIO,G,ZTDESC,ZTRTN,ZTSAVE,ZTSK,ZTUCI ;,HDIR,HFN
 I '$D(DT) S %DT="",X="T" D ^%DT S DT=Y
 S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
 S DATA=$NA(^TMP("AGGRPRT",UID))
 K @DATA
 ;
 S ROUTINE=$T(+0)
 S AGGI=0
 ;I $G(BDT)="" S BMXSEC="Must supply Beginning Date." G DONE
 ;I $G(EDT)="" S BMXSEC="Must supply End Date."  G DONE
 ;
 NEW $ESTACK,$ETRAP S $ETRAP="D ERR^AGGRPRT D UNWIND^%ZTER"
 ;
 S BDT=$P($$DATE^AGGUL1(BDT),".")
 S EDT=$P($$DATE^AGGUL1(EDT),".")
 S IOSL=99999999999,IOM=80,IOST="P-OTHER80"
 S IOST(0)=$$FIND1^DIC(3.2,,"X",IOST)
 ;I BDT>DT S BMXSEC="Do not use future dates." G DONE
 ;I EDT>DT S BMXSEC="Do not use future dates." G DONE
 ;I BDT>EDT S BMXSEC="INVALID ENTRY - The END is before the BEGINNING." G DONE
 ;I ",1,2,3,4,"'[(","_TYPE_",") S BMXSEC="Please Enter only ""1"" ,""2"",""3"" or ""4""." G DONE
 ;
 S AG("TYPE")=TYPE
 S AG("B")=BDT
 S AG("E")=EDT
 S AGB=$$FMTE^XLFDT(AG("B"),5),AGE=$$FMTE^XLFDT(AG("E"),5)
 S AGIO=$G(IO),AG("HAT")=""
 D HDR
 ;
 I $$TMPFL^AGGUL1("W",UID,"AGG"_$J) G DONE
 ;
 ;S HDIR=$P(IO,"\",1,2)_"\",HFN=$P(IO,"\",3)
 U IO ;D ^AGREPRT1
 S AGBDT=AG("B")-.1,AG("FAC")=AGGDUZ2
 D ^AGPATCNT
 K DUOUT,DTOUT,DFOUT
 D NOW^AG S X="as of : "_AGTIME D CTR^AG S AGTIME=X
 I AG("TYPE")>2 D ^AGGRPRT2 G RET
 X ^%ZOSF("UCI") S X="UCI: "_$P(Y,",") D CTR^AG S AGUCI=X,X=$P(^DIC(4,AGGDUZ2,0),U) D CTR^AG S AG("LOC")=X,AG("USR")=$P(^VA(200,DUZ,0),U),AGBM=IOSL-10 I $D(AGIO),AGIO=IO S AGBM=IOSL-4
 S AGBDTS=AGBDT
 D SCAN^AGGRPRT1
 G:$D(DUOUT)!$D(DTOUT)!$D(DFOUT) DONE
 D PRINT^AGGRPRT1
 ;D OPEN^%ZISH("AGGFILE",HDIR,HFN,"A")
RET ;
 U IO W $C(9)
 ;
 ;
 I $$TMPFL^AGGUL1("C") G DONE
 I $$TMPFL^AGGUL1("R",UID,"AGG"_$J) G DONE
 ;
 F  U IO R HSTEXT:.1 Q:HSTEXT[$C(9)  D  ;:$ZEOF=-1
 . S HSTEXT=$$STRIP^XLFSTR(HSTEXT,"^")
 . I HSTEXT="" S HSTEXT=" "
 . S AGGI=AGGI+1,@DATA@(AGGI)=HSTEXT_$C(13)_$C(10)_$C(30)
 S AGGI=AGGI+1,@DATA@(AGGI)=$C(30)
 ;
 I $$TMPFL^AGGUL1("C") G DONE
 I $$TMPFL^AGGUL1("D",UID,"AGG"_$J) G DONE
 ;
DONE ;
 ;
 S AGGI=AGGI+1,@DATA@(AGGI)=$C(31)
 K ROUTINE
 Q
 ;
HDR ;
 S @DATA@(AGGI)="T01024REPORT_TEXT"_$C(30)
 Q
 ;
ERR ;
 D ^%ZTER
 NEW Y,ERRDTM
 S Y=$$NOW^XLFDT() X ^DD("DD") S ERRDTM=Y
 S BMXSEC="Recording that an error occurred at "_ERRDTM
 I $D(AGGI),$D(DATA) S AGGI=AGGI+1,@DATA@(AGGI)=$C(31)
 I $$TMPFL^AGGUL1("C")
 Q