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
PXBPCPT1 ;ISL/JVS,ESW - PROMPT CPT ; 5/19/03 4:11pm
+1 ;;1.0;PCE PATIENT CARE ENCOUNTER;**7,73,88,89,108,112**;Aug 12, 1996
+2 ;
+3 ;
+4 ;
+5 ;
+6 ;
ADDM ;--------If Multiple entries have been entered assume quantity 1
+1 ;
+2 ;
+3 NEW OK,PXBLEN,BDATA,PXMDCNT
+4 DO WIN17^PXBCC(PXBCNT)
+5 SET NF=0
SET PXBLEN=0
+6 DO EDITMM
+7 QUIT
+8 IF DATA[","&(DATA'["-")&($LENGTH($PIECE(DATA,",",1))=5)
SET NF=1
Begin DoDot:1
+9 DO HELP1^PXBUTL1("CPTMM")
DO HELP1^PXBUTL1("CON")
+10 READ OK:DTIME
+11 SET PXBLEN=$LENGTH(DATA,",")
FOR PXI=1:1:PXBLEN
SET PXBPIECE=$PIECE(DATA,",",PXI)
Begin DoDot:2
+12 IF $LENGTH($GET(PXBPIECE))'=5
SET BAD($GET(PXBPIECE))=""
QUIT
+13 IF $LENGTH(PXBPIECE)=5
SET X=PXBPIECE
SET DIC=81
SET DIC(0)="Z"
DO ^DIC
+14 IF Y=-1
SET BAD(+$GET(PXBPIECE))=""
QUIT
+15 SET $PIECE(REQI,"^",3)=+Y
SET $PIECE(REQI,"^",4)=1
+16 SET PXBNCPT(PXBPIECE)=""
+17 DO EN0^PXBSTOR(PXBVST,PATIENT,REQI)
+18 DO EN1^PXKMAIN
+19 DO RSET^PXBDREQ("CPT")
End DoDot:2
End DoDot:1
BAD ;----BAD CPT CODES
+1 NEW Y
IF $GET(NF)&($DATA(BAD))
Begin DoDot:1
+2 SET (BDATA,EDATA)=""
+3 FOR
SET BDATA=$ORDER(BAD(BDATA))
IF BDATA=""
QUIT
SET EDATA=EDATA_BDATA_" "
+4 WRITE !
DO HELP^PXBUTL0("CPTM")
WRITE !
+5 SET DIR(0)="E"
DO ^DIR
KILL DIR,DIRUT
+6 IF Y=1
SET DATA="^C"
IF Y=0!(Y="")
SET DATA="^"
End DoDot:1
QUIT
+7 IF $GET(NF)&('$DATA(BAD))
SET DATA="^C"
QUIT
+8 QUIT
+9 ;
BADD(PAR,EDATA) ;----BAD CPT CODES - DISPLAY
+1 IF $GET(NF)&($DATA(BAD))
Begin DoDot:1
+2 WRITE !,*7
DO HELP^PXBUTL0(PAR)
WRITE !
End DoDot:1
QUIT
+3 QUIT
EDITMM ;--ADD MULTIPLE ENTRIES
+1 ;
+2 NEW STOP,BAD,GONE,PXBLEN,PXBPIECE,BDATA,PX,PXI,YY,BAD
+3 SET STOP=0
+4 IF DATA[","
IF DATA'["-"
Begin DoDot:1
+5 SET PXBLEN=$LENGTH(DATA,",")
+6 SET NF=1
+7 FOR PXI=1:1:PXBLEN
SET PXBPIECE=$PIECE(DATA,",",PXI)
IF STOP=1
QUIT
Begin DoDot:2
+8 ;----ADDED
+9 IF PXBPIECE=""
QUIT
+10 IF $DATA(PXBKY(PXBPIECE))
SET BAD(PXBPIECE)=""
SET NF=1
DO BADD("CPTMDP",PXBPIECE)
HANG 2
QUIT
+11 IF PXI>1
IF ","_$PIECE(DATA,",",1,PXI-1)_","[(","_PXBPIECE_",")
WRITE !!,*7,"PROCEDURE "_PXBPIECE_" was already processed."
HANG 1
QUIT
+12 SET X=PXBPIECE
SET DIC=81
SET DIC(0)="ZB"
DO ^DIC
+13 IF Y<1
SET BAD(PXBPIECE)=""
SET NF=1
DO BADD("CPTM",PXBPIECE)
QUIT
+14 SET $PIECE(REQI,U,3)=+Y
+15 SET $PIECE(REQI,U,8)=""
+16 WRITE !!,"For the PROCEDURE: "_X_"--"_$PIECE(Y(0),U,2)
+17 ;--Prompt for CPT Modifiers
+18 DO FULL0^PXBCC
+19 SET PXMDCNT=$$CODM^ICPTCOD($PIECE(REQI,"^",3),"^TMP(""PXMODARR"",$J",PXBSOURC,PXBVSTDT)
+20 KILL ^TMP("PXMODARR",$JOB)
+21 DO MOD^PXBPMOD(PXBVST,PXBPAT,$PIECE(REQI,"^",3),"",$PIECE(REQI,"^",8),IDATE,PXMDCNT,.PXMREQ)
+22 IF EDATA["^C"
SET STOP=1
+23 IF STOP
QUIT
+24 SET CPTQUA=1
+25 DO QUA^PXBPQUA
+26 IF EDATA["^C"
SET STOP=1
IF EDATA["^P"
SET STOP=1
IF STOP=1
QUIT
+27 ;--Get Provider for CPT
+28 NEW PXBSKY,PXBKY,PXBSAM,PXBCNT,PRVDR,FPRI
+29 DO PRV^PXBGPRV(PXBVST,.PXBSKY,.PXBKY,.PXBSAM,.PXBCNT,.PRVDR,.FPRI)
WRITE IOSC
+30 SET FROM="CPT"
Begin DoDot:3
+31 NEW DATA
DO PRV^PXBPPRV
IF DATA["^P"
Begin DoDot:4
+32 SET $PIECE(REQI,"^",1)=""
SET $PIECE(REQI,"^",2)=""
SET $PIECE(REQI,"^",7)=""
+33 KILL PXBDPRV
End DoDot:4
WRITE IOCUU
SET STOP=1
QUIT
End DoDot:3
IF STOP
QUIT
+34 SET PXBNCPT(PXBPIECE)=""
+35 DO EN0^PXBSTOR(PXBVST,PATIENT,REQI,.PXMREQ)
+36 DO EN1^PXKMAIN
+37 DO RSET^PXBDREQ("CPT")
+38 DO RSET^PXBDREQ("PRV")
+39 KILL PXMREQ
+40 SET $PIECE(REQI,"^",7)=""
End DoDot:2
+41 SET DATA="^C"
End DoDot:1
+42 QUIT
+43 ;
DELM ;--------If Multiple deleting
+1 NEW DELM,PXBJ,BAD,PXBPIECE,PXBLEN
+2 SET NF=0
SET PXBLEN=0
SET $PIECE(DELM,"^",2)=1
+3 IF $EXTRACT(DATA,1)="@"
Begin DoDot:1
+4 IF '$$SURE^PXCEAE2
SET DATA="^C"
QUIT
+5 SET DATA=$PIECE(DATA,"@",2)
SET NF=1
+6 SET PXBLEN=$LENGTH(DATA,",")
+7 FOR PXI=1:1:PXBLEN
SET PXBPIECE=$PIECE(DATA,",",PXI)
Begin DoDot:2
+8 IF PXBPIECE'["-"&(PXBPIECE'>0!(PXBPIECE'<(PXBCNT+1)))
SET BAD(+$GET(PXBPIECE))=""
QUIT
+9 IF PXBPIECE'["-"
Begin DoDot:3
+10 IF $DATA(GONE(PXBPIECE))
QUIT
+11 IF PXBPIECE'?.N
QUIT
+12 ;-IEN
SET $PIECE(REQI,"^",8)=$ORDER(PXBSKY(PXBPIECE,0))
+13 SET X=$PIECE(PXBSAM(PXBPIECE),"^",1)
SET DIC=81
SET DIC(0)="ZM"
DO ^DIC
+14 SET $PIECE(REQI,"^",3)=+Y
KILL Y
+15 ;-QUANTITY
SET $PIECE(REQI,"^",4)=0
+16 SET GONE(PXBPIECE)=""
+17 DO EN0^PXBSTOR(PXBVST,PATIENT,REQI)
+18 DO EN1^PXKMAIN
End DoDot:3
+19 IF PXBPIECE["-"
Begin DoDot:3
+20 FOR PXBJ=$PIECE(PXBPIECE,"-",1):1:$PIECE(PXBPIECE,"-",2)
Begin DoDot:4
+21 IF $DATA(GONE(PXBJ))
QUIT
+22 IF PXBJ'>0!(PXBJ'<(PXBCNT+1))
SET BAD(PXBJ)=""
QUIT
+23 ;-IEN
SET $PIECE(REQI,"^",8)=$ORDER(PXBSKY(PXBJ,0))
+24 SET X=$PIECE(PXBSAM(PXBJ),"^",1)
SET DIC=81
SET DIC(0)="ZM"
DO ^DIC
+25 SET $PIECE(REQI,"^",3)=+Y
KILL Y
+26 ;-QUANTITY
SET $PIECE(REQI,"^",4)=0
+27 SET GONE(PXBJ)=""
+28 DO EN0^PXBSTOR(PXBVST,PATIENT,REQI)
+29 DO EN1^PXKMAIN
End DoDot:4
End DoDot:3
End DoDot:2
End DoDot:1
+30 KILL GONE
+31 IF $GET(NF)&($DATA(BAD))
Begin DoDot:1
+32 SET (BDATA,EDATA)=""
+33 FOR
SET BDATA=$ORDER(BAD(BDATA))
IF BDATA=""
QUIT
SET EDATA=EDATA_BDATA_" "
+34 WRITE !
DO HELP^PXBUTL0("CPTMD")
WRITE !
+35 SET DIR(0)="E"
DO ^DIR
KILL DIR
+36 IF Y=1
SET DATA="^C"
IF Y=0!(Y="")
SET DATA="^"
KILL Y
End DoDot:1
QUIT
+37 IF $GET(NF)&('$DATA(BAD))
SET DATA="^C"
QUIT
+38 QUIT