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

PXBGCPT.m

Go to the documentation of this file.
PXBGCPT ;ISL/JVS - GATHER CPT ;7/16/96  11:41
 ;;1.0;PCE PATIENT CARE ENCOUNTER;**73**;Aug 12, 1996
 ;
CPT(VISIT) ;--Gather the entries in the V CPT file
 ;
 N IEN,QUANTITY,PROVIDER,NARR,CPT,GROUP,PXBC
 N DIC,DR,DA,DIQ
 N PXSFIL,PXSIEN,PXMOD
 ;
 K ^TMP("PXBU",$J),VAUGHN,CPT,PXBKY,PXBSAM,PXBSKY,PXBPRV
 I $D(^AUPNVCPT("AD",VISIT)) D
 .S IEN=0
 .F  S IEN=$O(^AUPNVCPT("AD",VISIT,IEN)) Q:IEN'>0  D
 ..S ^TMP("PXBU",$J,"CPT",IEN)=""
 ;
A ;--Set array with CPT codes and associated modifiers
 ;
 I $D(^TMP("PXBU",$J,"CPT")) D
 .S IEN=0
 .F  S IEN=$O(^TMP("PXBU",$J,"CPT",IEN)) Q:IEN'>0  D
 ..N VAUGHN
 ..D GETS^DIQ(9000010.18,IEN,".01;.16;1204;.04;1*","E","VAUGHN")
 ..S CPT=$G(VAUGHN(9000010.18,IEN_",",".01","E"))
 ..S QUANTITY=$G(VAUGHN(9000010.18,IEN_",",".16","E"))
 ..S PROVIDER=$G(VAUGHN(9000010.18,IEN_",","1204","E"))
 ..S NARR=$E($G(VAUGHN(9000010.18,IEN_",",".04","E")),1,29)
 ..I NARR="" S NARR=$$GET1^DIQ(81,CPT,2)
 ..D CASE^PXBUTL
 ..S GROUP=CPT_"^"_QUANTITY_"^"_PROVIDER_"^"_NARR
 ..S CPT(CPT,IEN)=GROUP
 ..S PXSFIL=9000010.181
 ..S PXSIEN=""
 ..F  S PXSIEN=$O(VAUGHN(PXSFIL,PXSIEN)) Q:PXSIEN=""  D
 ...S PXMOD=VAUGHN(PXSFIL,PXSIEN,.01,"E")
 ...S CPT(CPT,IEN,"MOD",+PXSIEN)=PXMOD
 ;
B ;--Add line numbers
 ;
 I $D(CPT) D
 .S PXBC=0,CPT=""
 .F  S CPT=$O(CPT(CPT)) Q:CPT=""  D
 ..S IEN=0
 ..F  S IEN=$O(CPT(CPT,IEN)) Q:IEN=""  S PXBC=PXBC+1 D
 ...S PXBKY(CPT,PXBC)=$G(CPT(CPT,IEN))
 ...S PXBSAM(PXBC)=$G(CPT(CPT,IEN))
 ...S PXBSKY(PXBC,IEN)=""
 ...S PXSIEN=0
 ...F  S PXSIEN=$O(CPT(CPT,IEN,"MOD",PXSIEN)) Q:PXSIEN=""  D
 ....S PXBKY(CPT,PXBC,"MOD",PXSIEN)=CPT(CPT,IEN,"MOD",PXSIEN)
 ....S PXBSAM(PXBC,"MOD",PXSIEN)=CPT(CPT,IEN,"MOD",PXSIEN)
 ...I $P($G(CPT(CPT,IEN)),"^",3)]"" D
 ....S PXBPRV($P($G(CPT(CPT,IEN)),"^",3),$P($G(CPT(CPT,IEN)),"^",1),IEN,PXBC)=QUANTITY
EXIT ;--KILL
 K ^TMP("PXBU",$J),VAUGHN
 S PXBCNT=+$G(PXBC)
 Q
 ;