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

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

initial load of WorldVistAEHR

File size: 3.8 KB
Line 
1PXAAVCPT ;ISA/Zoltan,KWP - APIs for V CPT (#9000010.18). ;Jun 21, 1999
2 ;;1.0;PCE PATIENT CARE ENCOUNTER;**77**;Aug 12, 1996
3 ;
4 ;+APIs for V CPT (#9000010.18)
5 ;+See PXAADOC for additional comments on the PXAA routines
6 ;
7GETIENS(VSITIEN,ARRAY) ;+Gets all iens associated with the visit.
8 K ARRAY N X ;+Wipe out any exisiting array contents.
9 Q:'$D(^AUPNVCPT("AD",VSITIEN)) 0 ;+Exit if no such record.
10 S X="" F S X=$O(^AUPNVCPT("AD",VSITIEN,X)) Q:X="" S ARRAY(X)=""
11 Q 1
12LOADFLDS(IEN,ARRAY) ;+Loads all fields for V CPT (#9000010.18).
13 K ARRAY ;+Wipe out any exisiting array contents.
14 N SIEN
15 Q:'$D(^AUPNVCPT(IEN)) 0 ;+Exit if no such record.
16 ;+ ARRAY(.01) = CPT field.
17 S ARRAY(.01)=$P($G(^AUPNVCPT(IEN,0)),"^",1)
18 ;+ ARRAY(.02) = PATIENT NAME field.
19 S ARRAY(.02)=$P($G(^AUPNVCPT(IEN,0)),"^",2)
20 ;+ ARRAY(.03) = VISIT field.
21 S ARRAY(.03)=$P($G(^AUPNVCPT(IEN,0)),"^",3)
22 ;+ ARRAY(.04) = PROVIDER NARRATIVE field.
23 S ARRAY(.04)=$P($G(^AUPNVCPT(IEN,0)),"^",4)
24 ;+ ARRAY(.05) = DIAGNOSIS field.
25 S ARRAY(.05)=$P($G(^AUPNVCPT(IEN,0)),"^",5)
26 ;+ ARRAY(.07) = PRINCIPAL PROCEDURE field.
27 S ARRAY(.07)=$P($G(^AUPNVCPT(IEN,0)),"^",7)
28 ;+ ARRAY(.16) = QUANTITY field.
29 S ARRAY(.16)=$P($G(^AUPNVCPT(IEN,0)),"^",16)
30 ;+ ARRAY(1) contains the CPT MODIFIER field (multiple):
31 S SIEN=0
32 F S SIEN=$O(^AUPNVCPT(IEN,1,SIEN)) Q:'SIEN D
33 . ;+ ARRAY(1,SIEN,.01) = CPT MODIFIER sub-field.
34 . S ARRAY(1,SIEN,.01)=$P($G(^AUPNVCPT(IEN,1,SIEN,0)),"^",1)
35 ;+ ARRAY(1201) = EVENT DATE AND TIME field.
36 S ARRAY(1201)=$P($G(^AUPNVCPT(IEN,12)),"^",1)
37 ;+ ARRAY(1202) = ORDERING PROVIDER field.
38 S ARRAY(1202)=$P($G(^AUPNVCPT(IEN,12)),"^",2)
39 ;+ ARRAY(1204) = ENCOUNTER PROVIDER field.
40 S ARRAY(1204)=$P($G(^AUPNVCPT(IEN,12)),"^",4)
41 ;+ ARRAY(80101) = EDITED FLAG field.
42 S ARRAY(80101)=$P($G(^AUPNVCPT(IEN,801)),"^",1)
43 ;+ ARRAY(80102) = AUDIT TRAIL field.
44 S ARRAY(80102)=$P($G(^AUPNVCPT(IEN,801)),"^",2)
45 ;+ ARRAY(80201) = PROVIDER NARRATIVE CATEGORY field.
46 S ARRAY(80201)=$P($G(^AUPNVCPT(IEN,802)),"^",1)
47 ;+ ARRAY(81101) = COMMENTS field.
48 S ARRAY(81101)=$P($G(^AUPNVCPT(IEN,811)),"^",1)
49 ;+ ARRAY(81201) = VERIFIED field.
50 S ARRAY(81201)=$P($G(^AUPNVCPT(IEN,812)),"^",1)
51 ;+ ARRAY(81202) = PACKAGE field.
52 S ARRAY(81202)=$P($G(^AUPNVCPT(IEN,812)),"^",2)
53 ;+ ARRAY(81203) = DATA SOURCE field.
54 S ARRAY(81203)=$P($G(^AUPNVCPT(IEN,812)),"^",3)
55 Q 1
56CPT(IEN) ;+ Returns #.01 CPT.
57 Q $P($G(^AUPNVCPT(IEN,0)),"^",1)
58PATINAME(IEN) ;+ Returns #.02 PATIENT NAME.
59 Q $P($G(^AUPNVCPT(IEN,0)),"^",2)
60VISIT(IEN) ;+ Returns #.03 VISIT.
61 Q $P($G(^AUPNVCPT(IEN,0)),"^",3)
62PROVNARR(IEN) ;+ Returns #.04 PROVIDER NARRATIVE.
63 Q $P($G(^AUPNVCPT(IEN,0)),"^",4)
64DIAGNOSI(IEN) ;+ Returns #.05 DIAGNOSIS.
65 Q $P($G(^AUPNVCPT(IEN,0)),"^",5)
66PRINPROC(IEN) ;+ Returns #.07 PRINCIPAL PROCEDURE.
67 Q $P($G(^AUPNVCPT(IEN,0)),"^",7)
68QUANTITY(IEN) ;+ Returns #.16 QUANTITY.
69 Q $P($G(^AUPNVCPT(IEN,0)),"^",16)
70CPTMODIF(IEN,ARRAY) ;+ Returns #1 CPT MODIFIER.
71 N SIEN
72 S SIEN=0
73 F S SIEN=$O(^AUPNVCPT(IEN,1,SIEN)) Q:'SIEN D
74 . ;+ ARRAY(1,SIEN,.01) = CPT MODIFIER field.
75 . S ARRAY(1,SIEN,.01)=$P($G(^AUPNVCPT(IEN,1,SIEN,0)),"^",1)
76 Q
77EVENTDT(IEN) ;+ Returns #1201 EVENT DATE AND TIME.
78 Q $P($G(^AUPNVCPT(IEN,12)),"^",1)
79ORDEPROV(IEN) ;+ Returns #1202 ORDERING PROVIDER.
80 Q $P($G(^AUPNVCPT(IEN,12)),"^",2)
81ENCOPROV(IEN) ;+ Returns #1204 ENCOUNTER PROVIDER.
82 Q $P($G(^AUPNVCPT(IEN,12)),"^",4)
83EDITFLAG(IEN) ;+ Returns #80101 EDITED FLAG.
84 Q $P($G(^AUPNVCPT(IEN,801)),"^",1)
85AUDITRAI(IEN) ;+ Returns #80102 AUDIT TRAIL.
86 Q $P($G(^AUPNVCPT(IEN,801)),"^",2)
87PRONARCA(IEN) ;+ Returns #80201 PROVIDER NARRATIVE CATEGORY.
88 Q $P($G(^AUPNVCPT(IEN,802)),"^",1)
89COMMENTS(IEN) ;+ Returns #81101 COMMENTS.
90 Q $P($G(^AUPNVCPT(IEN,811)),"^",1)
91VERIFIED(IEN) ;+ Returns #81201 VERIFIED.
92 Q $P($G(^AUPNVCPT(IEN,812)),"^",1)
93PACKAGE(IEN) ;+ Returns #81202 PACKAGE.
94 Q $P($G(^AUPNVCPT(IEN,812)),"^",2)
95DATASRC(IEN) ;+ Returns #81203 DATA SOURCE.
96 Q $P($G(^AUPNVCPT(IEN,812)),"^",3)
Note: See TracBrowser for help on using the repository browser.