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

PXBPCPT1.m

Go to the documentation of this file.
PXBPCPT1 ;ISL/JVS,ESW - PROMPT CPT ; 5/19/03 4:11pm
 ;;1.0;PCE PATIENT CARE ENCOUNTER;**7,73,88,89,108,112**;Aug 12, 1996
 ;
 ;
 ;
 ;
 ;
ADDM ;--------If Multiple entries have been entered assume quantity 1
 ;
 ;
 N OK,PXBLEN,BDATA,PXMDCNT
 D WIN17^PXBCC(PXBCNT)
 S NF=0,PXBLEN=0
 D EDITMM
 Q
 I DATA[","&(DATA'["-")&($L($P(DATA,",",1))=5) S NF=1 D
 .D HELP1^PXBUTL1("CPTMM"),HELP1^PXBUTL1("CON")
 .R OK:DTIME
 .S PXBLEN=$L(DATA,",") F PXI=1:1:PXBLEN S PXBPIECE=$P(DATA,",",PXI) D
 ..I $L($G(PXBPIECE))'=5 S BAD($G(PXBPIECE))="" Q
 ..I $L(PXBPIECE)=5 S X=PXBPIECE,DIC=81,DIC(0)="Z" D ^DIC
 ..I Y=-1 S BAD(+$G(PXBPIECE))="" Q
 ..S $P(REQI,"^",3)=+Y,$P(REQI,"^",4)=1
 ..S PXBNCPT(PXBPIECE)=""
 ..D EN0^PXBSTOR(PXBVST,PATIENT,REQI)
 ..D EN1^PXKMAIN
 ..D RSET^PXBDREQ("CPT")
BAD ;----BAD CPT CODES
 N Y I $G(NF)&($D(BAD)) D  Q
 .S (BDATA,EDATA)=""
 .F  S BDATA=$O(BAD(BDATA)) Q:BDATA=""  S EDATA=EDATA_BDATA_"  "
 .W ! D HELP^PXBUTL0("CPTM") W !
 .S DIR(0)="E" D ^DIR K DIR,DIRUT
 .S:Y=1 DATA="^C" S:Y=0!(Y="") DATA="^"
 I $G(NF)&('$D(BAD)) S DATA="^C" Q
 Q
 ;
BADD(PAR,EDATA) ;----BAD CPT CODES - DISPLAY
 I $G(NF)&($D(BAD)) D  Q
 .W !,*7 D HELP^PXBUTL0(PAR) W !
 Q
EDITMM ;--ADD MULTIPLE ENTRIES
 ;
 N STOP,BAD,GONE,PXBLEN,PXBPIECE,BDATA,PX,PXI,YY,BAD
 S STOP=0
 I DATA[",",DATA'["-" D
 .S PXBLEN=$L(DATA,",")
 .S NF=1
 .F PXI=1:1:PXBLEN S PXBPIECE=$P(DATA,",",PXI) Q:STOP=1  D
 ..;----ADDED
 ..I PXBPIECE="" Q
 ..I $D(PXBKY(PXBPIECE)) S BAD(PXBPIECE)="" S NF=1 D BADD("CPTMDP",PXBPIECE) H 2 Q
 ..I PXI>1 I ","_$P(DATA,",",1,PXI-1)_","[(","_PXBPIECE_",") W !!,*7,"PROCEDURE "_PXBPIECE_" was already processed." H 1 Q
 ..S X=PXBPIECE,DIC=81,DIC(0)="ZB" D ^DIC
 ..I Y<1 S BAD(PXBPIECE)="" S NF=1 D BADD("CPTM",PXBPIECE) Q
 ..S $P(REQI,U,3)=+Y
 ..S $P(REQI,U,8)=""
 ..W !!,"For the PROCEDURE: "_X_"--"_$P(Y(0),U,2)
 ..;--Prompt for CPT Modifiers
 ..D FULL0^PXBCC
 ..S PXMDCNT=$$CODM^ICPTCOD($P(REQI,"^",3),"^TMP(""PXMODARR"",$J",PXBSOURC,PXBVSTDT)
 ..K ^TMP("PXMODARR",$J)
 ..D MOD^PXBPMOD(PXBVST,PXBPAT,$P(REQI,"^",3),"",$P(REQI,"^",8),IDATE,PXMDCNT,.PXMREQ)
 ..S:EDATA["^C" STOP=1
 ..Q:STOP
 ..S CPTQUA=1
 ..D QUA^PXBPQUA
 ..S:EDATA["^C" STOP=1 S:EDATA["^P" STOP=1 Q:STOP=1
 ..;--Get Provider for CPT
 ..N PXBSKY,PXBKY,PXBSAM,PXBCNT,PRVDR,FPRI
 ..D PRV^PXBGPRV(PXBVST,.PXBSKY,.PXBKY,.PXBSAM,.PXBCNT,.PRVDR,.FPRI) W IOSC
 ..S FROM="CPT" D  Q:STOP
 ...N DATA D PRV^PXBPPRV I DATA["^P" D  W IOCUU S STOP=1 Q
 ....S $P(REQI,"^",1)="",$P(REQI,"^",2)="",$P(REQI,"^",7)=""
 ....K PXBDPRV
 ..S PXBNCPT(PXBPIECE)=""
 ..D EN0^PXBSTOR(PXBVST,PATIENT,REQI,.PXMREQ)
 ..D EN1^PXKMAIN
 ..D RSET^PXBDREQ("CPT")
 ..D RSET^PXBDREQ("PRV")
 ..K PXMREQ
 ..S $P(REQI,"^",7)=""
 .S DATA="^C"
 Q
 ;
DELM ;--------If Multiple deleting
 N DELM,PXBJ,BAD,PXBPIECE,PXBLEN
 S NF=0,PXBLEN=0 S $P(DELM,"^",2)=1
 I $E(DATA,1)="@" D
 .I '$$SURE^PXCEAE2 S DATA="^C" Q
 .S DATA=$P(DATA,"@",2),NF=1
 .S PXBLEN=$L(DATA,",")
 .F PXI=1:1:PXBLEN S PXBPIECE=$P(DATA,",",PXI) D
 ..I PXBPIECE'["-"&(PXBPIECE'>0!(PXBPIECE'<(PXBCNT+1))) S BAD(+$G(PXBPIECE))="" Q
 ..I PXBPIECE'["-" D
 ...I $D(GONE(PXBPIECE)) Q
 ...Q:PXBPIECE'?.N
 ...S $P(REQI,"^",8)=$O(PXBSKY(PXBPIECE,0)) ;-IEN
 ...S X=$P(PXBSAM(PXBPIECE),"^",1),DIC=81,DIC(0)="ZM" D ^DIC
 ...S $P(REQI,"^",3)=+Y K Y
 ...S $P(REQI,"^",4)=0 ;-QUANTITY
 ...S GONE(PXBPIECE)=""
 ...D EN0^PXBSTOR(PXBVST,PATIENT,REQI)
 ...D EN1^PXKMAIN
 ..I PXBPIECE["-" D
 ...F PXBJ=$P(PXBPIECE,"-",1):1:$P(PXBPIECE,"-",2) D
 ....I $D(GONE(PXBJ)) Q
 ....I PXBJ'>0!(PXBJ'<(PXBCNT+1)) S BAD(PXBJ)="" Q
 ....S $P(REQI,"^",8)=$O(PXBSKY(PXBJ,0)) ;-IEN
 ....S X=$P(PXBSAM(PXBJ),"^",1),DIC=81,DIC(0)="ZM" D ^DIC
 ....S $P(REQI,"^",3)=+Y K Y
 ....S $P(REQI,"^",4)=0 ;-QUANTITY
 ....S GONE(PXBJ)=""
 ....D EN0^PXBSTOR(PXBVST,PATIENT,REQI)
 ....D EN1^PXKMAIN
 K GONE
 I $G(NF)&($D(BAD)) D  Q
 .S (BDATA,EDATA)=""
 .F  S BDATA=$O(BAD(BDATA)) Q:BDATA=""  S EDATA=EDATA_BDATA_"  "
 .W ! D HELP^PXBUTL0("CPTMD") W !
 .S DIR(0)="E" D ^DIR K DIR
 .S:Y=1 DATA="^C" S:Y=0!(Y="") DATA="^" K Y
 I $G(NF)&('$D(BAD)) S DATA="^C" Q
 Q