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

PXBMCPT2.m

Go to the documentation of this file.
PXBMCPT2 ;ISL/JVS,ESW - MAIN ROUTINE CPT CODES ; 12/5/02 11:37am
 ;;1.0;PCE PATIENT CARE ENCOUNTER;**11,73,88,89,108**;Aug 12, 1996
 ;
 W !,"This is not the entry into this routine" Q
 ;
 ;  VARABLE LIST
 ;
 ;
CPT(PXBVST) ;---Real entry point
 Q:'$D(^AUPNVSIT(PXBVST))
 S TEST=1
 ; PXBVST  = Appointment-Encounter Visit IEN
 ; PXBDPRV = Default Provider for clinic appointment IEN
 ;--Set up
 N PXBCNT,I,J,IDATE,PRIP,PRIPOV,PRISEC,QUA,VISIT,PRI,POV,PRV,PXBENT,SAVE
 N PXBUT,FPRI,ENTRY,PXBSAVE,NAME,VAR,DOUBLEQQ,CPTQUA,PXBPRV,ERROR
 N REQI,REQE,DEL,COM,FROM,NOREV
 N DATA,PROMPT,FIRSTCPT,KFIRST,FROM,IDATE,%,CYCL
 N PXBNCPT,PXBNPRV,PXBNPOV,FIRST,PXBWIN,CLINIC
 N PXBPMT,LEAVE,PATIENT,PXMODSTR,PXMDCNT,PXNEWIEN,PXMREQ,PXTLNS
 S (REQE,REQI)=""
 S CLINIC=$P(^AUPNVSIT(PXBVST,0),"^",22),PROMPT="CPT"
 ;--KILL OF THE TMP GLOGALS IN ALL PROMPTS
 S ^TMP("PXBDCPT",$J,"START")=0,FIRST=1,FIRSTCPT=1,PXBEXIT=1
 ;
TEST3 ;---THIRD SERERIO FOR PROMPTING FOR CPT'S
 I $G(DOUBLEQQ) S FIRST=1
 D TERM^PXBCC
TEST3C ;--Display the CPT codes
 D HEADER
 ;---ADDED 11/4/96
 D RSET^PXBDREQ("PRV")
 ;------END--------
R2 K ERROR,PXMODSTR
 S (PXNEWIEN,PXMREQ)=""
 D CPT^PXBPCPT G:$G(PXBEXIT)<1 CPTXIT G:$G(ERROR) R2 W IOEDEOP
 I DATA["^C" D RSET^PXBDREQ("CPT") K PXMREQ G TEST3C
 I DATA=""!(DATA["^") D RSET^PXBDREQ("CPT") K DIRUT,PXBUT,PXMREQ G CPTXIT
 ;
 ;--Display the requested CPT code
 D PRINT^PXBDREQ(2)
 ;
 ;--Prompt for CPT Modifiers
 D FULL0^PXBCC
 S PXNEWIEN=""
 S PXMDCNT=$$CODM^ICPTCOD($P(REQI,"^",3),"^TMP(""PXMODARR"",$J",PXBSOURC,PXBVSTDT)
 K ^TMP("PXMODARR",$J)
 D MOD^PXBPMOD(PXBVST,PXBPAT,$P(REQI,"^",3),$G(PXMODSTR),$P(REQI,"^",8),IDATE,PXMDCNT,.PXMREQ)
 I DATA["^C" D RSET^PXBDREQ("CPT") K PXMREQ G TEST3
 I PXNEWIEN]"" S PXBNCPT($P(REQI,"^",3),PXNEWIEN)=""
 ;
TEST3Q ;--Prompt of the QUANTITY of the CPT code
 S DEL=0
 D WIN17^PXBCC(PXBCNT)
 D QUA^PXBPQUA S PROMPT="CPT"
 I EDATA["^C" D  G TEST3
 .I PXNEWIEN]"" D REMOVE^PXCEVFIL(PXNEWIEN)
 .D RSET^PXBDREQ("CPT") K PXMREQ
 ;
 ;--Create The ^TMP("PXK", ARRAY
 S COM="0@" I COM[$P(REQI,"^",4) D
 .D EN0^PXBSTOR(PXBVST,PATIENT,REQI,.PXMREQ)
 .D EN1^PXKMAIN
 .S DEL=1
 ;--File the data into the V files
 I $G(DEL)=1 D  G TEST3C
 .I PXNEWIEN]"" D REMOVE^PXCEVFIL(PXNEWIEN)
 ;
TEST3P ;--GET PROVIDER
 N PXBSKY,PXBKY,PXBSAM,PXBCNT,PRVDR,FPRI ;108
 D PRV^PXBGPRV(PXBVST,.PXBSKY,.PXBKY,.PXBSAM,.PXBCNT,.PRVDR,.FPRI) W IOSC
 S FROM="CPT" D PRV^PXBPPRV I DATA["^P" D  W IOCUU G TEST3P
 .S $P(REQI,"^",1)="",$P(REQI,"^",2)="",$P(REQI,"^",7)=""
 .K PXBDPRV
 D EN0^PXBSTOR(PXBVST,PATIENT,REQI,.PXMREQ)
 D EN1^PXKMAIN
 D RSET^PXBDREQ("CPT") ;--RSET^PXBDREQ("PRV")
 K PXMREQ
 S $P(REQI,"^",7)=""
 G TEST3C
 ;
 Q
P ;--Obtain the correct provider
 ;
 Q
 D HDR^PXBUTL(PXBVST,1)
 D REQ^PXBDREQ(4)
 D LOC^PXBCC(3,1)
 W IOEDEOP
 D CPT^PXBGCPT(PXBVST)
 D EN0^PXBDCPT
 D WIN17^PXBCC(PXBCNT)
 D LOC^PXBCC(15,1)
 Q
CPTXIT ;----EXIT AND CLEAN UP
 D KILL^PXBUTL3
 D PRIM^PXBUTL
 D FULL0^PXBCC
 D CLEAR1^PXBCC
 K PXBKY,PXBSAM,PXBSKY,PXKVST
 ;
 ;----Do the EVENT to the Protocol
 ;D EVENT^PXKMAIN
 K ^TMP("PXBDCPT",$J),^TMP("PXBSTOR",$J),^TMP("PXK",$J)
 K ^TMP("PXBTOTAL",$J),^TMP("PXBTANA",$J)
 Q