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

AGTX4.m

Go to the documentation of this file.
AGTX4 ; IHS/ASDS/EFG - EXPORT REG DATA CONT'D ;  
 ;;7.1;PATIENT REGISTRATION;;AUG 25,2005
JOBEND ;EP - EOJ, Process and mark deletes, DISPLAY RECORD COUNTS ETC.
 ; send deletes to DDPS (AGNODE is to be the complete RG3 ready to send) ie RG3^ASUFAC^HRN^^LastIntFirstInt^Sex
 I $D(^AGPATCH("DEL")) S AGNODE="" F  S AGNODE=$O(^AGPATCH("DEL",AGNODE)) Q:AGNODE=""  S ^AGPATCH("DEL",AGNODE)=1 D
 .I '$D(ZTQUEUED) W:AGOUTFLG !,AGNODE I 'AGOUTFLG,AGROUT#10=0 X XY W AGROUT
 .S AGROUT=AGROUT+1,AGNODE=$P(AGNODE,U,1)_U_$$UID^AGTXID(0)_U_$P(AGNODE,U,2,999),$P(AGNODE,U,9)=$P(AGNODE,U,9),^AGTXDATA(AGROUT)=AGNODE,AG("TOT")=$G(AG("TOT"))+1
 K AGNODE
 D HEADER^AGTX
 S AG("T")=0,AG("N")=0 F AG("T")=0:1 S AG("N")=$O(^AGCHDFN(AG("N"))) Q:AG("N")'>0
ALL ;EP - From AGTXALL.
 W !!?10,"NUMBER OF PATIENTS BEING SENT     = ",$J(AG("T"),5)
 W !!?10,"NUMBER OF PATIENT RECORDS TO SEND = ",$J(AG("TOT"),5)
 W !?10,"            TOTAL RECORDS TO SEND = ",$J(AG("T")+AG("TOT"),5)
 W !!?10,"NUMBER OF BLANK ADDRESS RECORDS   = ",$J(AGBAD16,5)
 W !!?10,"NUMBER OF BLANK COMMUNITY         = ",$J(AGBAD51,5)
 I AGROUT<1 W !!,*7,?10,"NO RECORDS GENERATED FOR EXPORT" G KILL
SETZERO ;Set 0th node.
 N AGASUFAC,AGSITE,AGDATE
 S AGASUFAC=$P(^AUTTLOC(AGTXSITE,0),U,10)
 S AGSITE=$P(^DIC(4,AGTXSITE,0),U)
 S AGDATE=DT+17000000
 I $D(AGFDATE) S AGFDATE=AGFDATE+17000000
 I $D(AGLDATE) S AGLDATE=AGLDATE+17000000
 S ^AGTXDATA(0)=AGASUFAC_U_AGSITE_U_AGDATE_U_AGFDATE_U_AGLDATE_"^^"_AGROUT_U
 I $D(AGLDATE) S AGLDATE=AGLDATE-17000000
 I $D(AGFDATE) S AGFDATE=AGFDATE-17000000
 G:$D(AG("REGEN")) W1
 D SET^AGTXST ;set data into transmission file
W1 ;
 W !!?17,"REGISTRATION EXPORT GLOBAL HAS BEEN GENERATED." D:'$G(AGTXALL) ^AGTXTOT,^AGTXERP G KILL
ENTRETRN ;EP -
 K DIR S DIR(0)="E" D ^DIR K DIR
KILL K AGELGEND,AGTX,AGTXRGSV,AGBAD16,AGBAD26,AGBAD51,AGCC,AGCT,DA,AGDFN16,AGDFN51,DIC,DR,DX,DY,AGFDATE,AGFN,G,AGL,AGLDATE,AG("LKDATA"),AG("LKPRINT")
 K AGLN,AGMN,AGN1,AGN2,AGN3,AGNAME,AGNI,AGNUMB,AGOUTFLG,AGR1,AGR2,AGRCT,AGROUT,AGRR,AGRR1,AG("SITE"),AGTEMP,AGVAL,X,AGXN,XX,Y,Z
 Q