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

AGTXTAPE.m

Go to the documentation of this file.
AGTXTAPE ; IHS/ASDS/EFG - REG EXPORT TAPE ;   
 ;;7.1;PATIENT REGISTRATION;;AUG 25,2005
 ;
 I '$D(^AGTXDATA(0)) W !!?24,"TRANSACTION FILE DOES NOT EXIST" W !?24,"MUST RUN TRANSACTION GENERATE." G ABEND
 S IOP=ION D ^%ZIS
 I '$D(DT) S %DT="",X="T" D ^%DT S DT=Y,X=0
 X ^%ZOSF("RM")
CART U IO(0) S X2=$E(DT,1,3)_"0101",X1=DT D ^%DTC S AGCARTNO=X+1 I AGOPT(17)="Y" W !!,"ENTER DATA CARTRIDGE NUMBER (1-6 CHAR) ",AGCARTNO," //" R Y:DTIME S:Y]"" AGCARTNO=Y W ! I AGCARTNO'?1.6UN W *7 G CART
DATE I AGOPT(17)="Y" S %DT("A")="ENTER DATE SENT TO AREA OFFICE  ",%DT="AEPX" D ^%DT G ABEND:Y<0 I Y<DT W *7,!!,"INVALID DATE." G DATE
 S:AGOPT(17)="N" Y=DT+17000000 S $P(^AGTXDATA(0),U,8)=AGCARTNO,$P(^(0),U,9)=Y
 W !!?28,"***  0th Node Info  ***",!!,"Number : ",$P(^AGTXDATA(0),U),!,"  Name : ",$P(^AGTXDATA(0),U,2),!?9,$P(^AGTXDATA(0),U,7)," records"
 S Y=$P(^AGTXDATA(0),U,4)-17000000 D DD^%DT W !?9,Y S Y=$P(^AGTXDATA(0),U,5)-17000000 D DD^%DT W " to ",Y,!
 S XBGL="AGTXDATA",XBTLE="Registration Export Global for",XBMED="F",XBFN="BGTX"_$P(^AUTTLOC($P(^AUTTSITE(1,0),U,1),0),U,10)_"."_$$JDT^XBFUNC(DT) D ^XBGSAVE I XBFLG G ABEND
 S AGTXSITE=$P(^AUTTSITE(1,0),U),AG=$P(^AGTXST(AGTXSITE,1,0),U,3),$P(^AGTXST(AGTXSITE,1,AG,0),U,10)="Y",$P(^AGTXST(AGTXSITE,1,AG,0),U,6)=AGCARTNO
 D:'$G(AGTXALL) CLEAR
 G KILL
ABEND ;
 W *7,!!?22,"ABNORMAL END OF REGISTRATION EXPORT." I $D(XBFLG(1)) W !!,XBFLG(1),!!
 W !?27,"ENTER <RETURN> TO CONTINUE" R X:DTIME
KILL ;
 K AG,XBGL,XBNAR,AGCARTNO,X1,X2
 KILL:'$G(AGTXALL) XBFLG
 Q
CLEAR ;EP - Clear past errors that were corrected
 I $D(^AGPATCH("ER")) S AGDTS=0 F  S AGDTS=$O(^AGPATCH("ER",AGDTS)) Q:'AGDTS  D
 .S AGZSITE=0 F  S AGZSITE=$O(^AGPATCH("ER",AGDTS,AGZSITE)) Q:'AGZSITE  D
 ..S AGDFN=0 F  S AGDFN=$O(^AGPATCH("ER",AGDTS,AGZSITE,AGDFN)) Q:'AGDFN  I ^AGPATCH("ER",AGDTS,AGZSITE,AGDFN)=1 K ^(AGDFN)
 K AGDTS,AGZSITE,AGDFN
 ;clear del records that have been marked as loaded
 I $D(^AGPATCH("DEL")) S AGNODE="" F  S AGNODE=$O(^AGPATCH("DEL",AGNODE)) Q:AGNODE=""  I ^(AGNODE)=1 K ^(AGNODE)
 K AGNODE Q