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

ABPAOC1.m

Go to the documentation of this file.
ABPAOC1 ;MERGE ^ABPVDATA TO ^ABPVGLOB-PART 2; [ 03/16/91  10:35 AM ]
 ;;1.4;AO PVT-INS TRACKING;*0*;IHS-OKC/KJR;JULY 25, 1991
B0 W !!,*7,"NOT AN ENTRY POINT!!!" Q
 ;
B1 S CT=0,ICT=$P(X3,"^",7),ICT=ICT*2
 U IO(0) W !!,?5,"<<<<  Please Standby - Transfering PRIVATE INSURANCE Data  >>>>",!
 S ^ASMPITMP(ZSITE,0)=$P(X3,"^",4,5)_"^"_$P(X3,"^",7)_"^"_$P(X3,"^",6)_"^"_$P(X3,"^",2,3)
 F I=1:1 U IO R X G END:$E(X,1,2)="**" U IO R X1,X2,X3 D S9A I +EFLG>0 G END1
S9A S RTYP=$P(X1,"^",1) G:RTYP'="ABP1" RTYPERR
 S CT=CT+1,^ASMPITMP(ZSITE,CT)=X1
 S RTYP=$P(X3,"^",1) G:RTYP'="ABP2" RTYPERR
 S CT=CT+1,^ASMPITMP(ZSITE,CT)=X3 Q
RTYPERR U IO(0) W *7,!,"<<< RECORD TYPE ERROR AT RECORD #",CT+1," ....JOB TERMINATED >>>" S EFLG=EFLG+1 Q
END I +CT'=+ICT D TERROR S EFLG=EFLG+1 G END1
 ;
TXFER1 S CDT=$P(^ABPVGLOB(0),"^",1),NDT=$P(^ASMPITMP(ZSITE,0),"^",1)
 I NDT<CDT S $P(^ABPVGLOB(0),"^",1)=NDT
 S CDT=$P(^ABPVGLOB(0),"^",2),NDT=$P(^ASMPITMP(ZSITE,0),"^",2)
 I NDT>CDT S $P(^ABPVGLOB(0),"^",2)=NDT
 S $P(^ABPVGLOB(0),"^",5)=ZSITE
 I '$D(^ABPVGLOB(ZSITE,0)) D  G NXTR
 .S $P(^ABPVGLOB(0),"^",3)=$P(^ABPVGLOB(0),"^",3)+1
 .S ^ABPVGLOB(ZSITE,0)=^ASMPITMP(ZSITE,0),(R,RC,RCT)=0
 .S TCNT=$P(^ABPVGLOB(ZSITE,0),"^",3),$P(^(0),"^",4)=TCNT*2 K TCNT
 S CDT=$P(^ABPVGLOB(ZSITE,0),"^",1),NDT=$P(^ASMPITMP(ZSITE,0),"^",1)
 I NDT<CDT S $P(^ABPVGLOB(ZSITE,0),"^",1)=NDT
 S CDT=$P(^ABPVGLOB(ZSITE,0),"^",2),NDT=$P(^ASMPITMP(ZSITE,0),"^",2)
 I NDT>CDT S $P(^ABPVGLOB(ZSITE,0),"^",2)=NDT
 S $P(^ABPVGLOB(ZSITE,0),"^",4)=$P(^ASMPITMP(ZSITE,0),"^",4)
 S CDT=$P(^ABPVGLOB(ZSITE,0),"^",6),NDT=$P(^ASMPITMP(ZSITE,0),"^",6)
 I NDT>CDT S $P(^ABPVGLOB(ZSITE,0),"^",2)=NDT
 S R=0,RC=0,RCT=$P(^ABPVGLOB(ZSITE,0),"^",3)
NXTR S R=$O(^ASMPITMP(ZSITE,R)) G TXSUM:+R=0
 S RC=RC+1,RCT=RCT+1,^ABPVGLOB(ZSITE,RCT)=^ASMPITMP(ZSITE,R) G NXTR
TXSUM U IO(0) W !!,?12,"A total of ",(RC/2)," PRIVATE INSURANCE records "
 U IO(0) W "were MERGED.",!?12,"A total of ",RC," nodes were "
 U IO(0) W "processed.",!
 S ^ABPVGLOB("COUNT")=^ABPVGLOB("COUNT")+RC
 S $P(^ABPVGLOB(0),"^",4)=^ABPVGLOB("COUNT")
 S $P(^ABPVGLOB(ZSITE,0),"^",3)=RCT
 D ENDK
 ;
POST F I=0:0 D  Q:+%>0
 .W *7,!!,"SHALL I POST THESE RECORDS NOW"
 .S %=2 D YN^DICN
 I +%=2 Q
CONT G A0^ABPAOP0
 ;
ENDK U IO(0) X ^%ZIS("C")
 K CT,CTFI,CTPD,CTPIG,CTV,CTVS,RC,RTYP,ASITE,TX2,TX3,X2,X3,X,Y,ZTOT
 K ZTYPE,ZSITE,X1,%MT,AUOK,DUOUT,DLOUT,DTOUT,G,I,ZOPT,R,RCT,NDT,EMSG
 Q
 ;
END1 S AUOK=1 U IO(0) W !!,?20,"No PRIVATE INSURANCE Data Transferred",! G ENDK
 ;
TERROR U IO(0) W *7,!!,?10,"An Error has been detected while reading these records.",!!,"Please notify you supervisor.",! Q