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

PXBUTL3.m

Go to the documentation of this file.
PXBUTL3 ;ISL/JVS - CLEAN UP CPT CODES ;5/21/96  12:15
 ;;1.0;PCE PATIENT CARE ENCOUNTER;**73**;Aug 12, 1996
 ;
KILL ;
 N TEST,CPT,IEN,KILL,PRV,QUA,REQI,TESTIEN
 ;
 I $D(^AUPNVCPT("AD",PXBVST)) D
 .S IEN=0
 .F  S IEN=$O(^AUPNVCPT("AD",PXBVST,IEN)) Q:IEN'>0  D
 ..S ^TMP("PXBU",$J,"CPT",IEN)=""
 ..S PRV=+$P($G(^AUPNVCPT(IEN,12)),"^",4)
 ..S CPT=$P(^AUPNVCPT(IEN,0),"^",1)
 ..S QUA=$P(^AUPNVCPT(IEN,0),"^",16)
 ..I $D(TEST(PRV,CPT,IEN)) D
 ...S TESTIEN=$O(TEST(PRV,CPT,0))
 ...S QUA=QUA+$G(TEST(PRV,CPT,TESTIEN))
 ...S KILL(IEN)=""
 ...S TEST(PRV,CPT,TESTIEN)=QUA
 ..I '$D(TEST(PRV,CPT,IEN)) D
 ...S TEST(+$P($G(^AUPNVCPT(IEN,12)),"^",4),$P(^AUPNVCPT(IEN,0),"^",1),IEN)=$P(^AUPNVCPT(IEN,0),"^",16)
 I '$D(KILL) Q
 S PRV="",REQI=""
 F  S PRV=$O(TEST(PRV)) Q:PRV=""  D
 .S CPT=""
 .F  S CPT=$O(TEST(PRV,CPT)) Q:CPT=""  D
 ..S IEN=""
 ..F  S IEN=$O(TEST(PRV,CPT,IEN)) Q:IEN=""  D
 ...S $P(REQI,"^",8)=IEN
 ...S $P(REQI,"^",3)=CPT
 ...I PRV>0 S $P(REQI,"^",1)=PRV
 ...S $P(REQI,"^",4)=$G(TEST(PRV,CPT,IEN))
 ...D EN0^PXBSTOR(PXBVST,PATIENT,REQI)
 ...D EN1^PXKMAIN
 I $D(KILL) D
 .S IEN=""
 .F  S IEN=$O(KILL(IEN)) Q:IEN=""  D
 ..S $P(REQI,"^",8)=IEN
 ..S $P(REQI,"^",4)=0
 ..S $P(REQI,"^",3)=$P(^AUPNVCPT(IEN,0),"^",1)
 ..D EN0^PXBSTOR(PXBVST,PATIENT,REQI)
 ..D EN1^PXKMAIN
EXIT ;--EXIT
 K ^TMP("PXBU",$J)