PXAAVCPT ;ISA/Zoltan,KWP - APIs for V CPT (#9000010.18). ;Jun 21, 1999
;;1.0;PCE PATIENT CARE ENCOUNTER;**77**;Aug 12, 1996
;
;+APIs for V CPT (#9000010.18)
;+See PXAADOC for additional comments on the PXAA routines
;
GETIENS(VSITIEN,ARRAY) ;+Gets all iens associated with the visit.
K ARRAY N X ;+Wipe out any exisiting array contents.
Q:'$D(^AUPNVCPT("AD",VSITIEN)) 0 ;+Exit if no such record.
S X="" F S X=$O(^AUPNVCPT("AD",VSITIEN,X)) Q:X="" S ARRAY(X)=""
Q 1
LOADFLDS(IEN,ARRAY) ;+Loads all fields for V CPT (#9000010.18).
K ARRAY ;+Wipe out any exisiting array contents.
N SIEN
Q:'$D(^AUPNVCPT(IEN)) 0 ;+Exit if no such record.
;+ ARRAY(.01) = CPT field.
S ARRAY(.01)=$P($G(^AUPNVCPT(IEN,0)),"^",1)
;+ ARRAY(.02) = PATIENT NAME field.
S ARRAY(.02)=$P($G(^AUPNVCPT(IEN,0)),"^",2)
;+ ARRAY(.03) = VISIT field.
S ARRAY(.03)=$P($G(^AUPNVCPT(IEN,0)),"^",3)
;+ ARRAY(.04) = PROVIDER NARRATIVE field.
S ARRAY(.04)=$P($G(^AUPNVCPT(IEN,0)),"^",4)
;+ ARRAY(.05) = DIAGNOSIS field.
S ARRAY(.05)=$P($G(^AUPNVCPT(IEN,0)),"^",5)
;+ ARRAY(.07) = PRINCIPAL PROCEDURE field.
S ARRAY(.07)=$P($G(^AUPNVCPT(IEN,0)),"^",7)
;+ ARRAY(.16) = QUANTITY field.
S ARRAY(.16)=$P($G(^AUPNVCPT(IEN,0)),"^",16)
;+ ARRAY(1) contains the CPT MODIFIER field (multiple):
S SIEN=0
F S SIEN=$O(^AUPNVCPT(IEN,1,SIEN)) Q:'SIEN D
. ;+ ARRAY(1,SIEN,.01) = CPT MODIFIER sub-field.
. S ARRAY(1,SIEN,.01)=$P($G(^AUPNVCPT(IEN,1,SIEN,0)),"^",1)
;+ ARRAY(1201) = EVENT DATE AND TIME field.
S ARRAY(1201)=$P($G(^AUPNVCPT(IEN,12)),"^",1)
;+ ARRAY(1202) = ORDERING PROVIDER field.
S ARRAY(1202)=$P($G(^AUPNVCPT(IEN,12)),"^",2)
;+ ARRAY(1204) = ENCOUNTER PROVIDER field.
S ARRAY(1204)=$P($G(^AUPNVCPT(IEN,12)),"^",4)
;+ ARRAY(80101) = EDITED FLAG field.
S ARRAY(80101)=$P($G(^AUPNVCPT(IEN,801)),"^",1)
;+ ARRAY(80102) = AUDIT TRAIL field.
S ARRAY(80102)=$P($G(^AUPNVCPT(IEN,801)),"^",2)
;+ ARRAY(80201) = PROVIDER NARRATIVE CATEGORY field.
S ARRAY(80201)=$P($G(^AUPNVCPT(IEN,802)),"^",1)
;+ ARRAY(81101) = COMMENTS field.
S ARRAY(81101)=$P($G(^AUPNVCPT(IEN,811)),"^",1)
;+ ARRAY(81201) = VERIFIED field.
S ARRAY(81201)=$P($G(^AUPNVCPT(IEN,812)),"^",1)
;+ ARRAY(81202) = PACKAGE field.
S ARRAY(81202)=$P($G(^AUPNVCPT(IEN,812)),"^",2)
;+ ARRAY(81203) = DATA SOURCE field.
S ARRAY(81203)=$P($G(^AUPNVCPT(IEN,812)),"^",3)
Q 1
CPT(IEN) ;+ Returns #.01 CPT.
Q $P($G(^AUPNVCPT(IEN,0)),"^",1)
PATINAME(IEN) ;+ Returns #.02 PATIENT NAME.
Q $P($G(^AUPNVCPT(IEN,0)),"^",2)
VISIT(IEN) ;+ Returns #.03 VISIT.
Q $P($G(^AUPNVCPT(IEN,0)),"^",3)
PROVNARR(IEN) ;+ Returns #.04 PROVIDER NARRATIVE.
Q $P($G(^AUPNVCPT(IEN,0)),"^",4)
DIAGNOSI(IEN) ;+ Returns #.05 DIAGNOSIS.
Q $P($G(^AUPNVCPT(IEN,0)),"^",5)
PRINPROC(IEN) ;+ Returns #.07 PRINCIPAL PROCEDURE.
Q $P($G(^AUPNVCPT(IEN,0)),"^",7)
QUANTITY(IEN) ;+ Returns #.16 QUANTITY.
Q $P($G(^AUPNVCPT(IEN,0)),"^",16)
CPTMODIF(IEN,ARRAY) ;+ Returns #1 CPT MODIFIER.
N SIEN
S SIEN=0
F S SIEN=$O(^AUPNVCPT(IEN,1,SIEN)) Q:'SIEN D
. ;+ ARRAY(1,SIEN,.01) = CPT MODIFIER field.
. S ARRAY(1,SIEN,.01)=$P($G(^AUPNVCPT(IEN,1,SIEN,0)),"^",1)
Q
EVENTDT(IEN) ;+ Returns #1201 EVENT DATE AND TIME.
Q $P($G(^AUPNVCPT(IEN,12)),"^",1)
ORDEPROV(IEN) ;+ Returns #1202 ORDERING PROVIDER.
Q $P($G(^AUPNVCPT(IEN,12)),"^",2)
ENCOPROV(IEN) ;+ Returns #1204 ENCOUNTER PROVIDER.
Q $P($G(^AUPNVCPT(IEN,12)),"^",4)
EDITFLAG(IEN) ;+ Returns #80101 EDITED FLAG.
Q $P($G(^AUPNVCPT(IEN,801)),"^",1)
AUDITRAI(IEN) ;+ Returns #80102 AUDIT TRAIL.
Q $P($G(^AUPNVCPT(IEN,801)),"^",2)
PRONARCA(IEN) ;+ Returns #80201 PROVIDER NARRATIVE CATEGORY.
Q $P($G(^AUPNVCPT(IEN,802)),"^",1)
Q $P($G(^AUPNVCPT(IEN,811)),"^",1)
VERIFIED(IEN) ;+ Returns #81201 VERIFIED.
Q $P($G(^AUPNVCPT(IEN,812)),"^",1)
PACKAGE(IEN) ;+ Returns #81202 PACKAGE.
Q $P($G(^AUPNVCPT(IEN,812)),"^",2)
DATASRC(IEN) ;+ Returns #81203 DATA SOURCE.
Q $P($G(^AUPNVCPT(IEN,812)),"^",3)
PXAAVCPT ;ISA/Zoltan,KWP - APIs for V CPT (#9000010.18). ;Jun 21, 1999
+1 ;;1.0;PCE PATIENT CARE ENCOUNTER;**77**;Aug 12, 1996
+2 ;
+3 ;+APIs for V CPT (#9000010.18)
+4 ;+See PXAADOC for additional comments on the PXAA routines
+5 ;
GETIENS(VSITIEN,ARRAY) ;+Gets all iens associated with the visit.
+1 ;+Wipe out any exisiting array contents.
KILL ARRAY
NEW X
+2 ;+Exit if no such record.
IF '$DATA(^AUPNVCPT("AD",VSITIEN))
QUIT 0
+3 SET X=""
FOR
SET X=$ORDER(^AUPNVCPT("AD",VSITIEN,X))
IF X=""
QUIT
SET ARRAY(X)=""
+4 QUIT 1
LOADFLDS(IEN,ARRAY) ;+Loads all fields for V CPT (#9000010.18).
+1 ;+Wipe out any exisiting array contents.
KILL ARRAY
+2 NEW SIEN
+3 ;+Exit if no such record.
IF '$DATA(^AUPNVCPT(IEN))
QUIT 0
+4 ;+ ARRAY(.01) = CPT field.
+5 SET ARRAY(.01)=$PIECE($GET(^AUPNVCPT(IEN,0)),"^",1)
+6 ;+ ARRAY(.02) = PATIENT NAME field.
+7 SET ARRAY(.02)=$PIECE($GET(^AUPNVCPT(IEN,0)),"^",2)
+8 ;+ ARRAY(.03) = VISIT field.
+9 SET ARRAY(.03)=$PIECE($GET(^AUPNVCPT(IEN,0)),"^",3)
+10 ;+ ARRAY(.04) = PROVIDER NARRATIVE field.
+11 SET ARRAY(.04)=$PIECE($GET(^AUPNVCPT(IEN,0)),"^",4)
+12 ;+ ARRAY(.05) = DIAGNOSIS field.
+13 SET ARRAY(.05)=$PIECE($GET(^AUPNVCPT(IEN,0)),"^",5)
+14 ;+ ARRAY(.07) = PRINCIPAL PROCEDURE field.
+15 SET ARRAY(.07)=$PIECE($GET(^AUPNVCPT(IEN,0)),"^",7)
+16 ;+ ARRAY(.16) = QUANTITY field.
+17 SET ARRAY(.16)=$PIECE($GET(^AUPNVCPT(IEN,0)),"^",16)
+18 ;+ ARRAY(1) contains the CPT MODIFIER field (multiple):
+19 SET SIEN=0
+20 FOR
SET SIEN=$ORDER(^AUPNVCPT(IEN,1,SIEN))
IF 'SIEN
QUIT
Begin DoDot:1
+21 ;+ ARRAY(1,SIEN,.01) = CPT MODIFIER sub-field.
+22 SET ARRAY(1,SIEN,.01)=$PIECE($GET(^AUPNVCPT(IEN,1,SIEN,0)),"^",1)
End DoDot:1
+23 ;+ ARRAY(1201) = EVENT DATE AND TIME field.
+24 SET ARRAY(1201)=$PIECE($GET(^AUPNVCPT(IEN,12)),"^",1)
+25 ;+ ARRAY(1202) = ORDERING PROVIDER field.
+26 SET ARRAY(1202)=$PIECE($GET(^AUPNVCPT(IEN,12)),"^",2)
+27 ;+ ARRAY(1204) = ENCOUNTER PROVIDER field.
+28 SET ARRAY(1204)=$PIECE($GET(^AUPNVCPT(IEN,12)),"^",4)
+29 ;+ ARRAY(80101) = EDITED FLAG field.
+30 SET ARRAY(80101)=$PIECE($GET(^AUPNVCPT(IEN,801)),"^",1)
+31 ;+ ARRAY(80102) = AUDIT TRAIL field.
+32 SET ARRAY(80102)=$PIECE($GET(^AUPNVCPT(IEN,801)),"^",2)
+33 ;+ ARRAY(80201) = PROVIDER NARRATIVE CATEGORY field.
+34 SET ARRAY(80201)=$PIECE($GET(^AUPNVCPT(IEN,802)),"^",1)
+35 ;+ ARRAY(81101) = COMMENTS field.
+36 SET ARRAY(81101)=$PIECE($GET(^AUPNVCPT(IEN,811)),"^",1)
+37 ;+ ARRAY(81201) = VERIFIED field.
+38 SET ARRAY(81201)=$PIECE($GET(^AUPNVCPT(IEN,812)),"^",1)
+39 ;+ ARRAY(81202) = PACKAGE field.
+40 SET ARRAY(81202)=$PIECE($GET(^AUPNVCPT(IEN,812)),"^",2)
+41 ;+ ARRAY(81203) = DATA SOURCE field.
+42 SET ARRAY(81203)=$PIECE($GET(^AUPNVCPT(IEN,812)),"^",3)
+43 QUIT 1
CPT(IEN) ;+ Returns #.01 CPT.
+1 QUIT $PIECE($GET(^AUPNVCPT(IEN,0)),"^",1)
PATINAME(IEN) ;+ Returns #.02 PATIENT NAME.
+1 QUIT $PIECE($GET(^AUPNVCPT(IEN,0)),"^",2)
VISIT(IEN) ;+ Returns #.03 VISIT.
+1 QUIT $PIECE($GET(^AUPNVCPT(IEN,0)),"^",3)
PROVNARR(IEN) ;+ Returns #.04 PROVIDER NARRATIVE.
+1 QUIT $PIECE($GET(^AUPNVCPT(IEN,0)),"^",4)
DIAGNOSI(IEN) ;+ Returns #.05 DIAGNOSIS.
+1 QUIT $PIECE($GET(^AUPNVCPT(IEN,0)),"^",5)
PRINPROC(IEN) ;+ Returns #.07 PRINCIPAL PROCEDURE.
+1 QUIT $PIECE($GET(^AUPNVCPT(IEN,0)),"^",7)
QUANTITY(IEN) ;+ Returns #.16 QUANTITY.
+1 QUIT $PIECE($GET(^AUPNVCPT(IEN,0)),"^",16)
CPTMODIF(IEN,ARRAY) ;+ Returns #1 CPT MODIFIER.
+1 NEW SIEN
+2 SET SIEN=0
+3 FOR
SET SIEN=$ORDER(^AUPNVCPT(IEN,1,SIEN))
IF 'SIEN
QUIT
Begin DoDot:1
+4 ;+ ARRAY(1,SIEN,.01) = CPT MODIFIER field.
+5 SET ARRAY(1,SIEN,.01)=$PIECE($GET(^AUPNVCPT(IEN,1,SIEN,0)),"^",1)
End DoDot:1
+6 QUIT
EVENTDT(IEN) ;+ Returns #1201 EVENT DATE AND TIME.
+1 QUIT $PIECE($GET(^AUPNVCPT(IEN,12)),"^",1)
ORDEPROV(IEN) ;+ Returns #1202 ORDERING PROVIDER.
+1 QUIT $PIECE($GET(^AUPNVCPT(IEN,12)),"^",2)
ENCOPROV(IEN) ;+ Returns #1204 ENCOUNTER PROVIDER.
+1 QUIT $PIECE($GET(^AUPNVCPT(IEN,12)),"^",4)
EDITFLAG(IEN) ;+ Returns #80101 EDITED FLAG.
+1 QUIT $PIECE($GET(^AUPNVCPT(IEN,801)),"^",1)
AUDITRAI(IEN) ;+ Returns #80102 AUDIT TRAIL.
+1 QUIT $PIECE($GET(^AUPNVCPT(IEN,801)),"^",2)
PRONARCA(IEN) ;+ Returns #80201 PROVIDER NARRATIVE CATEGORY.
+1 QUIT $PIECE($GET(^AUPNVCPT(IEN,802)),"^",1)
+1 QUIT $PIECE($GET(^AUPNVCPT(IEN,811)),"^",1)
VERIFIED(IEN) ;+ Returns #81201 VERIFIED.
+1 QUIT $PIECE($GET(^AUPNVCPT(IEN,812)),"^",1)
PACKAGE(IEN) ;+ Returns #81202 PACKAGE.
+1 QUIT $PIECE($GET(^AUPNVCPT(IEN,812)),"^",2)
DATASRC(IEN) ;+ Returns #81203 DATA SOURCE.
+1 QUIT $PIECE($GET(^AUPNVCPT(IEN,812)),"^",3)