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

ABPAOP0.m

Go to the documentation of this file.
ABPAOP0 ;POST FACILITY DATA TO AREA DATABASE;[ 05/28/91  4:27 PM ]
 ;;1.4;AO PVT-INS TRACKING;*0*;IHS-OKC/KJR;JULY 25, 1991
A0 K ABPA("HD") D:$D(ABPATLE)'=1 ^ABPAVAR S ABPA("HD",1)=ABPATLE
 S ABPA("HD",2)="POST FACILITY DATA TO AREA DATABASE" D ^ABPAHD W !!
A0A L (^ABPVAO,^AUTNINS,^ABPAMLBL,^ABPAPOST):1
 I '$T D  H 3 L  G XIT^ABPAOP4
 .W *7,!!,?7,"Unable to Gain Exclusive control of necessary files."
 .W !,?25,"THIS JOB HAS BEEN TERMINATED"
A0B S %ZIS("A")="Select Output device for the POSTING LOG: ",%IS="NP"
 D ^%ZIS I +IO=0 D  G XIT^ABPAOP4
 .W !!?10,*7,"<<< INVALID DEVICE SELECTION - JOB ABORTED >>>" H 3
 S ABPA("IO")=+IO D CURRENT^%ZIS
A1 S (R,RCT,RR)=0,ZPCNT=0,ZVCNT=0,ZCCNT=0 D WAIT^ABPAOP4,DT^DICRW
 S R="",PGNO=0,LOC=0 K ABPAMLBL
 K DIK,DA S DIK="^ABPAPOST(",DA=1 D ^DIK
A5 S LOC=$O(^ABPVGLOB(LOC)) I +LOC=0 D ZEND^ABPAOP4 G A1^ABPAOP5
 S R="",NPCNT=0,NVCNT=0,NCCNT=0
A7 S R=$O(^ABPVGLOB(LOC,R)) G AZEND^ABPAOP4:R=""
 S XX=^ABPVGLOB(LOC,R) I R>0 I $P(XX,"^")'="ABP1" G A7
 ;I R>0 I $P(XX,"^",22)'="P" G A7
 I R>0 G A9
 S FACNAME=$P(XX,"^",5)
 I '$D(^ABPVGLOB(LOC,0)) D  G XIT^ABPAOP4
 .W !!,*7,"ZEROTH NODE NOT DEFINED FOR ",FACNAME," -- POSTING ABORTED"
 S XX=^ABPVGLOB(LOC,0)
A9 S X=$S(R>0:$P(XX,"^",3),1:LOC),DIC="^AUTTLOC(",DIC(0)="",D="C"
 D IX^DIC I +Y<0 S D="CTOO" D IX^DIC
 I +Y<0 D  G XIT^ABPAOP4
 .W !!,*7,"FACILITY CODE LOOKUP ERROR ON CODE ",X
 .W " -- POSTING ABORTED"
 S LOCCD=+Y I R'>0 D  G A7
A9A .I $D(^ABPAPOST(1,0))'=1 D
 ..S ^ABPAPOST(1,0)=DT,ABPAPOST("B",DT,1)=""
 ..S $P(^ABPAPOST(0),"^",3)=1
 ..S $P(^ABPAPOST(0),"^",4)=1
A9F .I $D(^ABPAPOST(1,"F",0))'=1 D
 ..S ^ABPAPOST(1,"F",0)="^9002270.61PA^^0"
 .I $D(^ABPAPOST(1,"F",LOCCD,0))'=1 D
 ..S DATA=LOCCD_U_$P(XX,U,6)_U_$P(XX,U)_U_$P(XX,U,2)_U_U_U
 ..S DATA=DATA_($P(XX,U,3)/2)
 ..S ^ABPAPOST(1,"F",LOCCD,0)=DATA
 ..S ^ABPAPOST(1,"F","B",LOCCD,LOCCD)=""
 ..S $P(^ABPAPOST(1,"F",0),"^",3)=LOCCD
 ..S $P(^ABPAPOST(1,"F",0),"^",4)=$P(^ABPAPOST(1,"F",0),"^",4)+1
A10 I $D(^ABPVAO("CN",$P(XX,"^",20),LOCCD))=10 D  G A7
 .W !,?10,"BILL ID ",$J($P(XX,"^",20),8)," ALREADY POSTED"
 ;
CONT G A11^ABPAOP1