source: WorldVistAEHR/trunk/r/PCE_PATIENT_CARE_ENCOUNTER-AUTN-EFDP-PX-VSIT--PXRM/PXBUTL3.m@ 1000

Last change on this file since 1000 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 1.3 KB
Line 
1PXBUTL3 ;ISL/JVS - CLEAN UP CPT CODES ;5/21/96 12:15
2 ;;1.0;PCE PATIENT CARE ENCOUNTER;**73**;Aug 12, 1996
3 ;
4KILL ;
5 N TEST,CPT,IEN,KILL,PRV,QUA,REQI,TESTIEN
6 ;
7 I $D(^AUPNVCPT("AD",PXBVST)) D
8 .S IEN=0
9 .F S IEN=$O(^AUPNVCPT("AD",PXBVST,IEN)) Q:IEN'>0 D
10 ..S ^TMP("PXBU",$J,"CPT",IEN)=""
11 ..S PRV=+$P($G(^AUPNVCPT(IEN,12)),"^",4)
12 ..S CPT=$P(^AUPNVCPT(IEN,0),"^",1)
13 ..S QUA=$P(^AUPNVCPT(IEN,0),"^",16)
14 ..I $D(TEST(PRV,CPT,IEN)) D
15 ...S TESTIEN=$O(TEST(PRV,CPT,0))
16 ...S QUA=QUA+$G(TEST(PRV,CPT,TESTIEN))
17 ...S KILL(IEN)=""
18 ...S TEST(PRV,CPT,TESTIEN)=QUA
19 ..I '$D(TEST(PRV,CPT,IEN)) D
20 ...S TEST(+$P($G(^AUPNVCPT(IEN,12)),"^",4),$P(^AUPNVCPT(IEN,0),"^",1),IEN)=$P(^AUPNVCPT(IEN,0),"^",16)
21 I '$D(KILL) Q
22 S PRV="",REQI=""
23 F S PRV=$O(TEST(PRV)) Q:PRV="" D
24 .S CPT=""
25 .F S CPT=$O(TEST(PRV,CPT)) Q:CPT="" D
26 ..S IEN=""
27 ..F S IEN=$O(TEST(PRV,CPT,IEN)) Q:IEN="" D
28 ...S $P(REQI,"^",8)=IEN
29 ...S $P(REQI,"^",3)=CPT
30 ...I PRV>0 S $P(REQI,"^",1)=PRV
31 ...S $P(REQI,"^",4)=$G(TEST(PRV,CPT,IEN))
32 ...D EN0^PXBSTOR(PXBVST,PATIENT,REQI)
33 ...D EN1^PXKMAIN
34 I $D(KILL) D
35 .S IEN=""
36 .F S IEN=$O(KILL(IEN)) Q:IEN="" D
37 ..S $P(REQI,"^",8)=IEN
38 ..S $P(REQI,"^",4)=0
39 ..S $P(REQI,"^",3)=$P(^AUPNVCPT(IEN,0),"^",1)
40 ..D EN0^PXBSTOR(PXBVST,PATIENT,REQI)
41 ..D EN1^PXKMAIN
42EXIT ;--EXIT
43 K ^TMP("PXBU",$J)
Note: See TracBrowser for help on using the repository browser.