source: FOIAVistA/trunk/r/TEXT_INTEGRATION_UTILITIES-GMRP-TIU/TIUPXAPM.m@ 1569

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

initial load of FOIAVistA 6/30/08 version

File size: 2.9 KB
Line 
1TIUPXAPM ;SLC/RMO - CPT Modifier API(s) ;03/06/03@1500
2 ;;1.0;TEXT INTEGRATION UTILITIES;**82,161**;Jun 20, 1997
3 ;
4 ;Pass in encounter date for CSV **161**
5MOD(CPT,TIUI,TIUVDT) ;Select CPT Modifiers for CPT Code
6 ; Input -- CPT CPT Selection Array
7 ; TIUI Item Number in CPT Selection Array
8 ; TIUVDT Encounter Date
9 ; Output -- CPT CPT Selection Array
10 N CPTIEN,I,MOD,MODATA,MODCNT
11 S CPTIEN=+CPT(TIUI)
12 ;
13 ;Check if there are any selectable CPT Modifiers for the CPT Code
14 ;Current date passed to ICPTCOD, changed to encounter date for CSV **161**
15 I +$$CODM^ICPTCOD(CPTIEN,,"",TIUVDT)'>0 G MODQ
16 ;
17 ;Set CPT Modifier Selection Array for pre-selected CPT Modifiers
18 S (I,MODCNT)=0
19 F S I=$O(CPT(TIUI,"MOD",I)) Q:'I D
20 . S MODCNT=MODCNT+1
21 . S MOD(+$G(CPT(TIUI,"MOD",MODCNT)))=""
22 ;
23 ;Display pre-selected CPT Modifiers
24 D DISMOD(.CPT,TIUI,1)
25 ;
26 ;Ask CPT Modifiers
27 S MODCNT=$S($G(MODCNT):MODCNT,1:0)
28 ;Pass encounter date to ASKMOD for CSV **161**
29 F Q:'$$ASKMOD(CPTIEN,.MOD,MODCNT,.MODATA,TIUVDT) D
30 . S MOD(+MODATA)=""
31 . S MODCNT=MODCNT+1
32 . S CPT(TIUI,"MOD",MODCNT)=MODATA
33 . S MODATA=""
34MODQ Q
35 ;
36 ;Pass in encounter date for CSV **161**
37ASKMOD(CPTIEN,MOD,MODCNT,MODATA,TIUVDT) ;Ask CPT Modifier
38 ; Input -- CPTIEN CPT file (#81) IEN
39 ; MOD CPT Modifier Selection Array
40 ; MODCNT Number of Modifiers Selected
41 ; TIUVDT Encounter Date
42 ; Output -- 1=Successful and 0=Failure
43 ; MODATA Modifier Data from Modifier file (#81.3)
44 ; 1st Piece=IEN
45 ; 2nd Piece=Modifier field (#.01)
46 ; 3rd Piece=Name field (#.02)
47 N DIR,DTOUT,DUOUT,Y
48 S DIR(0)="PAO^81.3:AEMQZ^K:'$$CHKMOD^TIUPXAPM(.MOD,+Y) X"
49 S DIR("A")="Select "_$S($G(MODCNT):"another ",1:"")_"CPT MODIFIER: "
50 ;Pass encounter date to ICPTMOD for CSV **161**
51 S DIR("S")="I +$$MODP^ICPTMOD(CPTIEN,+Y,""I"",TIUVDT)>0"
52 D ^DIR
53 I Y>0 S MODATA=+Y_U_$P(Y(0),U,1,2)
54 Q $S($G(MODATA)="":0,1:1)
55 ;
56CHKMOD(MOD,MODIEN) ;Check Selected CPT Modifier
57 ; Input -- MOD CPT Modifier Selection Array
58 ; MODIEN Modifier file (#81.3) IEN
59 ; Output -- 1=Successful and 0=Failure
60 N Y
61 S Y=1
62 ;Check if CPT Modifier has already been selected
63 I $D(MOD(MODIEN)) D EN^DDIOL("This CPT Modifier has already been selected.","","!?5") S Y=0
64 Q +$G(Y)
65 ;
66DISMOD(CPT,TIUI,TIUSELF) ;Display Selected CPT Modifiers
67 ; Input -- CPT CPT Selection Array
68 ; TIUI Item Number in CPT Selection Array
69 ; TIUSELF Selection Process Flag (Optional)
70 ; 1=Selection Process
71 ; Output -- None
72 N CAP,MODATA,MODCNT,TC
73 ;
74 ;Set caption and format parameter
75 I $G(TIUSELF) D
76 . S CAP="Current CPT Modifiers:",TC=0
77 ELSE D
78 . S CAP="CPT Modifier(s):",TC=8
79 S MODCNT=0
80 F S MODCNT=$O(CPT(TIUI,"MOD",MODCNT)) Q:'MODCNT D
81 . S MODATA=$G(CPT(TIUI,"MOD",MODCNT))
82 . W:MODCNT=1 !,?TC,CAP
83 . W !?12,"-",$P(MODATA,U,2),?19,$P(MODATA,U,3)
84 Q
Note: See TracBrowser for help on using the repository browser.