source: WorldVistAEHR/trunk/r/PCE_PATIENT_CARE_ENCOUNTER-AUTN-EFDP-PX-VSIT--PXRM/PXCPTAPI.m@ 1240

Last change on this file since 1240 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 2.0 KB
RevLine 
[613]1PXCPTAPI ;ALB/EW - PCE CPT CODE API ; 9/3/99
2 ;;1.0;PCE PATIENT CARE ENCOUNTER;**73**;Aug 12, 1996
3GETCODE(PXDFLT,PXCPTDT) ;Read in CPT Code
4 ;
5 ; INPUT: PXDFLT - Default CPT code
6 ; PXCPTDT - Visit date
7 ;
8 ; OUTPUT: CPT CODE - Modifier string
9 ;
10 ;
11PROMPT N DIR,DIRUT,DUOUT,DTOUT,PXDATA,X,Y
12 S DIR(0)="FAO^^K:'$$VALCPT^PXCPTAPI(X,PXCPTDT,.PXDATA) X"
13 S DIR("A")="CPT Code: "
14 S DIR("?")="^D CPTHLP^PXCPTAPI"
15 S DIR("??")="^S X=$$VALCPT^PXCPTAPI(.X,PXCPTDT,.PXDATA)"
16 S:PXDFLT]"" DIR("B")=PXDFLT
17 D ^DIR
18 I $D(DIRUT),X="@" Q X
19 I $D(DIRUT)!($D(DUOUT))!($D(DTOUT))!(Y="") Q -1
20 I PXDATA<0 D CPTHLP^PXCPTAPI G PROMPT
21 Q PXDATA
22 ;
23 ;
24VALCPT(PXTEXT,PXCPTDT,PXVAL) ;
25 ;Validate freetext responce entered for CPT Code question
26 ;Input: PXTEXT - CPT Code or CPT Code and CPT Modifier Code
27 ; format: CPT or CPT-MOD,MOD,...
28 ; where CPT = valid CPT Code
29 ; MOD = valid Modifier Code
30 ; PXCPTDT - visit date
31 ;
32 ;
33 ;
34 ;Output: 1 - Valid
35 ; 0 - Invalid
36 ;
37 N DIC,X,Y
38 S X=$P(PXTEXT,"-")
39 S DIC=81
40 S DIC(0)="EMQ"
41 S DIC("S")="I $$CPTSCREN^PXBUTL(Y,PXCPTDT)"
42 D ^DIC
43 S PXVAL=Y_$S($P(PXTEXT,"-",2)]"":"-"_$P(PXTEXT,"-",2),1:"")
44 Q Y
45 ;
46CPTMOD(PXIEN,PXMOD,PXHELP) ;Validate selected modifier
47 ;
48 ; INPUT: PXIEN - IEN for CPT code in V CPT file
49 ; PXMOD - IEN for CPT modifier
50 ; PXHELP - Flag to determing if help text should display
51 ; when an invalid modifier is entered.
52 ; where 1 = Display help text
53 ; 0 = Do not display help text
54 ;
55 N PXVST,PXVSTDT,PXSTAT
56 S PXCPT=$P(^AUPNVCPT(PXIEN,0),U)
57 S PXVST=$P(^AUPNVCPT(PXIEN,0),U,3)
58 S PXVSTDT=$P($G(^AUPNVSIT(PXVST,0)),U)
59 S PXSTAT=$$MODP^ICPTMOD(PXCPT,PXMOD,"I",PXVSTDT)
60 D:PXSTAT'>0 MODHLP
61 Q PXSTAT
62 ;
63CPTHLP ;CPT code help text display
64 ;
65 W !,"Enter CPT code or partial name for lookup."
66 Q
67MODHLP ;CPT modifier help text display
68 ;
69 Q:'$G(PXHELP)
70 W !,"You can only enter a modifier that is valid for the selected CPT code."
71 Q
Note: See TracBrowser for help on using the repository browser.