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

ABPAOP3.m

Go to the documentation of this file.
ABPAOP3 ;POST FACILITY DATA TO AREA DATABASE;[ 05/31/91  4:23 PM ]
 ;;1.4;AO PVT-INS TRACKING;*0*;IHS-OKC/KJR;JULY 25, 1991
A0 W !,"NOT AN ENTRY POINT" Q
A16 ;ESTABLISH NEW PATIENT FOR PI
 S P3=$P(^ABPVAO(0),"^",3)
 F I=P3:1 S ABPVDFN=I Q:$D(^ABPVAO(I))=0
 S $P(^ABPVAO(0),"^",3)=ABPVDFN
 S $P(^ABPVAO(0),"^",4)=$P(^ABPVAO(0),"^",4)+1
 S ^ABPVAO(ABPVDFN,0)=NAME_"^"_FACDFN_"^"_HRN
 S ^ABPVAO("D",HRN,ABPVDFN)=""
 S ^ABPVAO("G",FACDFN,HRN,ABPVDFN)=""
 S ^ABPVAO("B",NAME,ABPVDFN)=""
 S ^ABPVAO(ABPVDFN,1,0)="^9002270.21DI^0^0"
 S NPCNT=NPCNT+1,ZPCNT=ZPCNT+1 I ZPCNT#20=0 D UPDATE^ABPAOP4
A16A I $D(^ABPAPOST(1,"F",LOCCD,"P",0))'=1 D
 .S ^ABPAPOST(1,"F",LOCCD,"P",0)="^9002270.612PA^^0"
 I $D(^ABPAPOST(1,"F",LOCCD,"P",ABPVDFN,0))'=1 D
 .S ^ABPAPOST(1,"F",LOCCD,"P",ABPVDFN,0)=ABPVDFN
 .S ^ABPAPOST(1,"F",LOCCD,"P","B",ABPVDFN,ABPVDFN)=""
 .S $P(^ABPAPOST(1,"F",LOCCD,"P",0),"^",3)=ABPVDFN
 .S NEWVAL=+$P(^ABPAPOST(1,"F",LOCCD,"P",0),"^",4)+1
 .S $P(^ABPAPOST(1,"F",LOCCD,"P",0),"^",4)=NEWVAL
A17 ;ESTABLISH NEW CLAIM RECORD FOR PATIENT
 S P3=$P(^ABPVAO(ABPVDFN,1,0),"^",3)
 F I=P3:1 S ABPV2DFN=I Q:'$D(^ABPVAO(ABPVDFN,1,I))
 S $P(^ABPVAO(ABPVDFN,1,0),"^",3)=ABPV2DFN
 S $P(^ABPVAO(ABPVDFN,1,0),"^",4)=$P(^ABPVAO(ABPVDFN,1,0),"^",4)+1
A18 S $P(^ABPVAO(ABPVDFN,1,ABPV2DFN,0),"^",1)=$P(XX,"^",5)
 S $P(^ABPVAO(ABPVDFN,1,ABPV2DFN,0),"^",8)=$P(XX,"^",11)
 S $P(^ABPVAO(ABPVDFN,1,ABPV2DFN,0),"^",9)=$P(XX,"^",12)
 S $P(^ABPVAO(ABPVDFN,1,ABPV2DFN,0),"^",2)=$P(XX,"^",20)
 S $P(^ABPVAO(ABPVDFN,1,ABPV2DFN,0),"^",12)=$P(XX,"^",21)
 S ^ABPVAO("AC",$P(XX,"^",21),ABPVDFN,ABPV2DFN)=""
 I $P(XX,"^",23)]"" D
 .S $P(^ABPVAO(ABPVDFN,0),"^",4)=$P(XX,"^",23)
 .S ^ABPVAO("F",$P(XX,"^",23),ABPVDFN)=""
 S $P(^ABPVAO(ABPVDFN,1,ABPV2DFN,0),"^",6)=INSDFN
 F I=1:1:2 S $P(^ABPVAO(ABPVDFN,1,ABPV2DFN,0),"^",I+3)=$P(XX,"^",I+5)
 S $P(^ABPVAO(ABPVDFN,1,ABPV2DFN,0),"^",7)=$P(XX,"^",8)
 S $P(^ABPVAO(ABPVDFN,1,ABPV2DFN,0),"^",11)=$P(XX,"^",10)
 S ^ABPVAO("H",$P(XX,"^",10),ABPVDFN,ABPV2DFN)=""
 S $P(^ABPVAO(ABPVDFN,1,ABPV2DFN,0),"^",17)="O"
 S ^ABPVAO("CS","O",ABPVDFN,ABPV2DFN)=""
 S DOS=$P(^ABPVAO(ABPVDFN,1,ABPV2DFN,0),"^",1) I DOS>0 D
 .S ^ABPVAO("C",DOS,ABPVDFN,ABPV2DFN)=""
 .S ^ABPVAO("PC",ABPVDFN,DOS,ABPV2DFN)=""
 S ^ABPVAO("CN",$P(XX,"^",20),FACDFN,ABPVDFN,ABPV2DFN)=""
 S ^ABPVAO("I",$P(XX,"^",20),ABPVDFN,ABPV2DFN)=""
 S NCCNT=NCCNT+1,ZCCNT=ZCCNT+1 I ZCCNT#20=0 D UPDATE^ABPAOP4
 G A7^ABPAOP0