PXCPTAPI ;ALB/EW - PCE CPT CODE API ; 9/3/99
;;1.0;PCE PATIENT CARE ENCOUNTER;**73**;Aug 12, 1996
GETCODE(PXDFLT,PXCPTDT) ;Read in CPT Code
;
; INPUT: PXDFLT - Default CPT code
; PXCPTDT - Visit date
;
; OUTPUT: CPT CODE - Modifier string
;
;
PROMPT N DIR,DIRUT,DUOUT,DTOUT,PXDATA,X,Y
S DIR(0)="FAO^^K:'$$VALCPT^PXCPTAPI(X,PXCPTDT,.PXDATA) X"
S DIR("A")="CPT Code: "
S DIR("?")="^D CPTHLP^PXCPTAPI"
S DIR("??")="^S X=$$VALCPT^PXCPTAPI(.X,PXCPTDT,.PXDATA)"
S:PXDFLT]"" DIR("B")=PXDFLT
D ^DIR
I $D(DIRUT),X="@" Q X
I $D(DIRUT)!($D(DUOUT))!($D(DTOUT))!(Y="") Q -1
I PXDATA<0 D CPTHLP^PXCPTAPI G PROMPT
Q PXDATA
;
;
VALCPT(PXTEXT,PXCPTDT,PXVAL) ;
;Validate freetext responce entered for CPT Code question
;Input: PXTEXT - CPT Code or CPT Code and CPT Modifier Code
; format: CPT or CPT-MOD,MOD,...
; where CPT = valid CPT Code
; MOD = valid Modifier Code
; PXCPTDT - visit date
;
;
;
;Output: 1 - Valid
; 0 - Invalid
;
N DIC,X,Y
S X=$P(PXTEXT,"-")
S DIC=81
S DIC(0)="EMQ"
S DIC("S")="I $$CPTSCREN^PXBUTL(Y,PXCPTDT)"
D ^DIC
S PXVAL=Y_$S($P(PXTEXT,"-",2)]"":"-"_$P(PXTEXT,"-",2),1:"")
Q Y
;
CPTMOD(PXIEN,PXMOD,PXHELP) ;Validate selected modifier
;
; INPUT: PXIEN - IEN for CPT code in V CPT file
; PXMOD - IEN for CPT modifier
; PXHELP - Flag to determing if help text should display
; when an invalid modifier is entered.
; where 1 = Display help text
; 0 = Do not display help text
;
N PXVST,PXVSTDT,PXSTAT
S PXCPT=$P(^AUPNVCPT(PXIEN,0),U)
S PXVST=$P(^AUPNVCPT(PXIEN,0),U,3)
S PXVSTDT=$P($G(^AUPNVSIT(PXVST,0)),U)
S PXSTAT=$$MODP^ICPTMOD(PXCPT,PXMOD,"I",PXVSTDT)
D:PXSTAT'>0 MODHLP
Q PXSTAT
;
CPTHLP ;CPT code help text display
;
W !,"Enter CPT code or partial name for lookup."
Q
MODHLP ;CPT modifier help text display
;
Q:'$G(PXHELP)
W !,"You can only enter a modifier that is valid for the selected CPT code."
Q
PXCPTAPI ;ALB/EW - PCE CPT CODE API ; 9/3/99
+1 ;;1.0;PCE PATIENT CARE ENCOUNTER;**73**;Aug 12, 1996
GETCODE(PXDFLT,PXCPTDT) ;Read in CPT Code
+1 ;
+2 ; INPUT: PXDFLT - Default CPT code
+3 ; PXCPTDT - Visit date
+4 ;
+5 ; OUTPUT: CPT CODE - Modifier string
+6 ;
+7 ;
PROMPT NEW DIR,DIRUT,DUOUT,DTOUT,PXDATA,X,Y
+1 SET DIR(0)="FAO^^K:'$$VALCPT^PXCPTAPI(X,PXCPTDT,.PXDATA) X"
+2 SET DIR("A")="CPT Code: "
+3 SET DIR("?")="^D CPTHLP^PXCPTAPI"
+4 SET DIR("??")="^S X=$$VALCPT^PXCPTAPI(.X,PXCPTDT,.PXDATA)"
+5 IF PXDFLT]""
SET DIR("B")=PXDFLT
+6 DO ^DIR
+7 IF $DATA(DIRUT)
IF X="@"
QUIT X
+8 IF $DATA(DIRUT)!($DATA(DUOUT))!($DATA(DTOUT))!(Y="")
QUIT -1
+9 IF PXDATA<0
DO CPTHLP^PXCPTAPI
GOTO PROMPT
+10 QUIT PXDATA
+11 ;
+12 ;
VALCPT(PXTEXT,PXCPTDT,PXVAL) ;
+1 ;Validate freetext responce entered for CPT Code question
+2 ;Input: PXTEXT - CPT Code or CPT Code and CPT Modifier Code
+3 ; format: CPT or CPT-MOD,MOD,...
+4 ; where CPT = valid CPT Code
+5 ; MOD = valid Modifier Code
+6 ; PXCPTDT - visit date
+7 ;
+8 ;
+9 ;
+10 ;Output: 1 - Valid
+11 ; 0 - Invalid
+12 ;
+13 NEW DIC,X,Y
+14 SET X=$PIECE(PXTEXT,"-")
+15 SET DIC=81
+16 SET DIC(0)="EMQ"
+17 SET DIC("S")="I $$CPTSCREN^PXBUTL(Y,PXCPTDT)"
+18 DO ^DIC
+19 SET PXVAL=Y_$SELECT($PIECE(PXTEXT,"-",2)]"":"-"_$PIECE(PXTEXT,"-",2),1:"")
+20 QUIT Y
+21 ;
CPTMOD(PXIEN,PXMOD,PXHELP) ;Validate selected modifier
+1 ;
+2 ; INPUT: PXIEN - IEN for CPT code in V CPT file
+3 ; PXMOD - IEN for CPT modifier
+4 ; PXHELP - Flag to determing if help text should display
+5 ; when an invalid modifier is entered.
+6 ; where 1 = Display help text
+7 ; 0 = Do not display help text
+8 ;
+9 NEW PXVST,PXVSTDT,PXSTAT
+10 SET PXCPT=$PIECE(^AUPNVCPT(PXIEN,0),U)
+11 SET PXVST=$PIECE(^AUPNVCPT(PXIEN,0),U,3)
+12 SET PXVSTDT=$PIECE($GET(^AUPNVSIT(PXVST,0)),U)
+13 SET PXSTAT=$$MODP^ICPTMOD(PXCPT,PXMOD,"I",PXVSTDT)
+14 IF PXSTAT'>0
DO MODHLP
+15 QUIT PXSTAT
+16 ;
CPTHLP ;CPT code help text display
+1 ;
+2 WRITE !,"Enter CPT code or partial name for lookup."
+3 QUIT
MODHLP ;CPT modifier help text display
+1 ;
+2 IF '$GET(PXHELP)
QUIT
+3 WRITE !,"You can only enter a modifier that is valid for the selected CPT code."
+4 QUIT