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

AGTXERP.m

Go to the documentation of this file.
AGTXERP ; IHS/ASDS/EFG - OCT 27,1992 ;  
 ;;7.1;PATIENT REGISTRATION;**2**;JAN 31, 2007
 I '(^AGTXER(0)) W !!,"No errors were found during the export procedure.",!!! H 4 Q
 W !!,"There were ",^AGTXER(0)," patients with errors found during this process.",!!,"Stand-by for the error report.",!! S AGIO=IO,AG("HAT")=""
DEV I '$G(IO) S IOP="HOME" D ^%ZIS
 S %ZIS="OPQ" D ^%ZIS I POP S IOP=ION D ^%ZIS Q
 G:'$D(IO("Q")) START K IO("Q") I $D(IO("S"))!($E(IOST)'="P") W *7,!,"Please queue to system printers." D ^%ZISC G DEV
 S:'$G(AGTXSITE) AGTXSITE=$P($G(^AUTTSITE(1,0)),U)  ;AG*7.1*2 IM22637
 X ^%ZOSF("UCI") S ZTRTN="START^AGTXERP",ZTUCI=Y,ZTDESC="Error Report For Data Exported for "_$P($G(^AUTTLOC(AGTXSITE,0)),U,2)_".",ZTSAVE=""
 D ^%ZTLOAD G:'$D(ZTSK) DEV K AG,AGIO,ZTDESC,ZTRTN,ZTSK,ZTUCI D ^%ZISC
 Q
START ;EP - From Taskman.
 S AGTXSITE=$P(^AUTTSITE(1,0),U)
 U IO X ^%ZOSF("UCI") S X="UCI: "_$P(Y,",") D CTR^AG S AGUCI=X,(AGPGPG,AG("SITE"),AGTOTAL)=0,X=$P(^DIC(4,AGTXSITE,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
 D ^AGVAR:'$D(AGOPT),VAR^AGBADATA,LINES^AG,NOW^AG S X="as of "_AGTIME D CTR^AG S AGTIME=X D HDR
B S AG("SITE")=$O(^AGTXER(AG("SITE"))) G END:+AG("SITE")=0
C F DFN=0:0 S DFN=$O(^AGTXER(AG("SITE"),DFN)) G B:DFN="" S AGSITE=DUZ(2),DUZ(2)=AG("SITE") D ^AGDATCK S DUZ(2)=AGSITE I AG("DTOT")>0 D PRINT G:$D(DUOUT)!$D(DTOUT)!$D(DFOUT) END1 I $Y>AGBM D RTRN^AG G:$D(DUOUT)!$D(DTOUT)!$D(DFOUT) END1 D HDR
END W !!,"TOTAL PATIENTS WITH INVALID DATA: ",AGTOTAL K AG("HAT") D RTRN^AG W $$S^AGVDF("IOF")
END1 D ^%ZISC K AG,AGIO,AGSITE,AGTIME,AGBM,DUOUT,DTOUT,DFOUT,I,IOP,J,AG("LOC"),AGPGPG,AG("SITE"),AGTOTAL,AGUCI,AG("USR"),X,XY,XYER,Y D:$D(ZTQUEUED) KILL^%ZTLOAD
 Q
PRINT ;Print invalid patient data.
 W:$D(^DPT(DFN,0)) $P(^DPT(DFN,0),U) W:$D(^AUPNPAT(DFN,41,AG("SITE"),0)) ?35,$P(^AUPNPAT(DFN,41,AG("SITE"),0),U,2),?45,$P(^DIC(4,AG("SITE"),0),U)
 ;S Y=$P(^AUPNPAT(DFN,0),U,3) I Y D DD^%DT W !,"Last Registration Update : ",Y
 S Y=$P($G(^AUPNPAT(DFN,0)),U,3) I Y D DD^%DT W !,"Last Registration Update : ",Y  ;AG*7.1*2 REPORTED DURING ALPHA
 I '$D(^AUPNPAT(DFN,41,AG("SITE"),0))&'$D(AG("ER",2)) S A=0,A=$O(^AUPNPAT(DFN,41,A)) W:A'=0 ?35,$P(^AUPNPAT(DFN,41,A,0),U,2),?45,$P(^DIC(4,A,0),U) K A
 F I=1:1:14 I $D(AG("ER",I)) W !?5,AG(I) I $Y>AGBM F J=I+1:1:13 I $D(AG("ER",J)) D RTRN^AG Q:$D(DUOUT)!$D(DTOUT)!$D(DFOUT)  D HDR W "(Cont.)" Q
 Q:$D(DUOUT)!$D(DTOUT)!$D(DFOUT)
 S AGTOTAL=AGTOTAL+1 W !,AG("-"),!
 Q
HDR S AGPGPG=AGPGPG+1 W $$S^AGVDF("IOF"),!!,AG("USR"),?72,"page ",AGPGPG,!,AG("LOC"),!?22,"INVALID DATA ENTRIES - PATIENT FILES",!,AGUCI,!,AGTIME,!!,"PATIENT'S NAME",?35,"CHART #   FACILITY",!?5,"ERRORS FOUND",!,AG("="),!
 Q
AGTXCK ;EP - (from option) Error check before creating transactions.
 S DIC=9009063.01,DA=DUZ(2),DR=9,AG("DRENT")=0 D ^AGDICLK I $D(AG("LKDATA")),AG("LKDATA")="N" D RESET^AGTX
 D VIDEO^AG,SETCHDFN^AGTX0
 G AGTXERP